# HG changeset patch # User joachim99 # Date 1162598700 0 # Node ID 08ea9b86c12c4f9c00cf38a4dfaabe476085161b # Parent 069521efec1ace6eefba1fde86f2c41aae5ac99a KDiff3-0.9.91 diff -r 069521efec1a -r 08ea9b86c12c kdiff3/ChangeLog --- a/kdiff3/ChangeLog Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/ChangeLog Sat Nov 04 00:05:00 2006 +0000 @@ -1,3 +1,21 @@ +Version 0.9.91 - 2006/10/29 +=========================== +- Encoding auto detection +- Fix for crash after double click below last line +- Saving of maximized window-state (Patch by Robert Vock) +- Separated Merge-options in own tab because "Diff and Merge"-options tab got too big. +- When pasting multiple lines into openfile dialog only first line is kept +- Drawing in directory view fixed. +- When specifying a separate output dir then for equal files a copy operation will also be offered. +- Windows specific: + - Windows installer problems fixed for users without admin-rights + - Fix for slow startup problem on Windows (Patch by Manfred Koehler) + - New: diff-ext-for-kdiff3 - Shell extension (originally by Sergey Zorin) +- Qt4-version: + - Saving of merge-result didn't work. + - Start external processes directly without cmd.exe-window + - Rewrote everything requiring Qt3-support + Version 0.9.90 - 2006/05/14 =========================== - Fixed KIO-problems of type "File exists" with tempfiles (introduced in 0.9.89) diff -r 069521efec1a -r 08ea9b86c12c kdiff3/NEWS --- a/kdiff3/NEWS Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/NEWS Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1 @@ +See the ChangeLog diff -r 069521efec1a -r 08ea9b86c12c kdiff3/README --- a/kdiff3/README Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/README Sat Nov 04 00:05:00 2006 +0000 @@ -3,7 +3,7 @@ Author: Joachim Eibl (joachim.eibl at gmx.de) Copyright: (C) 2002-2006 by Joachim Eibl -KDiff3-Version: 0.9.90-Qt4 +KDiff3-Version: 0.9.91 KDiff3 is a program that @@ -36,13 +36,150 @@ 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: - The version 0.9.90-Qt4 requires Qt 4.x.y (from www.trolltech.com) for compilation. - (Qt-version >= 4.1.2 is recommended.) + Version 0.9.91 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.) + It is now also possible to build with Qt4 (See further below). You always need - - kdiff3-0.9.90-Qt4.tar.gz + - kdiff3-0.9.91.tar.gz + + For building the KDE3-version + - KDE>=3.3 and QT>=3.3-libraries. (but not with KDE4) + - gcc, g++ with version >=3.2 + + For building the Qt-only-version + - QT-libraries (version >=3.3.0, but <4.0 or >=4.2.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.91 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.) + + +Building an RPM for Fedora Core (by Vadim Likhota) + Copy kdiff3-0.9.91.tar.gz into /usr/src/redhat/SOURCE + Copy kdiff3.spec into /usr/src/redhat/SPEC + Run rpmbuild -bb --target i686 kdiff3.spec + Find kdiff3-0.9.91-fc.i686.rpm in /usr/src/redhat/RPMS/I386 + + +Installation for the Qt-only-platforms for Un*x: + (for Qt >=3.3.0 but <4.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.91/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.91 + 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) Execute: + make -f Makefile.qt + 7) After the build completes copy kdiff3 from the kdiff3-0.9.91 directory to + /Applications + +---------------------------------------------------------------- + +Building KDiff3 with Qt4: + +Requirements & Installation: + The version 0.9.91 requires Qt 4.2.0 (from www.trolltech.com) for compilation. + + You always need + - kdiff3-0.9.91.tar.gz - for Un*x: gcc, g++ with version >=3.4.2 Qt-X11-libraries @@ -58,7 +195,7 @@ - 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 @@ -69,27 +206,29 @@ Note for KDE-users: - The version 0.9.90-Qt4 doesn't provide support for KDE-3.x + The version 0.9.91-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. + normal version 0.9.91. 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 + - cd into the directory kdiff3-0.9.91/src-QT4 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 + - cd into the directory kdiff3-0.9.91/src-Qt4 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 +- The qt-win-opensource-4.2.0-mingw.exe only installs release dlls. You will have to compile the + debug dlls yourself. Enter the qt-4.2.0-directory and run "configure -debug" and then "make". +- cd into the directory kdiff3-0.9.91/src-Qt4 - 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) @@ -103,6 +242,10 @@ 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! +(End of KDiff3 with Qt4-instructions) +------------------------------------------------------------------------ + + Start from commandline: - Comparing 2 files: kdiff3 file1 file2 - Merging 2 files: kdiff3 file1 file2 -o outputfile diff -r 069521efec1a -r 08ea9b86c12c kdiff3/TODO --- a/kdiff3/TODO Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/TODO Sat Nov 04 00:05:00 2006 +0000 @@ -1,8 +1,37 @@ - This file contains some feature-wishes for future KDiff3-versions. TODO ==== + +- Fix drawing in columns A/B/C-directory window +- Qt4-translation files +- Double clicking into empty area causes crash +- Option window is too big (within KDE). (Scrollable?) +- Windows issues: + - Diff-Ext-For-KDiff3 included in the installer + - language selection from within KDiff3 +- Export to html-format file +- Export to diff-format output (and import?) +- Export to diff3-format output (and import?) +- Use diff-output as input +- Variable width fonts. + + - Use regular expression to ignore certain patterns + - Start without visible compare widgets. (? what did I mean by that) + +- Hardlinks -performance support +- Manual alignment during merge should tell user his data will be lost +- Installer for windows for users. +- "List Only Deltas" causes directory merge to delete files + (https://sourceforge.net/tracker/index.php?func=detail&aid=1004853&group_id=58666&atid=488548) +- Diff-view for binary files +- Diff-view for pictures + +> > What I find weird is that KDiff3 first creates the 3-way merge view (so +> > the window splits in 4 parts), then closes that and reopens in 2-way +> > diff view. I've never seen the binary package do that. Can this be fixed? + + - Only show different lines. - ftp: Abbruch beim Einlesen von Verzeichnis stoppt nicht vollständig diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/.depend --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/.depend Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,385 @@ +class_factory.o: class_factory.cpp class_factory.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shlobj.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ole2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winerror.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objbase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpc.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windows.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/include/stdarg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windef.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnt.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/_mingw.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/include/stddef.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/basetsd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/pshpack4.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/poppack.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wincon.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winbase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wingdi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winuser.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnls.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winver.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnetwk.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winreg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsvc.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/cderr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/dde.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ddeml.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/dlgs.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/imm.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/lzexpand.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/mmsystem.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/nb30.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcdce.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/basetyps.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcdcep.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnsi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnterr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shellapi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/pshpack2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winperf.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/commdlg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winspool.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsock2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcndr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnsip.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objfwd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdlib.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wtypes.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/unknwn.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/cguid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/olectlid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oleauto.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oaidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oleidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shlguid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/commctrl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/prsht.h \ + diff_ext.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windowsx.h \ + server.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/list \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/functexcept.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/exception_defines.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++config.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/os_defines.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstddef \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/climits \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/limits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstdlib \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/new \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/exception \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/clocale \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/locale.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstdio \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++io.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/gthr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/gthr-default.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/errno.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cctype \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ctype.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stringfwd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/postypes.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cwchar \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ctime \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/time.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wctype.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdint.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_pair.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/type_traits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator_base_types.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator_base_funcs.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/concept_check.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/debug/debug.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cassert \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/assert.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ext/new_allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_construct.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_uninitialized.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_list.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/list.tcc \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/string \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/char_traits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/memory \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_raw_storage_iter.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_function.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/atomicity.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/atomic_word.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/algorithm \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algo.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_heap.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_tempbuf.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.tcc +diff_ext.o: diff_ext.cpp \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/assert.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/_mingw.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/include/stddef.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/include/stdarg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/tchar.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wctype.h \ + diff_ext.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windows.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windef.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnt.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winerror.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/basetsd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/pshpack4.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/poppack.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wincon.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winbase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wingdi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winuser.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnls.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winver.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnetwk.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winreg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsvc.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/cderr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/dde.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ddeml.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/dlgs.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/imm.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/lzexpand.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/mmsystem.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/nb30.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpc.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcdce.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/basetyps.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcdcep.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnsi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnterr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shellapi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/pshpack2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winperf.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/commdlg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winspool.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsock2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ole2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objbase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcndr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnsip.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objfwd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdlib.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wtypes.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/unknwn.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/cguid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/olectlid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oleauto.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oaidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oleidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windowsx.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shlobj.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shlguid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/commctrl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/prsht.h \ + server.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/list \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/functexcept.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/exception_defines.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++config.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/os_defines.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstddef \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/climits \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/limits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstdlib \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/new \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/exception \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/clocale \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/locale.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstdio \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++io.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/gthr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/gthr-default.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/errno.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cctype \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ctype.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stringfwd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/postypes.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cwchar \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ctime \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/time.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdint.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_pair.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/type_traits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator_base_types.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator_base_funcs.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/concept_check.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/debug/debug.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cassert \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ext/new_allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_construct.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_uninitialized.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_list.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/list.tcc \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/string \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/char_traits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/memory \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_raw_storage_iter.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_function.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/atomicity.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/atomic_word.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/algorithm \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algo.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_heap.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_tempbuf.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.tcc \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/map \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_tree.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/cpp_type_traits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_map.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_multimap.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/vector \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_vector.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_bvector.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/vector.tcc +server.o: server.cpp \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/_mingw.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/include/stddef.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/include/stdarg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windows.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/windef.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnt.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winerror.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/string.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/basetsd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/pshpack4.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/poppack.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wincon.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winbase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wingdi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winuser.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnls.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winver.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winnetwk.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winreg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsvc.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/cderr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/dde.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ddeml.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/dlgs.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/imm.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/lzexpand.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/mmsystem.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/nb30.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpc.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcdce.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/basetyps.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcdcep.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnsi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnterr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shellapi.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/pshpack2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winperf.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/commdlg.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winspool.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsock2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ole2.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objbase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcndr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/rpcnsip.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objfwd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdlib.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wtypes.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/unknwn.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/objidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/cguid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/olectlid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oleauto.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oaidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/oleidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/tchar.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wctype.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shlguid.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/olectl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ocidl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/initguid.h \ + server.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/list \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/functexcept.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/exception_defines.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algobase.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++config.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/os_defines.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstring \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstddef \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/climits \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/limits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstdlib \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/new \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/exception \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/iosfwd \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++locale.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/clocale \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/locale.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cstdio \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++io.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/gthr.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/gthr-default.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/errno.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cctype \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/ctype.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stringfwd.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/postypes.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cwchar \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ctime \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/time.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdint.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_pair.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/type_traits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator_base_types.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator_base_funcs.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/concept_check.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_iterator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/debug/debug.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cassert \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/assert.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/c++allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ext/new_allocator.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_construct.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_uninitialized.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_list.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/list.tcc \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/string \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/char_traits.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/memory \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_raw_storage_iter.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_function.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/atomicity.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits/atomic_word.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/algorithm \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_algo.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_heap.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/stl_tempbuf.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_string.tcc \ + class_factory.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/shlobj.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/commctrl.h \ + C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/prsht.h diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/LICENSE Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,25 @@ +Diff-Ext: Copyright (c) 2003-2006, Sergey Zorin + All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + 1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/Makefile Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,64 @@ +# Project: diff_ext +# Generates diff_ext_for_kdiff3.dll with gcc. +# Can be used for Cygwin and MingW (MingW ignores -mno-cygwin) +# +PROJ := diff_ext_for_kdiff3 + +CXX ?= g++.exe + +ifdef DEBUG + CXXFLAGS ?= -g +else + CXXFLAGS ?= -Os + LDFLAGS += -s +endif +CXXFLAGS += -ansi -pedantic -Wall -W -D_UNICODE -DUNICODE + +LIBS := -luuid -lole32 +DEFFILE = $(PROJ).def +STATICLIB = $(PROJ).a +EXPLIB = $(PROJ).exp + +SRC-CXX = $(wildcard *.cpp) +SRC-RC = $(wildcard *.rc) + +OBJ := $(SRC-CXX:.cpp=.o) +RES := $(SRC-RC:.rc=.res) +OBJ += $(RES) +DLL := $(PROJ).dll + +.PHONY: all clean + +.SUFFIXES: .rc .res + +all: .depend $(DLL) + +debug: + $(MAKE) DEBUG=YES UNICODE=YES + +release: + $(MAKE) + +.depend: Makefile $(SRC-RC) $(SRC-CXX) + $(CXX) -M $(CXXFLAGS) $(SRC-RC) $(SRC-CXX) > .depend + +include .depend + +clean: clean-custom + ${RM} $(OBJ) $(DLL) ${EXPLIB} $(STATICLIB) + +$(DLL): $(OBJ) + dllwrap.exe \ + --mno-cygwin \ + --def $(DEFFILE) \ + --output-exp ${EXPLIB} \ + --driver-name c++ -L/usr/local/lib -L/usr/lib/mingw \ + --implib $(STATICLIB) \ + $(OBJ) $(LDFLAGS) $(LIBS) \ + -o $@ + +.cpp.o: + $(CXX) $(CXXFLAGS) -c $< -o $@ + +.rc.res: + windres.exe $< -J rc -o $@ -O coff -DMING diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/README Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,41 @@ +Diff-Ext for KDiff3 - Readme +============================ + +Authors: + Sergey Zorin (Author of diff-ext, see http://diff-ext.sourceforge.net) + Joachim Eibl (KDiff3-specific extensions and integration, see http://kdiff3.sourceforge.net) + + +Copyright (c): +Original Diff-Ext: Copyright (c) 2003-2006, Sergey Zorin, All rights reserved. +Extensions for KDiff3: Copyright (c) 2006, Joachim Eibl + + +License: See file LICENSE in this subdirectory + + +Building: +Via MinGW-compiler package (http://www.mingw.org/): Compile via gnu-make (Makefile) +Via MSVC2005: Use vcproj-file. + + +Installation: +For basic testing you can run "regsvr32 diff_ext_for_kdiff3.dll". +To use all features the installation that comes with the KDiff3-setup*.exe is recommended. +See also the nsi-file available on the KDiff3-subversion-repository: +http://svn.sourceforge.net/viewvc/*checkout*/kdiff3/trunk/kdiff3/windows_installer/kdiff3.nsi + + +Translation: +If you would like help translating diff-ext-for-kdiff3 please copy the diff_ext.pot to +diff_ext_xx.po (where xx is the language-shortcut). +Then edit that file and fill in the msgstr-string for each respective msgid-string. +Then place the for in the KDiff3-translations subdirectory. +Use the language selection within KDiff3 to switch the language or set the language shortcut +in the registry HKEY_CURRENT_USER\Software\KDiff3\diff-ext: Language +If everything works, please send me the created file. + + +Have fun, +Joachim + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/class_factory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/class_factory.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2003, Sergey Zorin. All rights reserved. + * + * This software is distributable under the BSD license. See the terms + * of the BSD license in the LICENSE file provided with this software. + * + */ + +#include "class_factory.h" +#include "diff_ext.h" +#include "server.h" + +CLASS_FACTORY::CLASS_FACTORY() { + _ref_count = 0L; + + SERVER::instance()->lock(); +} + +CLASS_FACTORY::~CLASS_FACTORY() { + SERVER::instance()->release(); +} + +STDMETHODIMP +CLASS_FACTORY::QueryInterface(REFIID riid, void** ppv) { + HRESULT ret = E_NOINTERFACE; + *ppv = 0; + + if(IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory)) { + *ppv = static_cast(this); + + AddRef(); + + ret = NOERROR; + } + + return ret; +} + +STDMETHODIMP_(ULONG) +CLASS_FACTORY::AddRef() { + return InterlockedIncrement((LPLONG)&_ref_count); +} + +STDMETHODIMP_(ULONG) +CLASS_FACTORY::Release() { + ULONG ret = 0L; + + if(InterlockedDecrement((LPLONG)&_ref_count) != 0) + ret = _ref_count; + else + delete this; + + return ret; +} + +STDMETHODIMP +CLASS_FACTORY::CreateInstance(IUnknown* outer, REFIID refiid, void** obj) { + HRESULT ret = CLASS_E_NOAGGREGATION; + *obj = 0; + + // Shell extensions typically don't support aggregation (inheritance) + if(outer == 0) { + DIFF_EXT* ext = new DIFF_EXT(); + + if(ext == 0) + ret = E_OUTOFMEMORY; + else + ret = ext->QueryInterface(refiid, obj); + } + + return ret; +} + +STDMETHODIMP +CLASS_FACTORY::LockServer(BOOL) { + return NOERROR; +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/class_factory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/class_factory.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003, Sergey Zorin. All rights reserved. + * + * This software is distributable under the BSD license. See the terms + * of the BSD license in the LICENSE file provided with this software. + * + */ + +#ifndef __class_factory_h__ +#define __class_factory_h__ + +#include +#include + +class CLASS_FACTORY : public IClassFactory { + public: + CLASS_FACTORY(); + virtual ~CLASS_FACTORY(); + + //IUnknown members + STDMETHODIMP QueryInterface(REFIID, void**); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + + //ICLASS_FACTORY members + STDMETHODIMP CreateInstance(IUnknown*, REFIID, void**); + STDMETHODIMP LockServer(BOOL); + + private: + ULONG _ref_count; +}; + +#endif //__class_factory_h__ diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,615 @@ +/* + * Copyright (c) 2003-2006, Sergey Zorin. All rights reserved. + * + * This software is distributable under the BSD license. See the terms + * of the BSD license in the LICENSE file provided with this software. + * + */ +#define _CRT_SECURE_NO_DEPRECATE + +#include +#include +#include + +#include "diff_ext.h" +#include +#include + + +#ifdef UNICODE + +static void parseString( const std::wstring& s, size_t& i /*pos*/, std::wstring& r /*result*/ ) +{ + size_t size = s.size(); + ++i; // Skip initial '"' + for( ; i s_translationMap; +static tstring s_translationFileName; + +void readTranslationFile() +{ + s_translationMap.clear(); + FILE* pFile = _tfopen( s_translationFileName.c_str(), TEXT("rb") ); + if ( pFile ) + { + MESSAGELOG( TEXT( "Reading translations: " ) + s_translationFileName ); + std::vector buffer; + try { + if ( fseek(pFile, 0, SEEK_END)==0 ) + { + size_t length = ftell(pFile); // Get the file length + buffer.resize(length); + fseek(pFile, 0, SEEK_SET ); + fread(&buffer[0], 1, length, pFile ); + } + } + catch(...) + { + } + fclose(pFile); + + if (buffer.size()>0) + { + size_t bufferSize = buffer.size(); + int offset = 0; + if ( buffer[0]=='\xEF' && buffer[1]=='\xBB' && buffer[2]=='\xBF' ) + { + offset += 3; + bufferSize -= 3; + } + + size_t sLength = MultiByteToWideChar(CP_UTF8,0,&buffer[offset], (int)bufferSize, 0, 0 ); + std::wstring s( sLength, L' ' ); + MultiByteToWideChar(CP_UTF8,0,&buffer[offset], (int)bufferSize, &s[0], (int)s.size() ); + + // Now analyse the file and extract translation strings + std::wstring msgid; + std::wstring msgstr; + msgid.reserve( 1000 ); + msgstr.reserve( 1000 ); + bool bExpectingId = true; + for( size_t i=0; i5 && wcsncmp( &s[i], L"msgid", 5 )==0 ) + { + if ( !msgid.empty() && !msgstr.empty() ) + { + s_translationMap[msgid] = msgstr; + } + bExpectingId = true; + msgid.clear(); + i+=4; + } + else if ( sLength-i>6 && wcsncmp( &s[i], L"msgstr", 6 )==0 ) + { + bExpectingId = false; + msgstr.clear(); + i+=5; + } + else + { + // Unexpected ? + } + } + } + } + else + { + ERRORLOG( TEXT( "Reading translations failed: " ) + s_translationFileName ); + } +} + +static tstring getTranslation( const tstring& fallback ) +{ + std::map< std::wstring, std::wstring >::iterator i = s_translationMap.find( fallback ); + if (i!=s_translationMap.end()) + return i->second; + return fallback; +} +#else + +static tstring getTranslation( const tstring& fallback ) +{ + return fallback; +} + +#endif + + +static void replaceArgs( tstring& s, const tstring& r1, const tstring& r2=TEXT(""), const tstring& r3=TEXT("") ) +{ + tstring arg1 = TEXT("%1"); + size_t pos1 = s.find( arg1 ); + tstring arg2 = TEXT("%2"); + size_t pos2 = s.find( arg2 ); + tstring arg3 = TEXT("%3"); + size_t pos3 = s.find( arg3 ); + if ( pos1 != size_t(-1) ) + { + s.replace( pos1, arg1.length(), r1 ); + if ( pos2 != size_t(-1) && pos1recent_files() ) +{ + LOG(); + _resource = SERVER::instance()->handle(); + + SERVER::instance()->lock(); +} + +DIFF_EXT::~DIFF_EXT() +{ + LOG(); + if(_resource != SERVER::instance()->handle()) { + FreeLibrary(_resource); + } + + SERVER::instance()->release(); +} + +STDMETHODIMP +DIFF_EXT::QueryInterface(REFIID refiid, void** ppv) +{ + HRESULT ret = E_NOINTERFACE; + *ppv = 0; + + if(IsEqualIID(refiid, IID_IShellExtInit) || IsEqualIID(refiid, IID_IUnknown)) { + *ppv = static_cast(this); + } else if (IsEqualIID(refiid, IID_IContextMenu)) { + *ppv = static_cast(this); + } + + if(*ppv != 0) { + AddRef(); + + ret = NOERROR; + } + + return ret; +} + +STDMETHODIMP_(ULONG) +DIFF_EXT::AddRef() +{ + return InterlockedIncrement((LPLONG)&_ref_count); +} + +STDMETHODIMP_(ULONG) +DIFF_EXT::Release() +{ + ULONG ret = 0L; + + if(InterlockedDecrement((LPLONG)&_ref_count) != 0) { + ret = _ref_count; + } else { + delete this; + } + + return ret; +} + + + +STDMETHODIMP +DIFF_EXT::Initialize(LPCITEMIDLIST /*folder not used*/, IDataObject* data, HKEY /*key not used*/) +{ + LOG(); + +#ifdef UNICODE + tstring installDir = SERVER::instance()->getRegistryKeyString( TEXT(""), TEXT("InstallDir") ); + tstring language = SERVER::instance()->getRegistryKeyString( TEXT(""), TEXT("Language") ); + tstring translationFileName = installDir + TEXT("\\translations\\diff_ext_") + language + TEXT(".po"); + if ( s_translationFileName != translationFileName ) + { + s_translationFileName = translationFileName; + readTranslationFile(); + } +#endif + + FORMATETC format = {CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + STGMEDIUM medium; + medium.tymed = TYMED_HGLOBAL; + HRESULT ret = E_INVALIDARG; + + if(data->GetData(&format, &medium) == S_OK) + { + HDROP drop = (HDROP)medium.hGlobal; + m_nrOfSelectedFiles = DragQueryFile(drop, 0xFFFFFFFF, 0, 0); + + TCHAR tmp[MAX_PATH]; + + //initialize_language(); + + if (m_nrOfSelectedFiles >= 1 && m_nrOfSelectedFiles <= 3) + { + DragQueryFile(drop, 0, tmp, MAX_PATH); + _file_name1 = tmp; + + if(m_nrOfSelectedFiles >= 2) + { + DragQueryFile(drop, 1, tmp, MAX_PATH); + _file_name2 = tmp; + } + + if( m_nrOfSelectedFiles == 3) + { + DragQueryFile(drop, 2, tmp, MAX_PATH); + _file_name3 = tmp; + } + + ret = S_OK; + } + } + else + { + SYSERRORLOG(TEXT("GetData")); + } + + return ret; +} + +static int insertMenuItemHelper( HMENU menu, UINT id, UINT position, const tstring& text, + UINT fState = MFS_ENABLED, HMENU hSubMenu=0 ) +{ + MENUITEMINFO item_info; + ZeroMemory(&item_info, sizeof(item_info)); + item_info.cbSize = sizeof(MENUITEMINFO); + item_info.wID = id; + if (text.empty()) + { // Separator + item_info.fMask = MIIM_TYPE; + item_info.fType = MFT_SEPARATOR; + item_info.dwTypeData = 0; + } + else + { + item_info.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | (hSubMenu!=0 ? MIIM_SUBMENU : 0); + item_info.fType = MFT_STRING; + item_info.fState = fState; + item_info.dwTypeData = (LPTSTR)text.c_str(); + item_info.hSubMenu = hSubMenu; + } + if ( 0 == InsertMenuItem(menu, position, TRUE, &item_info) ) + SYSERRORLOG(TEXT("InsertMenuItem")); + return id; +} + + +STDMETHODIMP +DIFF_EXT::QueryContextMenu(HMENU menu, UINT position, UINT first_cmd, UINT /*last_cmd not used*/, UINT flags) +{ + LOG(); + m_id_Diff = UINT(-1); + m_id_DiffWith = UINT(-1); + m_id_DiffLater = UINT(-1); + m_id_MergeWith = UINT(-1); + m_id_Merge3 = UINT(-1); + m_id_Diff3 = UINT(-1); + m_id_DiffWith_Base = UINT(-1); + m_id_About = UINT(-1); + + HRESULT ret = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0); + + if(!(flags & CMF_DEFAULTONLY)) + { + /* Menu structure: + KDiff3 -> (1 File selected): Save 'selection' for later comparison (push onto history stack) + Compare 'selection' with first file on history stack. + Compare 'selection' with -> choice from history stack + Merge 'selection' with first file on history stack. + Merge 'selection' with last two files on history stack. + (2 Files selected): Compare 's1' with 's2' + Merge 's1' with 's2' + (3 Files selected): Compare 's1', 's2' and 's3' + */ + HMENU subMenu = CreateMenu(); + + UINT id = first_cmd; + m_id_FirstCmd = first_cmd; + + insertMenuItemHelper( menu, id++, position++, TEXT("") ); // begin separator + + tstring menuString; + UINT pos2=0; + if(m_nrOfSelectedFiles == 1) + { + size_t nrOfRecentFiles = m_recentFiles.size(); + tstring menuStringCompare = i18n("Compare with"); + tstring menuStringMerge = i18n("Merge with"); + if( nrOfRecentFiles>=1 ) + { + tstring firstFileName = cut_to_length( m_recentFiles.front() ); + menuStringCompare += TEXT(" '") + firstFileName + TEXT("'"); + menuStringMerge += TEXT(" '") + firstFileName + TEXT("'"); + } + m_id_DiffWith = insertMenuItemHelper( subMenu, id++, pos2++, menuStringCompare, nrOfRecentFiles >=1 ? MFS_ENABLED : MFS_DISABLED ); + m_id_MergeWith = insertMenuItemHelper( subMenu, id++, pos2++, menuStringMerge, nrOfRecentFiles >=1 ? MFS_ENABLED : MFS_DISABLED ); + + //if( nrOfRecentFiles>=2 ) + //{ + // tstring firstFileName = cut_to_length( m_recentFiles.front() ); + // tstring secondFileName = cut_to_length( *(++m_recentFiles.begin()) ); + //} + m_id_Merge3 = insertMenuItemHelper( subMenu, id++, pos2++, i18n("3-way merge with base"), + nrOfRecentFiles >=2 ? MFS_ENABLED : MFS_DISABLED ); + + menuString = i18n("Save '%1' for later comparison or merge"); + replaceArgs( menuString, _file_name1 ); + m_id_DiffLater = insertMenuItemHelper( subMenu, id++, pos2++, menuString ); + + HMENU file_list = CreateMenu(); + std::list::iterator i; + m_id_DiffWith_Base = id; + int n = 0; + for( i = m_recentFiles.begin(); i!=m_recentFiles.end(); ++i ) + { + tstring s = cut_to_length( *i ); + insertMenuItemHelper( file_list, id++, n, s ); + ++n; + } + + insertMenuItemHelper( subMenu, id++, pos2++, i18n("Compare with"), + nrOfRecentFiles > 0 ? MFS_ENABLED : MFS_DISABLED, file_list ); + } + else if(m_nrOfSelectedFiles == 2) + { + //= "Diff " + cut_to_length(_file_name1, 20)+" and "+cut_to_length(_file_name2, 20); + m_id_Diff = insertMenuItemHelper( subMenu, id++, pos2++, i18n("Compare") ); + } + else if ( m_nrOfSelectedFiles == 3 ) + { + m_id_Diff3 = insertMenuItemHelper( subMenu, id++, pos2++, i18n("3 way comparison") ); + } + else + { + // More than 3 files selected? + } + m_id_About = insertMenuItemHelper( subMenu, id++, pos2++, i18n("About Diff-Ext ...") ); + + insertMenuItemHelper( menu, id++, position++, TEXT("KDiff3"), MFS_ENABLED, subMenu ); + + insertMenuItemHelper( menu, id++, position++, TEXT("") ); // final separator + + ret = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, id-first_cmd); + } + + return ret; +} + +STDMETHODIMP +DIFF_EXT::InvokeCommand(LPCMINVOKECOMMANDINFO ici) +{ + HRESULT ret = NOERROR; + + _hwnd = ici->hwnd; + + if(HIWORD(ici->lpVerb) == 0) + { + UINT id = m_id_FirstCmd + LOWORD(ici->lpVerb); + if(id == m_id_Diff) + { + LOG(); + diff( TEXT("\"") + _file_name1 + TEXT("\" \"") + _file_name2 + TEXT("\"") ); + } + else if(id == m_id_Diff3) + { + LOG(); + diff( TEXT("\"") + _file_name1 + TEXT("\" \"") + _file_name2 + TEXT("\" \"") + _file_name3 + TEXT("\"") ); + } + else if(id == m_id_Merge3) + { + LOG(); + std::list< tstring >::iterator iFrom = m_recentFiles.begin(); + std::list< tstring >::iterator iBase = iFrom; + ++iBase; + diff( TEXT("-m \"") + *iBase + TEXT("\" \"") + *iFrom + TEXT("\" \"") + _file_name1 + TEXT("\"") ); + } + else if(id == m_id_DiffWith) + { + LOG(); + diff_with(0, false); + } + else if(id == m_id_MergeWith) + { + LOG(); + diff_with(0, true); + } + else if(id == m_id_DiffLater) + { + MESSAGELOG(TEXT("Diff Later: ")+_file_name1); + m_recentFiles.remove( _file_name1 ); + m_recentFiles.push_front( _file_name1 ); + } + else if(id >= m_id_DiffWith_Base && id < m_id_DiffWith_Base+m_recentFiles.size()) + { + LOG(); + diff_with(id-m_id_DiffWith_Base, false); + } + else if(id == m_id_About) + { + LOG(); + MessageBox( _hwnd, (i18n("Diff-Ext Copyright (c) 2003-2006, Sergey Zorin. All rights reserved.\n") + + i18n("This software is distributable under the BSD license.\n") + + i18n("Some extensions for KDiff3 by Joachim Eibl.\n") + + i18n("Homepage for Diff-Ext: http://diff-ext.sourceforge.net\n") + + i18n("Homepage for KDiff3: http://kdiff3.sourceforge.net")).c_str() + , i18n("About Diff-Ext for KDiff3").c_str(), MB_OK ); + } + else + { + ret = E_INVALIDARG; + TCHAR verb[80]; + _sntprintf(verb, 79, TEXT("Command id: %d"), LOWORD(ici->lpVerb)); + verb[79]=0; + ERRORLOG(verb); + } + } + + return ret; +} + +STDMETHODIMP +DIFF_EXT::GetCommandString(UINT idCmd, UINT uFlags, UINT*, LPSTR pszName, UINT cchMax) +{ + // LOG(); // Gets called very often + HRESULT ret = NOERROR; + + if(uFlags == GCS_HELPTEXT) { + tstring helpString; + if( idCmd == m_id_Diff ) + { + helpString = i18n("Compare selected files"); + } + else if( idCmd == m_id_DiffWith ) + { + if(!m_recentFiles.empty()) + { + helpString = i18n("Compare '%1' with '%2'"); + replaceArgs( helpString, _file_name1, m_recentFiles.front() ); + } + } + else if(idCmd == m_id_DiffLater) + { + helpString = i18n("Save '%1' for later operation"); + replaceArgs( helpString, _file_name1 ); + } + else if((idCmd >= m_id_DiffWith_Base) && (idCmd < m_id_DiffWith_Base+m_recentFiles.size())) + { + if( !m_recentFiles.empty() ) + { + unsigned int num = idCmd - m_id_DiffWith_Base; + std::list::iterator i = m_recentFiles.begin(); + for(unsigned int j = 0; j < num && i != m_recentFiles.end(); j++) + i++; + + if ( i!=m_recentFiles.end() ) + { + helpString = i18n("Compare '%1' with '%2'"); + replaceArgs( helpString, _file_name1, *i ); + } + } + } + lstrcpyn( (LPTSTR)pszName, helpString.c_str(), cchMax ); + } + + return ret; +} + +void +DIFF_EXT::diff( const tstring& arguments ) +{ + LOG(); + STARTUPINFO si; + PROCESS_INFORMATION pi; + bool bError = true; + tstring command = SERVER::instance()->getRegistryKeyString( TEXT(""), TEXT("diffcommand") ); + tstring commandLine = TEXT("\"") + command + TEXT("\" ") + arguments; + if ( ! command.empty() ) + { + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + if (CreateProcess(command.c_str(), (LPTSTR)commandLine.c_str(), 0, 0, FALSE, 0, 0, 0, &si, &pi) == 0) + { + SYSERRORLOG(TEXT("CreateProcess") + command); + } + else + { + bError = false; + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + } + + if (bError) + { + tstring message = i18n("Could not start KDiff3. Please rerun KDiff3 installation."); + message += TEXT("\n") + i18n("Command") + TEXT(": ") + command; + message += TEXT("\n") + i18n("CommandLine") + TEXT(": ") + commandLine; + MessageBox(_hwnd, message.c_str(), i18n("Diff-Ext For KDiff3").c_str(), MB_OK); + } +} + +void +DIFF_EXT::diff_with(unsigned int num, bool bMerge) +{ + LOG(); + std::list::iterator i = m_recentFiles.begin(); + for(unsigned int j = 0; j < num && i!=m_recentFiles.end(); j++) { + i++; + } + + if ( i!=m_recentFiles.end() ) + _file_name2 = *i; + + diff( (bMerge ? TEXT("-m \"") : TEXT("\"") ) + _file_name1 + TEXT("\" \"") + _file_name2 + TEXT("\"") ); +} + + +tstring +DIFF_EXT::cut_to_length(const tstring& in, size_t max_len) +{ + tstring ret; + if( in.length() > max_len) + { + ret = in.substr(0, (max_len-3)/2); + ret += TEXT("..."); + ret += in.substr( in.length()-(max_len-3)/2 ); + } + else + { + ret = in; + } + + return ret; +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2003-2004, Sergey Zorin. All rights reserved. + * + * This software is distributable under the BSD license. See the terms + * of the BSD license in the LICENSE file provided with this software. + * + */ + +#ifndef __diff_ext_h__ +#define __diff_ext_h__ + +#include +#include +#include + +#include "server.h" + + +// this is the actual OLE Shell context menu handler +class DIFF_EXT : public IContextMenu, IShellExtInit { + public: + DIFF_EXT(); + virtual ~DIFF_EXT(); + + //IUnknown members + STDMETHODIMP QueryInterface(REFIID interface_id, void** result); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + + //IShell members + STDMETHODIMP QueryContextMenu(HMENU menu, UINT index, UINT cmd_first, UINT cmd_last, UINT flags); + STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO info); + STDMETHODIMP GetCommandString(UINT cmd, UINT flags, UINT* reserved, LPSTR name, UINT name_length); + + //IShellExtInit methods + STDMETHODIMP Initialize(LPCITEMIDLIST folder, IDataObject* subj, HKEY key); + + private: + void diff( const tstring& arguments ); + void diff_with(unsigned int num, bool bMerge); + tstring cut_to_length(const tstring&, size_t length = 64); + void initialize_language(); + + private: + UINT m_nrOfSelectedFiles; + tstring _file_name1; + tstring _file_name2; + tstring _file_name3; + HINSTANCE _resource; + HWND _hwnd; + + ULONG _ref_count; + + std::list< tstring >& m_recentFiles; + UINT m_id_FirstCmd; + UINT m_id_Diff; + UINT m_id_DiffWith; + UINT m_id_DiffLater; + UINT m_id_MergeWith; + UINT m_id_Merge3; + UINT m_id_Diff3; + UINT m_id_DiffWith_Base; + UINT m_id_About; +}; + +#endif // __diff_ext_h__ diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext.pot --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext.pot Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,96 @@ +# Diff-ext-for-KDiff3 +# Copyright (C) 2006 Joachim Eibl +# This file is distributed under the same license as the diff-ext-for-KDiff3 package. +# PO-Template created by Joachim Eibl , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-03 06:05+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: diff_ext.cpp:368 diff_ext.cpp:402 +msgid "Compare with" +msgstr "" + +#: diff_ext.cpp:369 +msgid "Merge with" +msgstr "" + +#: diff_ext.cpp:384 +msgid "3-way merge with base" +msgstr "" + +#: diff_ext.cpp:387 +msgid "Save '%1' for later comparison or merge" +msgstr "" + +#: diff_ext.cpp:408 +msgid "Compare" +msgstr "" + +#: diff_ext.cpp:412 +msgid "3 way comparison" +msgstr "" + +#: diff_ext.cpp:418 +msgid "About Diff-Ext ..." +msgstr "" + +#: diff_ext.cpp:482 +msgid "Diff-Ext Copyright (c) 2003-2006, Sergey Zorin. All rights reserved.\n" +msgstr "" + +#: diff_ext.cpp:483 +msgid "This software is distributable under the BSD license.\n" +msgstr "" + +#: diff_ext.cpp:484 +msgid "Some extensions for KDiff3 by Joachim Eibl.\n" +msgstr "" + +#: diff_ext.cpp:485 +msgid "Homepage for Diff-Ext: http://diff-ext.sourceforge.net\n" +msgstr "" + +#: diff_ext.cpp:486 +msgid "Homepage for KDiff3: http://kdiff3.sourceforge.net" +msgstr "" + +#: diff_ext.cpp:487 +msgid "About Diff-Ext for KDiff3" +msgstr "" + +#: diff_ext.cpp:512 +msgid "Compare selected files" +msgstr "" + +#: diff_ext.cpp:518 diff_ext.cpp:538 +msgid "Compare '%1' with '%2'" +msgstr "" + +#: diff_ext.cpp:524 +msgid "Save '%1' for later operation" +msgstr "" + +#: diff_ext.cpp:576 +msgid "Could not start KDiff3. Please rerun KDiff3 installation." +msgstr "" + +#: diff_ext.cpp:577 +msgid "Command" +msgstr "" + +#: diff_ext.cpp:578 +msgid "CommandLine" +msgstr "" + +#: diff_ext.cpp:579 +msgid "Diff-Ext For KDiff3" +msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext_de.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext_de.po Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-09-04 15:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: diff_ext.cpp:363 diff_ext.cpp:397 +msgid "Compare with" +msgstr "Vergleichen mit" + +#: diff_ext.cpp:364 +msgid "Merge with" +msgstr "Zusammenführen mit" + +#: diff_ext.cpp:379 +msgid "3-way merge with base" +msgstr "3-Wege Zusammenführung mit Basis" + +#: diff_ext.cpp:382 +msgid "Save '%1' for later comparison or merge" +msgstr "Speichere '%1' für spätere Vergleichs- oder Zusammenführungsaktion" + +#: diff_ext.cpp:403 +msgid "Compare" +msgstr "Vergleichen" + +#: diff_ext.cpp:407 +msgid "3 way comparison" +msgstr "Vergleiche 3 Dateien" + +#: diff_ext.cpp:413 +msgid "About Diff-Ext ..." +msgstr "Über Diff-Ext ..." + +#: diff_ext.cpp:474 +msgid "Diff-Ext Copyright (c) 2003-2006, Sergey Zorin. All rights reserved.\n" +msgstr "Diff-Ext Copyright (c) 2003-2006, Sergey Zorin. Alle Rechte vorbehalten.\n" + +#: diff_ext.cpp:475 +msgid "This software is distributable under the BSD license.\n" +msgstr "Weitergabe dieses Programms unter den Bedingungen der BSD Lizenz.\n" + +#: diff_ext.cpp:476 +msgid "Some extensions for KDiff3 by Joachim Eibl.\n" +msgstr "Einige Erweiterungen für KDiff3 von Joachim Eibl.\n" + +#: diff_ext.cpp:477 +msgid "See the homepage http://diff-ext.sourceforge.net" +msgstr "Siehe die Homepage http://diff-ext.sourceforge.net" + +#: diff_ext.cpp:478 +msgid "About Diff-Ext for KDiff3" +msgstr "Über Diff-Ext für KDiff3" + +#: diff_ext.cpp:503 +msgid "Compare selected files" +msgstr "Vergleiche markierte Dateien" + +#: diff_ext.cpp:509 diff_ext.cpp:529 +msgid "Compare '%1' with '%2'" +msgstr "Vergleiche '%1' mit '%2'" + +#: diff_ext.cpp:515 +msgid "Merke '%1' für spätere Aktion" +msgstr "" + +#: diff_ext.cpp:567 +msgid "Could not start KDiff3. Please rerun KDiff3 installation." +msgstr "Konnte KDiff3 nicht starten. Bitte wiederholen Sie die KDiff3 Installation." + +#: diff_ext.cpp:568 +msgid "Command" +msgstr "Kommando" + +#: diff_ext.cpp:569 +msgid "CommandLine" +msgstr "Kommandozeile" + +#: diff_ext.cpp:570 +msgid "Diff-Ext For KDiff3" +msgstr "Diff-Ext für KDiff3" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3.def Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,6 @@ +LIBRARY "diff_ext_for_kdiff3" +EXPORTS + DllCanUnloadNow=DllCanUnloadNow@0 + DllGetClassObject=DllGetClassObject@12 + DllRegisterServer=DllRegisterServer@0 + DllUnregisterServer=DllUnregisterServer@0 diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3.rc Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2003-2006, Sergey Zorin. All rights reserved. + * + * This software is distributable under the BSD license. See the terms + * of the BSD license in the LICENSE file provided with this software. + * + */ + +#include + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,6,1,145 + PRODUCTVERSION 1,6,1,145 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT_UNKNOWN +{ + BLOCK "StringFileInfo" + { + BLOCK "040904b0" + { + VALUE "Comments", "" + VALUE "CompanyName", "" + VALUE "FileDescription", "diff shell extension" + VALUE "FileVersion", "Release 1.6.1" + VALUE "InternalName", "diff shell extension" + VALUE "LegalCopyright", "Copyright © 2003-2005 Sergey Zorin" + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "diff_ext.dll" + VALUE "PrivateBuild", "" + VALUE "ProductName", "Diff Context Menu Extension" + VALUE "ProductVersion", "Release 1.6.1" + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x409, 1200 + } +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3.vcproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3.vcproj Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3_msvc.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diff_ext_for_kdiff3_msvc.def Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,6 @@ +LIBRARY "diff_ext_for_kdiff3" +EXPORTS + DllCanUnloadNow PRIVATE + DllGetClassObject PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/diffextstring.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/diffextstring.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2003, Sergey Zorin. All rights reserved. + * + * This software is distributable under the BSD license. See the terms of the + * BSD license in the LICENSE file provided with this software. + * + */ + +#ifndef __string_h__ +#define __string_h__ + +#include +#include + +#include +#include + +class STRING; +inline STRING operator+( const STRING& s1, const STRING& s2); + +class STRING { + public: + static const int begin = 0; + static const int end = -1; + + public: + STRING(const STRING& s) { + _str = new TCHAR[s.length()+1]; + lstrcpy(_str, s); + } + + STRING(const TCHAR* str = TEXT("")) { + _str = new TCHAR[lstrlen(str)+1]; + lstrcpy(_str, str); + } + + ~STRING() { + delete[] _str; + } + + void resize( size_t newLength ) + { + size_t oldLength = length(); + if ( newLength < oldLength ) { + _str[newLength] = 0; // Just truncate the string + } else if( newLength>oldLength) { + TCHAR* p = new TCHAR[ newLength + 1 ]; + lstrcpy(p, _str); + for( size_t i=oldLength; i + +#include +#include + +#include +#include +#include + +#include +#include + +//#include +//#include +//#include +//#include + +#include "server.h" +#include "class_factory.h" + +#define DllExport __declspec( dllexport ) + +// registry key util struct +struct REGSTRUCT { + LPTSTR subkey; + LPTSTR name; + LPTSTR value; +}; + +SERVER* SERVER::_instance = 0; +static HINSTANCE server_instance; // Handle to this DLL itself. + +//DEFINE_GUID(CLSID_DIFF_EXT, 0xA0482097, 0xC69D, 0x4DEC, 0x8A, 0xB6, 0xD3, 0xA2, 0x59, 0xAC, 0xC1, 0x51); +// New class id for DIFF_EXT for KDiff3 +DEFINE_GUID( CLSID_DIFF_EXT, 0x9f8528e4, 0xab20, 0x456e, 0x84, 0xe5, 0x3c, 0xe6, 0x9d, 0x87, 0x20, 0xf3 ); + + +tstring SERVER::getRegistryKeyString( const tstring& subKey, const tstring& value ) +{ + tstring keyName = m_registryBaseName; + if (!subKey.empty()) + keyName += TEXT("\\")+subKey; + + HKEY key; + HKEY baseKey = HKEY_CURRENT_USER; + tstring result; + for(;;) + { + if( RegOpenKeyEx( baseKey, keyName.c_str(), 0, KEY_READ, &key ) == ERROR_SUCCESS ) + { + DWORD neededSizeInBytes = 0; + if (RegQueryValueEx(key, value.c_str(), 0, 0, 0, &neededSizeInBytes) == ERROR_SUCCESS) + { + DWORD length = neededSizeInBytes / sizeof( TCHAR ); + result.resize( length ); + if ( RegQueryValueEx( key, value.c_str(), 0, 0, (LPBYTE)&result[0], &neededSizeInBytes ) == ERROR_SUCCESS) + { + //Everything is ok, but we want to cut off the terminating 0-character + result.resize( length - 1 ); + RegCloseKey(key); + return result; + } + else + { + result.resize(0); + } + } + + RegCloseKey(key); + } + if (baseKey==HKEY_LOCAL_MACHINE) + break; + baseKey = HKEY_LOCAL_MACHINE; + } + + // Error + { + LPTSTR message; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, + GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &message, 0, 0); + ERRORLOG( (tstring(TEXT("RegOpenKeyEx: ")+keyName+TEXT("->")+value) + TEXT(": ")) + message ); \ + LocalFree(message); + } + return result; +} + + +STDAPI +DllCanUnloadNow(void) { + HRESULT ret = S_FALSE; + + if(SERVER::instance()->reference_count() == 0) { + ret = S_OK; + } + + return ret; +} + +extern "C" int APIENTRY +DllMain(HINSTANCE instance, DWORD reason, LPVOID /* reserved */) { +// char str[1024]; +// char* reason_string[] = {"DLL_PROCESS_DETACH", "DLL_PROCESS_ATTACH", "DLL_THREAD_ATTACH", "DLL_THREAD_DETACH"}; +// sprintf(str, "instance: %x; reason: '%s'", instance, reason_string[reason]); +// MessageBox(0, str, TEXT("Info"), MB_OK); + switch (reason) { + case DLL_PROCESS_ATTACH: + server_instance = instance; + SERVER::instance()->save_history(); + MESSAGELOG(TEXT("DLL_PROCESS_ATTACH")); + break; + + case DLL_PROCESS_DETACH: + MESSAGELOG(TEXT("DLL_PROCESS_DETACH")); + SERVER::instance()->save_history(); + break; + } + + return 1; +} + +STDAPI +DllGetClassObject(REFCLSID rclsid, REFIID riid, void** class_object) { + HRESULT ret = CLASS_E_CLASSNOTAVAILABLE; + *class_object = 0; + + if (IsEqualIID(rclsid, CLSID_DIFF_EXT)) { + CLASS_FACTORY* pcf = new CLASS_FACTORY(); + + ret = pcf->QueryInterface(riid, class_object); + } + + return ret; +} + +/*extern "C" HRESULT STDAPICALLTYPE*/ STDAPI +DllRegisterServer() { + return SERVER::instance()->do_register(); +} + +STDAPI +DllUnregisterServer() { + return SERVER::instance()->do_unregister(); +} + +SERVER* SERVER::instance() +{ + if(_instance == 0) + { + _instance = new SERVER(); + _instance->initLogging(); + MESSAGELOG(TEXT("New Server instance")); + } + + return _instance; +} + +SERVER::SERVER() : _reference_count(0) +{ + m_registryBaseName = TEXT("Software\\KDiff3\\diff-ext"); + m_pRecentFiles = 0; + m_pLogFile = 0; +} + +void SERVER::initLogging() +{ + tstring logFileName = getRegistryKeyString( TEXT(""), TEXT("LogFile") ); + if ( !logFileName.empty() ) + { + m_pLogFile = _tfopen( logFileName.c_str(), TEXT("a+, ccs=UTF-8") ); + if (m_pLogFile) + { + _ftprintf( m_pLogFile, TEXT("\nSERVER::SERVER()\n") ); + } + } +} + +SERVER::~SERVER() +{ + if ( m_pLogFile ) + { + _ftprintf( m_pLogFile, TEXT("SERVER::~SERVER()\n\n") ); + fclose( m_pLogFile ); + } + + delete m_pRecentFiles; +} + +HINSTANCE +SERVER::handle() const +{ + return server_instance; +} + +void +SERVER::lock() { + InterlockedIncrement(&_reference_count); +} + +void +SERVER::release() { + InterlockedDecrement(&_reference_count); + + //if(InterlockedDecrement((LPLONG)&_reference_count) == 0) + // delete this; +} + +void SERVER::logMessage( const char* function, const char* file, int line, const tstring& msg ) +{ + SERVER* pServer = SERVER::instance(); + if ( pServer && pServer->m_pLogFile ) + { + SYSTEMTIME st; + GetSystemTime( &st ); + _ftprintf( pServer->m_pLogFile, TEXT("%04d/%02d/%02d %02d:%02d:%02d ") +#ifdef UNICODE + TEXT("%S (%S:%d) %s\n"), // integrate char-string into wchar_t string +#else + TEXT("%s (%s:%d) %s\n"), +#endif + st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, function, file, line, msg.c_str() ); + fflush(pServer->m_pLogFile); + } +} + +std::list& +SERVER::recent_files() +{ + LOG(); + if ( m_pRecentFiles==0 ) + { + MESSAGELOG(TEXT("Reading history from registry...")); + m_pRecentFiles = new std::list; + for( int i=0; i<32; ++i ) // Max history size + { + TCHAR numAsString[10]; + _sntprintf( numAsString, 10, TEXT("%d"), i ); + tstring historyItem = getRegistryKeyString( TEXT("history"), numAsString ); + if ( ! historyItem.empty() ) + m_pRecentFiles->push_back( historyItem ); + } + } + return *m_pRecentFiles; +} + +void +SERVER::save_history() const +{ + if( m_pRecentFiles && !m_pRecentFiles->empty() ) + { + HKEY key; + if( RegCreateKeyEx(HKEY_CURRENT_USER, (m_registryBaseName + TEXT("\\history")).c_str(), 0, 0, + REG_OPTION_NON_VOLATILE, KEY_WRITE, 0, &key, 0) == ERROR_SUCCESS ) + { + LOG(); + //DWORD len = MAX_PATH; + int n = 0; + + std::list::const_iterator i; + + for(i = m_pRecentFiles->begin(); i!=m_pRecentFiles->end(); ++i, ++n ) + { + tstring str = *i; + TCHAR numAsString[10]; + _sntprintf( numAsString, 10, TEXT("%d"), n ); + if(RegSetValueEx(key, numAsString, 0, REG_SZ, (const BYTE*)str.c_str(), (DWORD)(str.size()+1)*sizeof(TCHAR) ) != ERROR_SUCCESS) + { + LPTSTR message; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, + GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &message, 0, 0); + MessageBox(0, message, TEXT("Save history failed"), MB_OK | MB_ICONINFORMATION); + LocalFree(message); + } + } + + RegCloseKey(key); + } + else + { + SYSERRORLOG(TEXT("RegOpenKeyEx")); + } + } +} + +HRESULT +SERVER::do_register() { + LOG(); + TCHAR class_id[MAX_PATH]; + LPWSTR tmp_guid; + HRESULT ret = SELFREG_E_CLASS; + + if (StringFromIID(CLSID_DIFF_EXT, &tmp_guid) == S_OK) { +#ifdef UNICODE + _tcsncpy(class_id, tmp_guid, MAX_PATH); +#else + wcstombs(class_id, tmp_guid, MAX_PATH); +#endif + CoTaskMemFree((void*)tmp_guid); + + TCHAR subkey[MAX_PATH]; + TCHAR server_path[MAX_PATH]; + HKEY key; + LRESULT result = NOERROR; + DWORD dwDisp; + + GetModuleFileName(SERVER::instance()->handle(), server_path, MAX_PATH); + + REGSTRUCT entry[] = { + {TEXT("Software\\Classes\\CLSID\\%s"), 0, TEXT("diff-ext-for-kdiff3")}, + {TEXT("Software\\Classes\\CLSID\\%s\\InProcServer32"), 0, TEXT("%s")}, + {TEXT("Software\\Classes\\CLSID\\%s\\InProcServer32"), TEXT("ThreadingModel"), TEXT("Apartment")} + }; + + for(unsigned int i = 0; (i < sizeof(entry)/sizeof(entry[0])) && (result == NOERROR); i++) { + _sntprintf(subkey, MAX_PATH, entry[i].subkey, class_id); + result = RegCreateKeyEx(HKEY_CURRENT_USER, subkey, 0, 0, REG_OPTION_NON_VOLATILE, KEY_WRITE, 0, &key, &dwDisp); + + if(result == NOERROR) { + TCHAR szData[MAX_PATH]; + + _sntprintf(szData, MAX_PATH, entry[i].value, server_path); + szData[MAX_PATH-1]=0; + + result = RegSetValueEx(key, entry[i].name, 0, REG_SZ, (LPBYTE)szData, DWORD(_tcslen(szData)*sizeof(TCHAR))); + } + + RegCloseKey(key); + } + + if(result == NOERROR) { + result = RegCreateKeyEx(HKEY_CURRENT_USER, TEXT("Software\\Classes\\*\\shellex\\ContextMenuHandlers\\diff-ext-for-kdiff3"), 0, 0, REG_OPTION_NON_VOLATILE, KEY_WRITE, 0, &key, &dwDisp); + + if(result == NOERROR) { + + result = RegSetValueEx(key, 0, 0, REG_SZ, (LPBYTE)class_id, DWORD(_tcslen(class_id)*sizeof(TCHAR))); + + RegCloseKey(key); + + //If running on NT, register the extension as approved. + OSVERSIONINFO osvi; + + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionEx(&osvi); + + // NT needs to have shell extensions "approved". + if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { + result = RegCreateKeyEx(HKEY_CURRENT_USER, + TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), + 0, 0, REG_OPTION_NON_VOLATILE, KEY_WRITE, 0, &key, &dwDisp); + + if(result == NOERROR) { + TCHAR szData[MAX_PATH]; + + lstrcpy(szData, TEXT("diff-ext")); + + result = RegSetValueEx(key, class_id, 0, REG_SZ, (LPBYTE)szData, DWORD(_tcslen(szData)*sizeof(TCHAR))); + + RegCloseKey(key); + + ret = S_OK; + } else if (result == ERROR_ACCESS_DENIED) { + TCHAR msg[] = TEXT("Warning! You have unsufficient rights to write to a specific registry key.\n") + TEXT("The application may work anyway, but it is advised to register this module ") + TEXT("again while having administrator rights."); + + MessageBox(0, msg, TEXT("Warning"), MB_ICONEXCLAMATION); + + ret = S_OK; + } + } + else { + ret = S_OK; + } + } + } + } + + return ret; +} + +HRESULT +SERVER::do_unregister() { + LOG(); + TCHAR class_id[MAX_PATH]; + LPWSTR tmp_guid; + HRESULT ret = SELFREG_E_CLASS; + + if (StringFromIID(CLSID_DIFF_EXT, &tmp_guid) == S_OK) { +#ifdef UNICODE + _tcsncpy(class_id, tmp_guid, MAX_PATH); +#else + wcstombs(class_id, tmp_guid, MAX_PATH); +#endif + CoTaskMemFree((void*)tmp_guid); + + LRESULT result = NOERROR; + TCHAR subkey[MAX_PATH]; + + REGSTRUCT entry[] = { + {TEXT("Software\\Classes\\CLSID\\%s\\InProcServer32"), 0, 0}, + {TEXT("Software\\Classes\\CLSID\\%s"), 0, 0} + }; + + for(unsigned int i = 0; (i < sizeof(entry)/sizeof(entry[0])) && (result == NOERROR); i++) { + _stprintf(subkey, entry[i].subkey, class_id); + result = RegDeleteKey(HKEY_CURRENT_USER, subkey); + } + + if(result == NOERROR) { + result = RegDeleteKey(HKEY_CURRENT_USER, TEXT("Software\\Classes\\*\\shellex\\ContextMenuHandlers\\diff-ext-for-kdiff3")); + + if(result == NOERROR) { + //If running on NT, register the extension as approved. + OSVERSIONINFO osvi; + + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionEx(&osvi); + + // NT needs to have shell extensions "approved". + if(osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { + HKEY key; + + RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), 0, KEY_ALL_ACCESS, &key); + + result = RegDeleteValue(key, class_id); + + RegCloseKey(key); + + if(result == ERROR_SUCCESS) { + ret = S_OK; + } + } + else { + ret = S_OK; + } + } + } + } + + return ret; +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/diff_ext_for_kdiff3/server.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/diff_ext_for_kdiff3/server.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2003-2005, Sergey Zorin. All rights reserved. + * + * This software is distributable under the BSD license. See the terms + * of the BSD license in the LICENSE file provided with this software. + * + */ +#ifndef __server_h__ +#define __server_h__ +#include // std::list +//#include +#include + +#if 1 +#include // std::wstring +#ifdef UNICODE +typedef std::wstring tstring; +#else +typedef std::string tstring; +#endif +#define i18n(x) getTranslation( TEXT(x) ) +#else +#include "diffextstring.h" +typedef STRING tstring; +#define i18n(x) TEXT(x) +#endif + +#define MESSAGELOG( msg ) SERVER::logMessage( __FUNCTION__, __FILE__, __LINE__, msg ) +#define LOG() MESSAGELOG( TEXT("") ) +#define ERRORLOG( msg ) MESSAGELOG( TEXT("Error: ")+tstring(msg) ) +#define SYSERRORLOG( msg ) \ + { \ + LPTSTR message; \ + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, \ + GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &message, 0, 0); \ + ERRORLOG( (tstring(msg) + TEXT(": ")) + message ); \ + LocalFree(message); \ + } + + +class SERVER { + public: + static SERVER* instance(); + void initLogging(); + + public: + virtual ~SERVER(); + + tstring getRegistryKeyString( const tstring& subKey, const tstring& value ); + + HINSTANCE handle() const; + + HRESULT do_register(); + HRESULT do_unregister(); + + void lock(); + void release(); + + ULONG reference_count() const { + return _reference_count; + } + + std::list< tstring >& recent_files(); + + void save_history() const; + + static void logMessage( const char* function, const char* file, int line, const tstring& msg ); + + private: + SERVER(); + SERVER(const SERVER&) {} + + private: + LONG _reference_count; + std::list* m_pRecentFiles; + static SERVER* _instance; + tstring m_registryBaseName; + FILE* m_pLogFile; +}; + +#endif // __server_h__ diff -r 069521efec1a -r 08ea9b86c12c kdiff3/doc/da/index.docbook --- a/kdiff3/doc/da/index.docbook Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/doc/da/index.docbook Sat Nov 04 00:05:00 2006 +0000 @@ -54,9 +54,9 @@ Do NOT change these in the translation. --> 2006-04-09 +>2006-05-14 0.9.89 +>0.9.90 @@ -686,13 +686,13 @@ >Sammenflet automatisk nøgleord for versionshÃ¥ndtering og historik (log)Mange versionskontrolsystemer understøtter specielle nøgleord i filen. (f.eks. "$Date: 2006-05-02 10:41:21 -0400 (Tue, 02 May 2006) $", "$Header$", "$Author: scripty $", "$Log$" etc.) Ved check-in ændrer versionskontrolsystemet (VCS) disse linjer. For eksempel bliver "$Date: 2006-04-21 17:24:21 -0400 (Fri, 21 Apr 2006) $" til "$Date: 2006-04-21 17:24:21 -0400 (Fri, 21 Apr 2006) $". Idet denne linje vil være forskellig i hver version af filen, ville det kræve manuel interaktion under sammenfletningen. Mange versionskontrolsystemer understøtter specielle nøgleord i filen. (f.eks. "$Date:$", "$Header$", "$Author$", "$$" osv.) Ved check-in ændrer versionskontrolsystemet (VCS) disse linjer. For eksempel bliver "$Date:$" til "$ Date:2005/03/22 18:45:01 $". Idet denne linje vil være forskellig i hver version af filen, ville det kræve manuel interaktion under sammenfletningen. &kdiff3; tilbyder automatisk sammenfletning af disse indgange. For enkle linjer som matcher tilvalget "Regulært udtryk for automatisk sammenfletning" i alle inddatafiler vælger &kdiff3; linjen fra B, eller om tilgængelig, den fra C. (Desuden er det nødvendigt at linjerne det drejer sig om linjes op i sammenligningen og at foregÃ¥ende linje ikke indeholder en konflikt.) Den automatiske sammenfletning kan enten udføres med det samme nÃ¥r sammenfletningen startes (aktivér tilvalget "Kør automatisk sammenfletning med regulært udtryk nÃ¥r sammenfletning starter") eller senere via "Kør automatisk sammenfletning med regulært udtryk" i menuen Sammenflet. Automatisk sammenfletning for versionshÃ¥ndteringshistorik (ogsÃ¥ kaldet "log") understøttes ogsÃ¥. Automatisk sammenfletning af historik kan enten udføres med det samme nÃ¥r sammenfletningen startes ved at aktivere tilvalget "Sammenfletning ifølge versionshÃ¥ndteringshistorik nÃ¥r sammenfletning starter" eller senere via "Løs automatisk historikkonflikter" i menuen Sammenflet. Oftest begynder versionshÃ¥ndteringshistorikken med en linje som indeholder nøgleordet "$Log$". Den skal matches af tilvalget "Regulært udtryk for historikkens begyndelse". &kdiff3; detekterer hvilke efterfølgende linjer som indgÃ¥r i historikken ved at analysere de indledende tegn som fandtes før nøgleordet "$Log$". Hvis samme "indledende kommentar" ogsÃ¥ findes pÃ¥ følgende linjer inkluderes de ogsÃ¥ i historikken. Oftest begynder versionshÃ¥ndteringshistorikken med en linje som indeholder nøgleordet "$Log$". Den skal matches af tilvalget "Regulært udtryk for historikkens begyndelse". &kdiff3; detekterer hvilke efterfølgende linjer som indgÃ¥r i historikken ved at analysere de indledende tegn som fandtes før nøgleordet "$Log$". Hvis samme "indledende kommentar" ogsÃ¥ findes pÃ¥ følgende linjer inkluderes de ogsÃ¥ i historikken. Ved hver arkivering skriver VCS en entydig linje som angiver version, dato- og tidsinformation fulgt af linjer med brugerens kommentarer. Disse linjer udgør en historikindgang. Historikafsnittet vokser ved hver arkivering og de seneste indgange vises længst oppe (efter historikkens startlinje). Antag at historikken ser ud sÃ¥ her: /************************************************************************** -** HISTORIK: $Log: \toms_sammenfletning_hovedvisning\Mit_program\kode\komplexalgoritm.cpp $ +** HISTORIK: $Log: \toms_sammenfletning_hovedvisning\Mit_program\kode\komplexalgoritm.cpp $ ** ** \head\integreringsgren_12 2 Apr 2001 10:45:41 tom ** Sammenflettede grenen simongren_15. @@ -718,9 +718,9 @@ ** Ordnede sammenbrud. **************************************************************************/ Historikkens indledende linje matcher det regulære udtryk ".*\$Log.*\$.*". Derefter følger historikindgangene. Historikkens indledende linje matcher det regulære udtryk ".*\$Log.*\$.*". Derefter følger historikindgangene. Linjen med nøgleordet "$Log$" begynder med to "*" og derefter følger et mellemrum. &kdiff3; bruger den første streng uden blanke tegn som "indledende kommentar" og antager at historikken slutter med den første linje uden denne indledende kommentar. I eksemplet slutter den sidste linje med en streng som ogsÃ¥ begynder med to "*", men i stedet for et mellemrum følger flere "*". Derfor afslutter denne linje historikken. Linjen med nøgleordet "$Log$" begynder med to "*" og derefter følger et mellemrum. &kdiff3; bruger den første streng uden blanke tegn som "indledende kommentar" og antager at historikken slutter med den første linje uden denne indledende kommentar. I eksemplet slutter den sidste linje med en streng som ogsÃ¥ begynder med to "*", men i stedet for et mellemrum følger flere "*". Derfor afslutter denne linje historikken. Hvis sortering af historikken ikke kræves kan det regulære udtryk for historikindgangens begyndelsen se sÃ¥dan her ud. (Linjen er delt i to eftersom den ikke ville fÃ¥ plads ellers.) \s*\\main\\\S+\s+[0-9]+ (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) @@ -1238,7 +1238,7 @@ >Regulært udtryk for begyndelsen af historikindgangen for sammenfletning. Som oftest indeholder linjen nøgleordet "$Log$". Standardværdi: ".*\$Log.*\$.*" Regulært udtryk for begyndelsen af historikindgangen for sammenfletning. Som oftest indeholder linjen nøgleordet "$Log$". Standardværdi: ".*\$Log.*\$.*" &kdiff3;: Værktøj til sammenligning og sammenfletning af filer og mapper Program ophavsret 2002-2005 Joachim Eibl Program ophavsret 2002-2006 Joachim Eibl joachim.eibl at gmx.de Flere fede idéer og fejlrapporter kom fra kolleger og mange personer ude pÃ¥ www. Tak! Dokumentation ophavsret © 2002-2005 Joachim Eibl Dokumentation ophavsret © 2002-2006 Joachim Eibl joachim.eibl at gmx.de diff -r 069521efec1a -r 08ea9b86c12c kdiff3/doc/es/index.docbook --- a/kdiff3/doc/es/index.docbook Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/doc/es/index.docbook Sat Nov 04 00:05:00 2006 +0000 @@ -11,21 +11,26 @@ + + El manual de &kdiff3; Joachim Eibl
joachim.eibl@gmx.de +>joachim.eibl at gmx.de +
+
Santiago
santi@est.unileon.essanti@kde-es.org
Traductor
-
20022005 +>2002-2006 Joachim Eibl + + &FDLNotice; + + 2005-01-30 +>2006-04-09 0.9.87 +>0.9.89 + Soporta Unicode, UTF-8 y otras codificaciones de archivo. +Imprime diferencias. +Soporta claves de control de versiones e historial de fusionado. - +Este documento describe la versión 0.9.89 de &kdiff3;. + + KDE @@ -147,31 +174,23 @@ >¿Otro interfaz para diff? Ya existen varias herramientas gráficas para diff. ¿Por qué elegir &kdiff3;? Déjeme decirle por qué lo escribí. - -&kdiff3; se inició debido a la dificultad para hacer la fusión. La fusión es necesaria cuando varias personas trabajan sobre los mismos archivos en un proyecto. Una fusión puede ser algo automatizado, cuando la herramienta de fusionado no solo tiene nuevos archivos modificados (llamados «ramas»), sino también el archivo original (llamado «base»). La herramienta de fusionado seleccionará automáticamente cualquier modificación que se haga solo en una rama. Cuando varios colaboradores cambian la misma línea, la herramienta detecta un conflicto que deberá resolverse manualmente. - -El fusionado se vuelve difícil porque, por ejemplo, un colaborador cambió muchas cosas y corrigió el sangrado en algunos lugares. Otro colaborador también cambió mucho texto en el mismo archivo, y todo esto dió como resultado varios conflictos durante la fusión. - -La herramienta que utilizaba, solo mostraba las líneas cambiadas, pero no los cambios hechos en estas líneas. Y no había información sobre los cambios en el sangrado. La fusión era una pequeña pesadilla. - -Por eso empecé. La primera versión podía mostrar las diferencias en un línea y las diferencias en los espacios en blanco. Después se añadieron otras características para incrementar la utilidad. - -Por ejemplo, si desea comparar algún texto rápidamente, podrá copiarlo al portapapeles y pegarlo en otra ventana de diff. - -Una característica que requería un enorme esfuerzo era la capacidad de comparar y fusionar directorios, que convirtió el programa en un navegador de archivos completo. - -Espero que &kdiff3; le funcione también. ¡Diviértase! - -Joachim Eibl (2003) +>Ya existen varias herramientas gráficas para diff. ¿Por qué elegir &kdiff3;? Déjeme decirle por qué lo escribí. &kdiff3; se inició debido a la dificultad para hacer la fusión. La fusión es necesaria cuando varias personas trabajan sobre los mismos archivos en un proyecto. Una fusión puede ser algo automatizado, cuando la herramienta de fusionado no solo tiene nuevos archivos modificados (llamados «ramas»), sino también el archivo original (llamado «base»). La herramienta de fusionado seleccionará automáticamente cualquier modificación que se haga solo en una rama. Cuando varios colaboradores cambian la misma línea, la herramienta detecta un conflicto que deberá resolverse manualmente. El fusionado se vuelve difícil porque, por ejemplo, un colaborador cambió muchas cosas y corrigió el sangrado en algunos lugares. Otro colaborador también cambió mucho texto en el mismo archivo, y todo esto dió como resultado varios conflictos durante la fusión. La herramienta que utilizaba, solo mostraba las líneas cambiadas, pero no los cambios hechos en estas líneas. Y no había información sobre los cambios en el sangrado. La fusión era una pequeña pesadilla. Por eso empecé. La primera versión podía mostrar las diferencias en un línea y las diferencias en los espacios en blanco. Después se añadieron otras características para incrementar la utilidad. Por ejemplo, si desea comparar algún texto rápidamente, podrá copiarlo al portapapeles y pegarlo en otra ventana de diff. Una característica que requería un enorme esfuerzo era la capacidad de comparar y fusionar directorios, que convirtió el programa en un navegador de archivos completo. Espero que &kdiff3; le funcione también. ¡Diviértase! Joachim Eibl (2003) Están plenamente soportadas 3 formas de fusionado. Ésto es práctico si dos personas cambian código de manera independiente. -El archivo original (la base) se utiliza para ayudar a &kdiff3; a seleccionar automáticamente los cambios correctos. -El editor de la fusión inferior le permitirá resolver los conflictos a través de las ventanas de diff, mostrándole la salida que obtendría. -También podrá editar la salida. - -Esta captura muestra tres archivos de entrada que se han fusionado: - +>Existe 3 formas de fusión totalmente soportados. Es práctico si dos personas modifican código de forma independiente. El archivo original (la base) se utiliza para ayudar a &kdiff3; para seleccionar automáticamente los cambios correctos. El editor de fusión bajo la ventana de diferencias le permite resolver los conflictos, a la vez que le muestra la salida. También podrá editar la salida. Esta captura de pantalla muestra tres archivos de entrada que se pueden fusionar: + &kdiff3; también le ayuda a comparar y fusionar directorios completos. Esta captura muestra &kdiff3; durante la fusión de un directorio: - +>&kdiff3; también le ayuda a comparar y fusionar directorios completos. Esta captura muestra &kdiff3; durante la fusión de un directorio: - + Visor de diferencias línea a línea y caracter a caracter - Utilizando las posibilidades que permite una pantalla gráfica a color &kdiff3; muestra exactamente cuál es la diferencia. Cuando haga algunas revisiones de código, obtendrá algo como esto. - +>Utilizando las posibilidades que permite una pantalla gráfica a color &kdiff3; muestra exactamente cuál es la diferencia. Cuando haga algunas revisiones de código, obtendrá algo como ésto. Ver diferencias de espacios en blanco de un vistazo Los espacios y tabulaciones que difieren se muestran visiblemente. Cuando las líneas difieren solo en la cantidad de espacios en blanco puede verse de un vistazo en la columna resumen en la parte izquierda (no más preocupaciones cuando se hagan cambios en el sangrado). - Buscar cadenas en todas las ventanas de texto. Buscar (&Ctrl;F) y Buscar siguiente (F3).Buscar cadenas en todas las ventanas de texto. Buscar (Ctrl-F) y Buscar siguiente (F3). Soporte para idiomas que van de derecha a izquierda. + ... @@ -356,7 +362,7 @@ Documentación de la comparación y fusión de archivos +>Comparación y fusión de archivos kdiff3</command > <replaceable >archivo1 archivo2</replaceable -></screen> +> +</screen> </sect2> <sect2 @@ -381,17 +388,15 @@ >kdiff3</command > <replaceable >archivo1 archivo2</replaceable -> <option ->-m</option> -<command +> -m + <command >kdiff3</command > <replaceable >archivo1 archivo2</replaceable -> <option ->-o</option -> <replaceable +> -o <replaceable >archivosalida</replaceable -></screen> +> +</screen> </sect2> <sect2 @@ -402,7 +407,8 @@ >kdiff3</command > <replaceable >archivo1 archivo2 archivo3</replaceable -></screen> +> +</screen> </sect2> <sect2 @@ -413,17 +419,15 @@ >kdiff3</command > <replaceable >archivo1 archivo2 archivo3</replaceable -> <option ->-m</option> -<command +> -m + <command >kdiff3</command > <replaceable >archivo1 archivo2 archivo3</replaceable -> <option ->-o</option -> <replaceable +> -o <replaceable >archivosalida</replaceable -></screen> +> +</screen> <para >Tenga en cuenta que <replaceable >archivo1</replaceable @@ -438,13 +442,14 @@ ><title >Caso especial: Archivos con el mismo nombre Si todos los archivos tienen el mismo nombre pero están en directorios diferentes, puede reducir el tipo de trabajo especificando el nombre del archivo sólo para el primer archivo. ⪚: +>Si todos los archivos tienen el mismo nombre pero están en directorios diferentes, puede reducir el tipo de trabajo especificando el nombre del archivo sólo para el primer archivo. P.ej.: kdiff3 directorio1/nombrearchivo directorio2 directorio3 +> + kdiff3 directorio1 directorio2 -kdiff3 directorio1 directorio2 -o directoriodestino -kdiff3 directorio1 directorio2 directorio3 -kdiff3 directorio1 directorio2 directorio3 -o directoriodestino @@ -487,13 +488,17 @@ Para obtener más información sobre las opciones de la línea de órdenes utilice: +>Opciones de la línea de órdenes +Para obtener más información sobre las opciones de la línea de órdenes utilice: kdiff3 - --help + +Ejemplo de salida: +Opciones: -m, --merge Fusiona la entrada. -b, --base archivo Archivo base explícito. Por compatibilidad con ciertas herramientas. @@ -505,8 +510,45 @@ --L2 alias2 Reemplazo de nombre visible para la entrada del archivo 2. --L3 alias3 Reemplazo de nombre visible para la entrada del archivo 3. -L, --fname alias Reemplazo de nombre visible alternativo. Proporcione éste una vez para cada entrada. - -u Sin efecto. Por compatibilidad con ciertas herramientas. + --cs string Sobreescribe la configuración. Utilícelo una vez para cada opción. P.ej.: --cs "AutoAdvance=1" + --confighelp Muestra la lista de las opciones de configuración y sus valores actuales. + --config file Utiliza un archivo de configuración diferente. + +La opción le permite ajustar un valor de configuración que de otra forma solo sería ajustable a través del diálogo de configuración. Pero asegúrese de que cuando &kdiff3; finalice se guarden los valores con las configuraciones nuevas. Con puede encontrar los nombres de los elementos disponibles y los valores actuales. +A través de puede especificar un archivo de configuración diferente. Cuando utilice con frecuencia diferentes configuraciones para &kdiff3; ésto le permitirá cambiar entre ellas. + +Opciones de la línea de órdenes que se ignoran +Mucha gente quiere utilizar &kdiff3; con algún sistema de control de versiones. Pero cuando el sistema de control de versiones llama a &kdiff3; utilizando los parámetros de la línea de órdenes &kdiff3; no los reconoce, y termina con un error. Las preferencias de integración le permiten especificar los parámetros de línea de órdenes que &kdiff3; debería ignorar. Aparecerán en la ayuda de uso, de forma similar a este ejemplo: +--foo Ignored. (Definida por el usuario.) + + + Opciones de la línea de órdenes a ignorar:Una lista de opciones separadas por punto y coma «;». Cuando aparezca una de estas opciones en una línea de órdenes, &kdiff3; la ignorará y se ejecutará sin informar de ningún error (el valor predeterminado es «u;query;html;abort»). + +Si ésto no es suficiente, se recomienda escribir un script para el intérprete de órdenes que traduzcan esta opción. @@ -523,44 +565,28 @@ El diálogo abrir le permite editar los nombres de los archivos manualmente, seleccionando un archivo a través del navegador de archivos (Archivo...) o permitir la elección de los archivos recientes a través de las listas desplegables. Si abre el diálogo nuevamente, el nombre actual continúa ahí. El tercer archivo de entrada no es necesario. si la entrada para «C» permanece vacía, solo se efectuará el análisis de diferencia de dos archivos. El diálogo abrir le permite editar los nombres de los archivos manualmente, seleccionando un archivo a través del navegador de archivos («Archivo...») o permitir la elección de los archivos recientes a través de las listas desplegables. Si abre el diálogo nuevamente, el nombre actual continúa ahí. El tercer archivo de entrada no es necesario. si la entrada para «C» permanece vacía, solo se efectuará el análisis de diferencia de dos archivos. Puede seleccionar un directorio a través de Dir... Si se especifica un directorio para A entonces comienza la comparación/fusión de directorios. Si en A especifica un archivo pero en B,C o en la salida se especifica un directorio, &kdiff3; utiliza el nombre del archivo de A en los directorios especificados. Puede seleccionar un directorio a través de «Dir...». Si se especifica un directorio para A entonces comienza la comparación/fusión de directorios. Si en A especifica un archivo pero en B,C o en la salida se especifica un directorio, &kdiff3; utiliza el nombre del archivo de A en los directorios especificados. Si está seleccionado Fusionar, la línea de Salida será editable. Pero no se necesita especificar el nombre de archivo de salida de forma inmediata. Puede postponerlo hasta que lo guarde. Si está seleccionado «Fusionar», la línea de «Salida» será editable. Pero no se necesita especificar el nombre de archivo de salida de forma inmediata. Puede postponerlo hasta que lo guarde. El botón Configurar... abre el diálogo de opciones, de forma que pueda seleccionar las opciones antes de realizar el análisis. +>El botón «Configurar...» abre el diálogo de opciones, de forma que pueda seleccionar las opciones antes de realizar el análisis. Pegar y soltar la entrada Algunas veces deseará comparar partes de un texto que no sea propiamente un archivo. &kdiff3; también le permite pegar texto desde el portapapeles a la ventana de entrada de diff que tenga el foco. El análisis de las diferencias se producirá inmediatamente. En el diálogo abrir no necesitará especificar archivos entonces, ciérrelo con el botón Cancelar. Algunas veces deseará comparar partes de un texto que no sea propiamente un archivo. &kdiff3; también le permite pegar texto desde el portapapeles a la ventana de entrada de diff que tenga el foco. El análisis de las diferencias se producirá inmediatamente. En el diálogo abrir no necesitará especificar archivos entonces, ciérrelo con el botón «Cancelar». También podrá utilizar arrastrar y soltar: Arrastre un archivo desde un administrador de archivos o seleccione texto en un editor y arrástrelo a la ventana de entrada. ¿Cuál es la idea? Algunas veces un archivo contiene dos funciones similares, pero comprobar las similitudes es un esfuerzo enorme si primero debe crear los archivos y luego cargarlos. Ahora bastará con copiar, pegar y comparar las secciones relevantes. -¿Cuál es la idea? Algunas veces un archivo contiene dos funciones similares, pero comprobar las similitudes es un esfuerzo enorme si primero debe crear los archivos y luego cargarlos. Ahora bastará con copiar, pegar y comparar las secciones relevantes. En estos momentos no podrá arrastrar nada desde &kdiff3;. Solo está soportado en la ventana de entrada diff. -Nota: En estos momentos no podrá arrastrar nada desde &kdiff3;. Solo está soportado en la ventana de entrada diff. Algunos editores todavía interpretan arrastrar y soltar en otro programa como cortar (en lugar de copiar) y pegar. En este caso sus datos originales se perderían. +>Aviso: Algunos editores todavía interpretan arrastrar y soltar en otro programa como cortar (en lugar de copiar) y pegar. En este caso sus datos originales se perderían. -En la parte superior de cada ventana de texto se encuentra la «línea de información». Las líneas de información de las ventanas de entrada contienen una letra A, B o C, el nombre del archivo y el número de línea de la primera línea visible en la ventana (recuerde que la ventana C es opcional). Cada línea de información aparecerá de diferente color (Si las rutas son demasiado largas para ajustarlas, puede mover el ratón sobre la línea de información y se le mostrará un mensaje con el nombre completo). Línea de informaciónLas tres ventanas de entrada tienen asignadas las letras A, B y C, A tiene color azul, B verde y C magenta (estos son los valores predeterminados, pero puede cambiarlos en el menú Preferencias). En la parte superior de cada ventana de texto se encuentra la «línea de información». Las líneas de información de las ventanas de entrada contienen una letra «A», «B» y «C», el nombre del archivo, un botón para el navegador, y el número de línea de la primera línea visible en la ventana (recuerde que la ventana «C» es opcional). Cada línea de información aparecerá con un color diferente. Cuando se detecta una diferencia el color mostrado en el archivo de entrada cambia. Cuando los dos archivos presentan diferencias el color utilizado para expresar esto es rojo de manera predeterminada (Color de conflicto en las preferencias). Este esquema de color es especialmente práctico en el caso de que tenga tres archivos de entrada, tal y como se verá en la próxima sección (Cuando selecciona otro archivo a través del navegador o termina de editar el nombre del archivo pulsando entrar, el nuevo archivo se cargará y se comparará con el(los) archivo(s) que ya estaba(n) cargado(s). ColoreadoLas tres ventanas de entrada tienen asignadas las letras «A», «B» y «C». «A» tiene color azul, «B» verde y «C» magenta (estos son los valores predeterminados, pero puede cambiarlos en el menú Preferencias). Cuando se detecta una diferencia el color mostrado en el archivo de entrada cambia. Cuando los dos archivos presentan diferencias el color utilizado para expresar esto es rojo de manera predeterminada («Color de conflicto» en las preferencias). Este esquema de color es especialmente práctico en el caso de que tenga tres archivos de entrada, tal y como se verá en la próxima sección (Fusionar). Columna resumenA la izquierda de cada texto se encuentra la «columna resumen». Si las diferencias se producen en una línea la columna resumen muestra el color correspondiente. Si la diferencia es sólo de espacios en blanco se marca el resumen. Para los lenguajes de programación en los que los espacios no son importantes es práctico para apreciar de un vistazo si se modificó algo importante. (En C/C++ los espacios en blanco sólo son interesantes en el interior de las cadenas, comentarios, para el preprocesador y en otra serie de extrañas situaciones). La línea vertical que separa la columna resumen y el texto se interrumpe si el archivo de entrada no tiene líneas. Cuando se activa el ajuste de línea, esta línea vertical aparecerá punteada en las líneas ajustadas. Columna de visión generalEn el lado derecho podemos encontrar la columna «visión general», a la izquierda de la barra de desplazamiento. Muestra la columna de resumen comprimida de la entrada A. todas las diferencias y conflictos se pueden apreciar de un vistazo. Cuando solo se utilizan dos ventanas de entrada, todas las diferencias aparecerán en rojo, ya que cada diferencia supondrá un conflicto. Un rectángulo negro marca la parte visible de las entradas. Para los archivos con entradas muy largas, cuando el número de líneas es más grande que la altura de la columna visión general en pixels, varias líneas de entrada compartirán una línea de visión general. Un conflicto tendrá más prioridad que las simples diferencias, que a su vez tendrán prioridad sobre lo no cambiado, de forma que no se pierdan las diferencias o los conflictos aquí. Pulsando sobre la columna de visión general se mostrará el correspondiente texto. +>En el lado derecho podemos encontrar la columna «visión general», a la izquierda de la barra de desplazamiento. Muestra la columna de resumen comprimida de la entrada «A». todas las diferencias y conflictos se pueden apreciar de un vistazo. Cuando solo se utilizan dos ventanas de entrada, todas las diferencias aparecerán en rojo, ya que cada diferencia supondrá un conflicto. Un rectángulo negro marca la parte visible de las entradas. Para los archivos con entradas muy largas, cuando el número de líneas es más grande que la altura de la columna visión general en pixels, varias líneas de entrada compartirán una línea de visión general. Un conflicto tendrá más prioridad que las simples diferencias, que a su vez tendrán prioridad sobre lo no cambiado, de forma que no se pierdan las diferencias o los conflictos aquí. Pulsando sobre la columna de visión general se mostrará el correspondiente texto. Líneas alineadas manualmenteAlgunas veces el algoritmo sitúa líneas incorrectas unas al lado de otras. O desea comparar un trozo de texto con otro texto que está en una posición completamente diferente en el otro archivo. Para estas situaciones puede indicar a &kdiff3; manualmente que alinee algunas líneas. Marque el texto que quiera alinear con el ratón, como si estuviera copiando y pegando, en la primera vista de diferencia y seleccione «Añadir alineación manual de diferencias» en el menú «Diffview» (acceso rápido de teclado «Ctrl-Y»). Aparecerá una barra naranja en la columna resumen al lado del texto seleccionado. Repita esto para la segunda y (si está disponible) para la tercera vista. &kdiff3; recalculará inmediatamente las diferencias cada vez que haga esto, y alineará las líneas elegidas. Por supuesto, alguna de las líneas que antes coincidían puede que ya no coincidan. En estos momentos el fusionado no soporta el uso de ayuda de diff manual. @@ -625,236 +651,248 @@ La ventana del editor de la salida fusionada (bajo las ventanas de la entrada de diferencias) también tiene una línea de información sobre ella que mostrará Salida, el nombre del archivo y [Modificado] si edita algo. Normalmente contendrá texto que podrá fusionarse automáticamente con facilidad, pero algunas veces también contendrá conflictos. La ventana del editor de la salida fusionada (bajo las ventanas de la entrada de diferencias) también tiene una línea de información sobre ella que mostrará «Salida», el nombre del archivo y «[Modificado]» si edita algo. Normalmente contendrá texto que podrá fusionarse automáticamente con facilidad, pero algunas veces también contendrá conflictos. El guardado está desactivado hasta que se hayan resuelto todos los conflictos (utilice los botones Ir al conflicto anterior/siguiente sin resolver para encontrar los conflictos que falten). El guardado está desactivado hasta que se hayan resuelto todos los conflictos (utilice los botones «Ir al conflicto anterior/siguiente sin resolver» para encontrar los conflictos que falten). Con sólo dos archivos de entrada, cada diferencia es también un conflicto que debe resolverse manualmente. Con tres archivos de entrada el primer archivo se utiliza como base, mientras que el segundo y tercer archivos de entrada contienen las modificaciones. Si en cualquier línea solo tienen cambios la entrada B o la C pero no ambas se seleccionará automáticamente la fuente cambiada. Solo cuando B y C tengan cambios en las mismas líneas, la herramienta detectará un conflicto que debe resolverse manualmente. Cuando B y C sean iguales, pero diferentes a A, se seleccionará C. La columna resumenEl editor de la salida de fusionado también tiene una columna resumen a su izquierda. Mostrará la letra de la entrada de la que se seleccionó la línea, o nada si las tres fuentes son iguales en esa línea. Para los conflictos mostrará un signo de interrogación ? y la línea mostrará <Conflicto de fusionado>, en rojo. Puesto que resolver los conflictos línea a línea es muy arduo, las líneas se agruparán en grupos que tengan las mismas diferencias y conflictos característicos. Pero los conflictos causados solo por espacios en blanco se separarán de los conflictos no causados por espacios en blanco para facilitar el fusionado de los archivos cuando el sangrado cambia en muchas líneas. El editor de la salida de fusionado también tiene una columna resumen a su izquierda. Mostrará la letra de la entrada de la que se seleccionó la línea, o nada si las tres fuentes son iguales en esa línea. Para los conflictos mostrará un signo de interrogación «?» y la línea mostrará «<Conflicto de fusionado>», en rojo. Puesto que resolver los conflictos línea a línea es muy arduo, las líneas se agruparán en grupos que tengan las mismas diferencias y conflictos característicos. Pero los conflictos causados solo por espacios en blanco se separarán de los conflictos no causados por espacios en blanco para facilitar el fusionado de los archivos cuando el sangrado cambia en muchas líneas. Configurar el grupo actual, sincronizado de fusión y posición de vista de diferenciasCuando se pulsa en la columna resumen con el botón izquierdo del ratón en la ventana a la que pertenezca este grupo, se seleccionarán todas las ventanas y se mostrará el comienzo de este grupo (ésto implica un salto automático en la posición de la ventana si el principio del grupo no se encuentra visible). El grupo se convierte en el «grupo actual». Se resalta con la «gama (diff) de color del fondo actual» y aparecerá una barra negra en la parte izquierda del texto. Seleccionar las entradas A, B o C para el conflicto actual y la ediciónVea que los botones de selección de entradas contienen las letras A, B y C en la barra de botones bajo la barra de menú. Cuando pulse en cualquiera de los botones de selección, las líneas de éste se añadirán al final del grupo seleccionado, si este grupo no contenía la fuente antes. En otro caso las líneas de esta entrada se eliminarán. La barra de botones bajo el menú incluye tres botones para seleccionar las entradas que contienen las letras «A», «B» y «C». Pulse el botón selector de entrada para insertar (o eliminar si ya se ha insertado) las líneas de la fuente respectiva. Para seleccionar las líneas de varias entradas pulse los botones correspondientes en el orden que necesite. Por ejemplo, si desea que las líneas de «B» aparezcan antes de las líneas de «A» en la salida, pulse primero «B» y luego «A». Además, podrá editar cualquier línea directamente. La columna resumen mostrará m por cada línea que haya modificado. Si estaba utilizando la opción avance automático («Automáticamente ir al conflicto siguiente sin resolver después de una selección de origen»), debería desactivarla antes de elegir líneas desde varias entradas o editar líneas después de su elección. Sino lo hace &kdiff3; saltará al siguiente conflicto después de elegir la primera entrada. Algunas veces, cuando una línea se elimina bien por el fusionado o por la edición manual y no hay más líneas en este grupo, aparecerá el texto <Sin línea fuente>. Se coloca en lugar del grupo de forma que pueda cambiar de idea y seleccionar de nuevo la fuente. Este texto no aparecerá en el archivo guardado o en cualquier selección que copie y pegue. Suele ser práctico para editar directamente la salida resultante de la fusión. La columna resumen mostrará «m» para cada línea que se haya modificado manualmente. Cuando, por ejemplo, las diferencias estén alineadas de forma que la simple elección no sea satisfactoria, puede marcar el texto necesario y utilizar copiar y pegar de forma normal para situarlo en la salida de fusionado. El texto «<Conflicto de fusionado>» aparecerá en el portapapeles si copia y pega texto que lo contenga. Algunas veces, cuando una línea se elimina bien por el fusionado o por la edición manual y no hay más líneas en este grupo, aparecerá el texto <Sin línea fuente>. Se coloca en lugar del grupo de forma que pueda cambiar de idea y seleccionar de nuevo la fuente. Este texto no aparecerá en el archivo guardado o en cualquier selección que copie y pegue. El fusionado normal se inicia resolviendo los conflictos sencillos automáticamente. Pero el menú Fusionar proporciona algunas acciones para otras necesidades habituales. Si ha seleccionado la misma fuente para más conflictos, podrá seleccionar «A», «B» o «C» en cualquier sitio, o solo para los conflictos pendientes de resolver, o para los conflictos sin resolver que sean debidos a espacios. Si desea decidir cada delta por sí mismo, puede Establecer deltas a conflictos. O si desea volver a las elecciones automáticas de &kdiff3; seleccione «Resolver automáticamente conflictos simples». &kdiff3; reiniciará el fusionado. Para las acciones que cambien sus modificaciones anteriores KDiff3 le pedirá confirmación antes de realizarlo. - -El texto «<Conflicto de fusionado>» aparecerá en el portapapeles si copia y pega texto que la contenga. Pero tenga cuidado al hacerlo. Seleccionar las entradas A, B o C para todos los conflictosCuando seleccione fuente para los conflictos de espacios en blanco sin resolver y las opciones Ignorar números o Ignorar comentarios C/C++ los cambios en los números o en los comentarios serán tratados también como espacios en blanco. +>El fusionado normal se inicia resolviendo los conflictos sencillos automáticamente. Pero el menú «Fusionar» proporciona algunas acciones para otras necesidades habituales. Si ha seleccionado la misma fuente para más conflictos, podrá seleccionar «A», «B» o «C» en cualquier sitio, o solo para los conflictos pendientes de resolver, o para los conflictos sin resolver que sean debidos a espacios. Si desea decidir cada delta por sí mismo, puede «Establecer deltas a conflictos». O si desea volver a las elecciones automáticas de &kdiff3; seleccione «Resolver automáticamente conflictos simples». &kdiff3; reiniciará el fusionado. Para las acciones que cambien sus modificaciones anteriores &kdiff3; le pedirá confirmación antes de realizarlo. Nota: Cuando seleccione fuente para los conflictos de espacios en blanco sin resolver y las opciones «Ignorar números» o «Ignorar comentarios C/C++», los cambios en los números o en los comentarios se tratarán también como espacios en blanco. Fusión automática de las claves de control de versión y del historial (registro)Many version control systems support special keywords in the file. (e.g. "$Date: 2006-04-21 17:24:21 -0400 (Fri, 21 Apr 2006) $", "$Header$", "$Author: toma $", "$Log$" etc.) During the check-in the version control system (VCS) changes these lines. For instance "$Date: 2006-04-21 17:24:21 -0400 (Fri, 21 Apr 2006) $" will turn into "$Date: 2006-04-21 17:24:21 -0400 (Fri, 21 Apr 2006) $". Since this line will be different in every version of the file, it would require manual interaction during the merge. &kdiff3; ofrece fusionado automático para estos elementos. Para las líneas que coincidan con la opción «Fusionar automáticamente expresión regular» en todos los archivos de entrada de &kdiff3; se elegirá la línea desde B o -si está disponible- desde C (adicionalmente es necesario que las líneas en cuestión si las comparamos con las líneas anteriores no han de tener conflictos). Esta fusión automática también se puede ejecutar de forma inmediata después de iniciar la fusión (active la opción «Ejecutar expresión regular de fusión automática al iniciar la fusión») o posteriormente a través del menú de fusión «Ejecutar expresión regular de fusión automática»). También está soportada la fusión automática para el historial de control de versión (también llamado «registro»). El historial de fusión automática se puede ejecutar automáticamente cuando se inicie la fusión activando la opción «Resolver automáticamente los conflictos del historial». Usually the version control history begins with a line containing the keyword "$Log$". This must be matched by the "History start regular expression"-option. &kdiff3; detects which subsequent lines are in the history by analysing the leading characters that came before the "$Log$"-keyword. If the same "leading comment" also appears in the following lines, then they are also included in the history. Durante cada descarga el VCS escribe una única línea especificando la versión, fecha, e información horaria seguida de líneas con comentarios del usuario. Estas líneas forman una entrada de historial. Esta sección del historial crece cada vez que descarga de forma que las entrada más recientes aparecerán en la parte superior (después de la línea de inicio del historial). Cuando dos o más desarrolladores que están realizando un desarrollo paralelo descargan una rama de un archivo la fusión del historial contendrá varias entradas que aparecerán como conflictos durante la fusión de las ramas. Como esta fusión puede ser muy aburrido, &kdiff3; ofrece soporte con dos posibles estrategias: Insertar la información del historial de ambos colaboradores en la parte superior u ordenar la información del historial por una clave definida por el usuario. El método que simplemente inserta las entradas es fácil de configurar. &kdiff3; solo necesita un método para detectar qué líneas pertenecen a una entrada del historial. La mayor parte de los VCS insertan una línea vacía después de cada entrada del historial. Sino hay otras líneas vacías, éste criterio es suficiente para &kdiff3;. Seleccione «Entrada del historial que inicia una expresión regular». Si el criterio de la línea vacía no es suficiente, puede especificar una expresión regular para detectar el inicio de la entrada del historial. Tenga en cuenta que &kdiff3; eliminará las entradas duplicadas del historial. Si una entrada aparece varias veces en el historial de un archivo de entrada, solo permanecerá una en la salida. Si desea ordenar el historial, debe especificar cómo se debe construir la clave de ordenación. Utilice paréntesis en «Entrada del historial que inicia una expresión regular» para agrupar partes del a expresión regular que se deberían utilizar posteriormente para la tecla de ordenación. A continuación especifique «Orden de la clave de ordenación que inicia la entrada del historial» especificando una lista de números separados por una coma «,» para referirse a la posición del grupo en la expresión regular. Debido a que no es sencillo de hacer al primer intento, podrá comprobar y mejorar la expresión regular y la generación de clave en un diálogo dedicado pulsando el botón «Comprobar sus expresiones regulares». Example: Assume a history that looks like this: +/************************************************************************** +** HISTORY: $Log: \toms_merge_main_view\MyApplication\src\complexalgorithm.cpp $ +** +** \main\integration_branch_12 2 Apr 2001 10:45:41 tom +** Merged branch simon_branch_15. +** +** \main\henry_bugfix_branch_7\1 30 Mar 2001 19:22:05 henry +** Improved the speed for subroutine convertToMesh(). +** Fixed crash. +**************************************************************************/ + The history start line matches the regular expression ".*\$Log.*\$.*". Then follow the history entries. The line with the "$Log$"-keyword begins with two "*" after which follows a space. &kdiff3; uses the first non-white-space string as "leading comment" and assumes that the history ends in the first line without this leading comment. In this example the last line ends with a string that also starts with two "*", but instead of a space character more "*" follow. Hence this line ends the history. Sino es necesaria la ordenación del historial entonces la entrada del historial comenzará con una línea de expresión regular como esta (esta línea se divide en dos porque sino no se puede ajustar) +\s*\\main\\\S+\s+[0-9]+ (Ene|Feb|Mar|Abr|May|Jun|Jul|Ago|Sep|Oct|Nov|Dic) + [0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\s+.* + Para obtener detalles sobre las expresiones regulares por favor, consulte la documentación de las expresiones regulares de Trolltech. Tenga en cuenta que "\s" (con la «s» minúscula) coincidirá con cualquier espacio y "\S" (con «S» mayúscula) coincidirá con lo que no sean espacios en blanco. En nuestro ejemplo la entrada del historial deberá contener primero la versión de información de la expresión regular "\\main\\\S+", la fecha formada por el día «[0-9]+», més «(Ene|Feb|Mar|Abr|May|Jun|Jul|Ago|Sep|Oct|Nov|Dic)» y año «[0-9][0-9][0-9][0-9]», la hora «[0-9][0-9]:[0-9][0-9]:[0-9][0-9]» y finalmente el nombre de registro del desarrollador «.*». Vea que el comentario importante (en el ejemplo «**») lo eliminará KDiff3 antes de buscar la coincidencia, de ahí que la expresión regular comience con con una expresión regular para ninguno o más espacios en blanco «\s*». Si necesita un historial ordenado, se calculará la clave de ordenación. Para esta las partes relevantes en la expresión regular se deben agrupar entre paréntesis (los paréntesis adicionales puede mantenerse aunque desactive la ordenación del historial). +(Ene|Feb|Mar|Abr|May|Jun|Jul|Ago|Sep|Oct|Nov|Dic) + ([0-9][0-9][0-9][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9])\s+(.*) + Los paréntesis ahora contendrán: 1. versión de información, 2. día, 3. mes, 4. año, 5. hora, 6. nombre. Pero si deseamos ordenarlos por fecha y hora, necesitará construir una clave con los elementos en un orden de aparición diferente: Primero el año, seguido del mes, día, hora, información de versión y nombre. De ahí que el orden de la clave de ordenación que se deba especificar sea «4,3,2,5,1,6». Ya que los nombres de los meses no son buenos para la ordenación («Abr» iría primero) &kdiff3; detectará que son nombres de meses y utilizará números en su lugar («Abr»->«04»). Si se encuentra un número puro se transformará en un valor de 4 dígitos con ceros significativos para la ordenación. Finalmente la clave de ordenación resultante que iniciará la primera entrada del historial será: 2001 04 0002 10:45:41 rama_integración_12 tom + +Para obtener más detalles consulte también Configuración de Diff y Merge. + Navegación y edición La mayor parte de la navegación puede realizarse con las barras de desplazamiento y el ratón, pero también puede navegar con las teclas. Si pulsa en cualquier ventana puede utilizar los botones Flecha izquierda, Flecha derecha, Flecha arriba, Flecha abajo, Página arriba, Página abajo, Inicio, Fin, &Ctrl;Inicio, &Ctrl;Fin tal y como lo haría en otros programas. La columna vista general situada al lado de la barra vertical de desplazamiento en los archivos de entrada también puede utilizarse para navegar pulsando sobre ella. La mayor parte de la navegación puede realizarse con las barras de desplazamiento y el ratón, pero también puede navegar con las teclas. Si pulsa en cualquier ventana puede utilizar los cursores izquierdo, derecho, arriba, abajo, página arriba, página abajo, inicio, fin, Ctrl-Inicio, Ctrl-Fin tal y como lo haría en otros programas. La columna vista general situada al lado de la barra vertical de desplazamiento en los archivos de entrada también puede utilizarse para navegar pulsando sobre ella. También puede utilizar la rueda del ratón para desplazarse arriba y abajo. En el editor de la salida de fusionado también puede utilizar las otras teclas para la edición. Puede cambiar entre los modos insertar y sobreescribir con la tecla Insertar (el modo predeterminado es insertar). En el editor de la salida de fusionado también puede utilizar las otras teclas para la edición. Puede cambiar entre los modos insertar y sobreescribir con la tecla Insertar (el modo predeterminado es insertar). Una pulsación del &LMB; en la columna resumen sincronizará todas las ventanas para mostrar el inicio del mismo grupo de líneas (tal y como se explicaba en la sección «Fusionado»Una pulsación del botón izquierdo del ratón en la columna resumen sincronizará todas las ventanas para mostrar el inicio del mismo grupo de líneas (tal y como se explicaba en la sección «Configurar el grupo actual, sincronizado de fusión y posición de vista de diferencias»). La barra de botones también contiene siete botones de navegación con los que podrá saltar a la diferencia actual/primera/última, a la siguiente/anterior diferencia (&Ctrl;Flecha abajo/&Ctrl;Flecha arriba), al siguiente/anterior conflicto (&Ctrl;Página abajo/&Ctrl;Página arriba), o al siguiente/anterior conflicto sin resolver. Tenga en cuenta que para &kdiff3; un «conflicto» que no se pudo resolver automáticamente al comienzo del fusionado continúa siendo un «conflicto» aunque se haya resuelto. De aquí la necesidad de distinguir los «conflictos sin resolver» También existe el botón Automáticamente ir al conflicto siguiente sin resolver después de una selección origen (avance automático). Si activa esto, cuando se seleccione una fuente &kdiff3; saltará automáticamente al siguiente conflicto sin resolver. Esto puede ayudarle cuando desee seleccionar una sola fuente. Cuando necesite ambas fuerte, o desee editar después de la selección, probablemente querrá desactivar esto. Antes de continuar con el siguiente conflicto sin resolver &kdiff3; muestra el resultado de su elección durante un momento. Este retardo es ajustable en las preferencias Diff & Fusión: Puede especificar en Retardo auto avanzado en milisegundos un valor entre 0 y 2.000. -¿Cansado de tanta pulsación? Utilice un «Retardo auto avanzado» pequeño y los accesos rápidos &Ctrl;1, &Ctrl;2 y &Ctrl;3 para seleccionar los archivos A, B o C para muchos conflictos. +>La barra de botones también contiene siete botones de navegación con los que podrá saltar a la diferencia actual/primera/última, a la siguiente/anterior diferencia (Ctrl-Flecha abajo/Ctrl-Flecha arriba), al siguiente/anterior conflicto (Ctrl-Página abajo/Ctrl-Página arriba), o al siguiente/anterior conflicto sin resolver. Tenga en cuenta que para &kdiff3; un «conflicto» que no se pudo resolver automáticamente al comienzo del fusionado continúa siendo un «conflicto» aunque se haya resuelto. De aquí la necesidad de distinguir los «conflictos sin resolver» +Avance automático +También existe el botón «Automáticamente ir al conflicto siguiente sin resolver después de una selección origen» (avance automático). Si activa esto, cuando se seleccione una fuente &kdiff3; saltará automáticamente al siguiente conflicto sin resolver. Esto puede ayudarle cuando desee seleccionar una sola fuente. Cuando necesite ambas fuerte, o desee editar después de la selección, probablemente querrá desactivar esto. Antes de continuar con el siguiente conflicto sin resolver &kdiff3; muestra el resultado de su elección durante un momento. Este retardo es ajustable en las preferencias Diff y fusión: Puede especificar en «Retardo auto avanzado» en milisegundos un valor entre 0 y 2.000. Pista: ¿Cansado de tanta pulsación? Utilice un retardo de avance automático pequeño y los accesos rápidos Ctrl-1/2/3 para seleccionar A/B/C para muchos de los conflictos. + Seleccionar, copiar y pegar Las ventanas de entrada no muestran un cursor, por ello las selecciones se hacen pulsando el &LMB; al inicio, manteniendo pulsado el botón del ratón y moviéndose al final, momento en el que soltará el botón del ratón. También puede seleccionar una palabra con una doble pulsación. En la salida del editor de fusionado puede realizar la selección a través del teclado manteniendo pulsado el botón &Shift; y navegando con las teclas de cursor. Las ventanas de entrada no muestran un cursor, por ello las selecciones se hacen pulsando el botón izquierdo del ratón al inicio, manteniendo pulsado el botón del ratón y moviéndose al final, momento en el que soltará el botón del ratón. También puede seleccionar una palabra con una doble pulsación. En la salida del editor de fusionado puede realizar la selección a través del teclado manteniendo pulsado el botón «mayúsculas» y navegando con las teclas de cursor. Para copiar al portapapeles debe pulsar el botón Copiar (&Ctrl;C o &Ctrl;Insertar). Pero también existe la opción «Auto copiar selección». Si está activado, todo lo que seleccione se copiará inmediatamente y no necesitará realizar la copia explícitamente. Ponga atención cuando lo utilice ya que el contenido del portapapeles puede destruirse accidentalmente. Si la selección excede el rango visible puede desplazar el ratón sobre los bordes de la ventana que harán que &kdiff3; se desplace en esta dirección. Cortar (&Ctrl;X o &Shift;Borrar) copia el portapapeles, borra el texto seleccionado y Pegar (&Ctrl;V o &Shift;Insertar) inserta el texto en el portapapeles en la posición del cursor o sobre la selección actual. +>Para las selecciones muy largas puede utilizar las teclas de navegación mientras mantiene pulsado el ratón. P.ej. utilice RePág y AvPág para ir rápidamente a una posición determinada. Al final de la posición suelte el botón del ratón. Para seleccionarlo todo en la ventana actual utilice el menú «Editar»->«Seleccionar todo» (Ctrl-A). Para copiar al portapapeles debe pulsar el botón «Copiar» (Ctrl-C o Ctrl-Insertar). Pero también existe la opción «Auto copiar selección». Si está activado, todo lo que seleccione se copiará inmediatamente y no necesitará realizar la copia explícitamente. Ponga atención cuando lo utilice ya que el contenido del portapapeles puede destruirse accidentalmente. «Cortar» (Ctrl-X o Mayúsculas-Borrar) copia el texto seleccionado al portapapeles y lo borra. «Pegar» (Ctrl-V o Mayúsculas-Insertar) inserta el texto del portapapeles en la posición del cursor o sobre la selección actual. Si pega algo en cualquier ventana de entrada de diferencia se mostrará el contenido del portapapeles en esta ventana y la comparación se reiniciará inmediatamente. Es práctico si desea guardar rápidamente un trozo de texto de alguna parte y compararlo con algo sin crear los archivos en primer lugar. Guardar Guardar solo estará permitido cuando se hayan resuelto todos los conflictos. Si el archivo ya existe y la opción «Archivos de copia de seguridad» está activada el archivo existente se renombrará con una extensión .orig, pero si ya existe un archivo se borrará. Cuando salga o inicie otro análisis de diferencias y los datos no se hayan guardado, &kdiff3; le preguntará si desea Guardar, Cancelar o Continuar sin guardar. &kdiff3; no captura ninguna señal. Por eso si ejecuta «kill» sobre &kdiff3; sus datos se perderán. Guardar solo estará permitido cuando se hayan resuelto todos los conflictos. Si el archivo ya existe y la opción «Archivos de copia de seguridad» está activada el archivo existente se renombrará con una extensión «.orig», pero si ya existe un archivo se borrará. Cuando salga o inicie otro análisis de diferencias y los datos no se hayan guardado, &kdiff3; le preguntará si desea guardar, cancelar o continuar sin guardar (&kdiff3; no captura ninguna señal. Por eso si ejecuta «kill» sobre &kdiff3; sus datos se perderán). Los finales de línea se guardan de acuerdo con el método utilizado por el sistema operativo. Para Unix cada línea termina con un caracter de nueva línea \n, mientras que para los sistemas basados en &Windows; cada línea termina con un retorno de carro + un nueva línea \r\n. &kdiff3; no conserva los finales de línea de los archivos de entrada, lo que significa que no debería utilizar &kdiff3; con archivos binarios. +>Los finales de línea se guardan de acuerdo con el método utilizado por el sistema operativo. Para Unix cada línea termina con un caracter de nueva línea «\n», mientras que para los sistemas basados en Win-32 cada línea termina con un retorno de carro + un nueva línea «\r\n». &kdiff3; no conserva los finales de línea de los archivos de entrada, lo que significa que no debería utilizar &kdiff3; con archivos binarios. Buscar cadenas Puede buscar una cadena en cualquier ventana de texto de &kdiff3;. La orden Buscar... (&Ctrl;F) en el menú Editar abre un diálogo que le permite especificar la cadena a buscar. La búsqueda siempre comenzará en la parte superior. Utilice la orden Buscar siguiente (F3) para buscar la siguiente aparición. si selecciona la búsqueda en varias ventanas se comenzará a buscar en la primera ventana de arriba hacia abajo antes de iniciar la búsqueda en la parte superior de la siguiente ventana, &etc; +>Puede buscar una cadena en cualquier ventana de texto de &kdiff3;. La orden «Buscar...» («Ctrl-F) en el menú Editar abre un diálogo que le permite especificar la cadena a buscar. La búsqueda siempre comenzará en la parte superior. Utilice la orden «Buscar siguiente» («F3») para buscar la siguiente aparición. si selecciona la búsqueda en varias ventanas se comenzará a buscar en la primera ventana de arriba hacia abajo antes de iniciar la búsqueda en la parte superior de la siguiente ventana, etc. +Impresión +&kdiff3; soporta impresión de las diferencias en los archivos de texto. La orden «Imprimir» (Ctrl-P) en el menú archivo abre un diálogo que permite seleccionar la impresora y ajustar otras opciones. Existen varias posibilidades de ajustar el rango. Debido a las diferencias existentes en los diálogos de impresión de los diversos sistemas operativos, el método para realizar determinadas selecciones variará. + + Todo:Imprime todo. + Actual:Imprime un página comenzando en la primera línea visible de la ventana (en sistemas sin esta opción se puede suplir este inconveniente especificando la página número 10000 para imprimir). + Selección:Antes de realizar esta elección de impresión seleccione el texto con el ratón (como para copiar y pegar) en una de las ventanas de entrada de diferencias para definir las líneas inicial y final. Si no hay texto seleccionado en una de las ventanas de diferencia, no estará disponible esta opción (en sistemas sin esta opción se puede conseguir el mismo resultado especificando la página 9999). + Rango:Especifique la primera y última página. + +Otras opciones importantes para la impresión son las habituales: + Letra, tamaño de letra + Mostrar números de línea + Ajuste de texto + Colores + etc. + +También se recomienda la impresión en formato apaisado. + Opciones Las opciones y la lista de archivos recientes se guardarán cuando salga del programa, y se recargarán cuando lo inicie (Menú PreferenciasConfigurar KDiff3...). +>Las opciones y la lista de archivos recientes se guardarán cuando salga del programa, y se recargarán cuando lo inicie (Menú Preferencias->Configurar &kdiff3; ...). Fuente @@ -863,8 +901,8 @@ Fuente cursiva para deltas:Fuente cursiva para deltas: Color del primer plano:Color del primer plano: Color de fondo:Color de fondo: Color del fondo de diff:Color del fondo de diff: Color A:Color A: Color B:Color B: Color C:Color C: Color de conflicto:Color de conflicto: Rango actual de color de fondo:Rango actual de color de fondo: Rango actual de color de fondo de diff:Rango actual de color de fondo de diff:Habitualmente amarillo oscuro. + Colores para los rangos de diferencias seleccionados manualmente:Habitualmente naranja. + Color del archivo más nuevo en la comparación de directorios:Habitualmente verde. + Color del archivo más antiguo en la comparación de directorios:Habitualmente rojo. + Color de los archivos de antigüedad media en la comparación de directorios:Habitualmente amarillo oscuro. + Color para los archivos que faltan en la comparación de directorios:Habitualmente negro. En sistemas que solo tengan 16 ó 256 colores algunos de ellos no estarán disponibles en su forma exacta. En aquellos sistema el botón Predeterminados seleccionará un color puro. +>Los cambios de color para la comparación de directorios no tendrán efecto hasta la siguiente vez que inicie la comparación de directorios. +En sistemas que solo tengan 16 ó 256 colores algunos de ellos no estarán disponibles en su forma exacta. En aquellos sistema el botón «Predeterminados» seleccionará un color puro. El tabulador inserta espacios:El tabulador inserta espacios: Tamaño del tabulador:Tamaño del tabulador: Auto indentación:Auto indentación:Cuando pulsa &Enter; o Return el sangrado de la línea anterior se utiliza para la nueva línea. Cuando pulsa Entrar; o Return el sangrado de la línea anterior se utiliza para la nueva línea. Auto-copiar selección:Auto-copiar selección: Estilo línea final:Estilo línea final:Al guardar puede seleccionar qué estilo de línea prefiere. El valor predeterminado es la elección habitual para el sistema operativo utilizado. - Utilizar codificación local:Para mostrar caracteres extranjeros. Intente cambiar ésto si algunos caracteres de su idioma no se muestran correctamente. -Preferencias de Diff y fusión Conservar el retorno de carroConservar el retorno de carroAlgunos editores (en algunos sistemas) guardan los caracteres de retorno de carro \r y de línea siguiente \n al final de la línea, mientras que otros solo guardan el de línea siguiente \n. Normalmente &kdiff3; ignora el retorno de carro, pero a pesar de que debido a ello no tengan el mismo tamaño parecerán iguales si se comparan juntos. Cuando se activa esta opción, los caracteres de retorno de carro se harán visibles, pero se tratarán como espacios en blanco. Esta opción debería estar desactivada durante el mezclado. El valor predeterminado es apagado.Algunos editores (en algunos sistemas) guardan los caracteres de retorno de carro «\r» y de línea siguiente «\n» al final de la línea, mientras que otros solo guardan el de línea siguiente «\n». Normalmente &kdiff3; ignora el retorno de carro, pero a pesar de que debido a ello no tengan el mismo tamaño parecerán iguales si se comparan juntos. Cuando se activa esta opción, los caracteres de retorno de carro se harán visibles, pero se tratarán como espacios en blanco. Esta opción debería estar desactivada durante el mezclado. El valor predeterminado es apagado.
Ignorar números:Ignorar números:De forma predeterminada estará desactivado. Los caracteres numéricos («0-9», .», «-») se ignorarán en la primera parte del análisis en la que se efectuará la coincidencia de líneas. Sin embargo en el resultado las diferencias sí se mostrarán, pero serán tratados como espacios en blanco. De forma predeterminada estará desactivado. Los caracteres numéricos («0-9», «.», «-») se ignorarán en la primera parte del análisis en la que se efectuará la coincidencia de líneas. Sin embargo en el resultado las diferencias sí se mostrarán, pero serán tratadas como espacios en blanco. Ignorar comentarios de C/C++:Ignorar comentarios de C/C++: Ignorar mayúsculas:Ignorar mayúsculas:De forma predeterminada estará desactivado. Las diferencias de mayúsculas de los caracteres (como entre «A» y «a») serán tratadas como los cambios de los espacios en blanco. De forma predeterminada estará desactivado. Las diferencias de mayúsculas y minúsculas de los caracteres (como «A» y «a») se tratarán como cambios de espacios en blanco. Comando del preprocesador:Comando del preprocesador: Comando de preprocesador de combinación de línea:Comando de preprocesador de combinación de línea: Intentar más a fondo:Intentar más a fondo: Retardo auto avanzado (ms):Retardo auto avanzado (ms): Fusionar por omisión espacios en blanco de dos/tres archivos:Fusionar de forma predeterminada espacios en blanco de dos/tres archivos:Resuelve automáticamente todos los conflictos de los espacios en blanco seleccionando el archivo especificado (el modo predeterminado es el manual). Práctico si los espacios no son realmente importantes en los archivos. Si solo necesita ésto ocasionalmente mejor utilice Seleccionar A/B/C para todos conflictos de los espacios en blanco sin resolver en el menú Fusionar. Tenga en cuenta que si ha activado Ignorar números o Ignorar comentarios de C/C++ esta autoelección también se aplica a los conflictos en los números y en los comentarios. Resuelve automáticamente todos los conflictos de los espacios en blanco seleccionando el archivo especificado (el modo predeterminado es el manual). Práctico si los espacios no son realmente importantes en los archivos. Si solo necesita ésto ocasionalmente mejor utilice «Seleccionar A/B/C para todos conflictos de los espacios en blanco sin resolver» en el menú Fusionar. Tenga en cuenta que si ha activado «Ignorar números» o «Ignorar comentarios de C/C++» esta autoelección también se aplica a los conflictos en los números y en los comentarios. + Expresión regular de fusión automática:Expresión regular para las líneas en las que &kdiff3; debería elegir automáticamente una fuente. Consulte también Fusión automática. + Ejecutar expresión regular de fusión automática al iniciar la fusión:Si está activado &kdiff3; ejecutará la fusión automática utilizando la «expresión regular de fusión automática» cuando se inicie una fusión. + Expresión regular de inicio de historial:Regular expression for the start of the merge history entry. Usually this line contains the "$Log$"-keyword. Default value: ".*\$Log.*\$.*" + Expresión regular de inicio de entrada del historial:Una entrada del historial de fusión está formada por varias líneas. Especifique la expresión regular para detectar la primera línea (sin el comentario importante). Utilice paréntesis para agrupar las claves que desee utilizar para la ordenación. Si está vacío, KDiff3 asume que las líneas vacías separan entradas del historial. Consulte también Fusión automática. + Ordenación del historial de fusión:Activar ordenación del historial del control de versiones + orden de la clave de ordenación del inicio de la entrada del historial:Cada paréntesis utilizado en la expresión regular para la entrada del inicio del historial agrupa una clave que puede utilizarse para la ordenación. Especifique la lista de claves (están numeradas en orden de aparición comenzando con 1) y utilizando «,» como separador (p. ej. «4,5,6,1,2,3,7»). Si permanece vacío, no se realizará ordenación. Consulte también fusión automática. + Historial del control de versión de fusión al iniciar la fusiónSi está activado &kdiff3; ejecuta automáticamente el fusionado del historial utilizando las opciones antes mencionadas cuando se inicia una fusión. + Compruebe sus expresiones regularesEste botón muestra un diálogo que le permite mejorar y comprobar la expresión regular. Copie los datos de sus archivos en las líneas de ejemplo. Los «Resultados coincidentes» si la coincidencia se produjo o no. El «Resultado de la clave de ordenación» mostrará la clave utilizada para la ordenación del historial de fusión. + Orden de fusión irrelevante:Especifique una orden que debería ser llamada cuando &kdiff3; detecte que para el archivo B no contiene datos relevantes ya que están incluídos en C. La orden se llama con los tres nombres de archivo como parámetros. Las datos deberán coincidir con la «expresión regular de fusionado automático» o con el historial sino se considera relevante. @@ -1185,16 +1333,12 @@ Archivos de copia de seguridad:Archivos de copia de seguridad:Cuando se guarde una archivo y ya exista una versión antigua, la versión original se renombrará con una extensión .orig. Si ya existía un archivo de copia de seguridad antigua con la extensión .orig se borrará. Cuando se guarde un archivo y ya exista una versión antigua, la versión original se renombrará con una extensión «.orig». Si ya existía un archivo de copia de seguridad antigua con la extensión «.orig» se borrará. @@ -1206,18 +1350,18 @@ Idioma:Idioma:Ajusta el idioma de la interfaz de usuario. Cambiar esta opción no afectará a la ejecución del programa. Tendrá que salir y reiniciar &kdiff3; para que el cambio tenga efecto (esta opción no está disponible en la versión de &kde; de &kdiff3; porque el idioma se ajusta de forma global en las preferencias de &kde;). Ajusta el idioma de la interfaz de usuario. Cambiar esta opción no afectará a la ejecución del programa. Tendrá que salir y reiniciar &kdiff3; para que el cambio tenga efecto (esta opción no está disponible en la versión de KDE; de &kdiff3; porque el idioma se ajusta de forma global en las preferencias de KDE). Usar la misma codificación para todo:Usar la misma codificación para todo: Codificación local:Codificación local: Codificación de archivo para A/B/C:Codificación de archivo para A/B/C: Codificación de archivo para la salida de la fusión y guardar:Codificación de archivo para la salida de la fusión y guardar: Codificación de archivo para los archivos del preprocesador:Codificación de archivo para los archivos del preprocesador: Idioma de derecha a izquierda:Idioma de derecha a izquierda:Algunos idiomas se escriben de derecha a izquierda. Cuando esta opción está activada, &kdiff3; dibuja el texto de derecha a izquierda en las ventanas de entrada de diff y en la ventana de la salida del fusionado. Tenga en cuenta que si inicia &kdiff3; con la opción de línea de órdenes toda la distribución se hará de derecha a izquierda también (ésta es una característica proporcionada por &Qt;). Este manual se escribió asumiendo que «Idioma de derecha a izquierda» o invertir distribución están desactivados. Por ello, algunas referencias a «izquierda» o «derecha» se reemplazarán por sus respectivas homólogas si utiliza estas opciones. Algunos idiomas se escriben de derecha a izquierda. Cuando esta opción está activada, &kdiff3; dibuja el texto de derecha a izquierda en las ventanas de entrada de diff y en la ventana de la salida del fusionado. Tenga en cuenta que si inicia &kdiff3; con la opción de línea de órdenes «--reverse» toda la distribución se hará de derecha a izquierda también (ésta es una característica proporcionada por Qt). Este manual se escribió asumiendo que «Idioma de derecha a izquierda» o invertir distribución están desactivados. Por ello, algunas referencias a «izquierda» o «derecha» se reemplazarán por sus respectivas homólogas si utiliza estas opciones. @@ -1288,8 +1430,8 @@ Mostrar números de líneas:Mostrar números de líneas: Mostrar caracteres espacio y tabulador por diferencias:Mostrar caracteres espacio y tabulador por diferencias: Mostrar espacio en blanco:Mostrar espacio en blanco:Desactívelo para suprimir cualquier resaltado o cambio de «solo espacio en blanco» en el texto o en las columnas de vista general (tenga en cuenta que ésto también se aplicará a los cambios en los números y comentarios si están activadas las opciones Ignorar números o «Ignorar comentarios C/C++»).Desactívelo para suprimir cualquier resaltado o cambio de «solo espacio en blanco» en el texto o en las columnas de vista general (tenga en cuenta que ésto también se aplicará a los cambios en los números y comentarios si están activadas las opciones «Ignorar números» o «Ignorar comentarios C/C++»). Opciones de la vista general:Opciones de la vista general:Estas elecciones están disponibles cuando compara tres archivos. En el modo normal todas las diferencias se muestra en un color codificado en la columna de vista general. Pero algunas veces puede estar interesado en las diferencias entre solo dos de los tres archivos. Seleccionando vista A vs. B, A vs. C o B vs. C se mostrará una segunda columna de vista general con la información requerida situado al lado de la visión general normal. Estas elecciones están disponibles cuando compara tres archivos. En el modo normal todas las diferencias se muestra en un color codificado en la columna de vista general. Pero algunas veces puede estar interesado en las diferencias entre solo dos de los tres archivos. Seleccionando vista «A vs. B», «A vs. C» o «B vs. C» se mostrará una segunda columna de vista general con la información requerida situado al lado de la visión general normal. Ajuste de palabras en las ventanas diff:Ajuste de palabras en las ventanas diff: Mostrar ventana A/B/C:Mostrar ventana A/B/C:Algunas veces deseará utilizar mejor el espacio de la pantalla para las líneas largas. Oculte las ventanas que no sean importantes (en el menú Ventanas).Algunas veces deseará utilizar mejor el espacio de la pantalla para las líneas largas. Oculte las ventanas que no sean importantes (en el menú Ventanas). Cambiar orientación de división:Cambiar orientación de división:Cambia entre las ventanas diff mostrándolas una cerca de la otra (A a la izquierda de B, y a la izquierda de C) o una sobre otra (A sobre B y sobre C). También debería servir de ayuda para las líneas largas (en el menú Ventanas). Cambia entre las ventanas diff mostrándolas una cerca de la otra (A a la izquierda de B, y a la izquierda de C) o una sobre otra (A sobre B y sobre C). También debería servir de ayuda para las líneas largas (en el menú Ventanas). Iniciar fusión rápida:Iniciar fusión rápida: Fusionar el archivo actual en el menú Directorio también funcionará si solo compara dos archivos. Una simple pulsación inicia la fusión y utiliza el nombre de archivo del último archivo de entrada como nombre de archivo predeterminado (cuando se utiliza esto para reiniciar una fusión, se conservará el nombre de archivo de la salida). «Fusionar el archivo actual» en el menú Directorio también funcionará si solo compara dos archivos. Una simple pulsación inicia la fusión y utiliza el nombre de archivo del último archivo de entrada como nombre de archivo predeterminado (cuando se utiliza esto para reiniciar una fusión, se conservará el nombre de archivo de la salida). @@ -1393,13 +1519,7 @@ >Configurar accesos rápidos de teclado En estos momentos solo la versión para &kde; soporta accesos rápidos de teclado configurables por el usuario (PreferenciasConfigurar accesos rápidos...). +>En estos momentos solo la versión para KDE soporta accesos rápidos de teclado configurables por el usuario (Menú Preferencias->Configurar accesos rápidos). @@ -1412,18 +1532,18 @@ Comando del preprocesador:Comando del preprocesador:Cuando se lee cualquier archivo, se redirigirá a través de esta orden externa. Se podrá ver la salida de esta orden en lugar del archivo original. Puede escribir su propio preprocesador que cubra sus necesidades específicas. Utilice esto para cortar determinadas partes del archivo, o para corregir de forma automática el sangrado, &etc;. Cuando se lee cualquier archivo, se redirigirá a través de esta orden externa. Se podrá ver la salida de esta orden en lugar del archivo original. Puede escribir su propio preprocesador que cubra sus necesidades específicas. Utilice esto para cortar determinadas partes del archivo, o para corregir de forma automática el sangrado, etc. Comando de preprocesador de combinación de línea:Comando de preprocesador de combinación de línea:perl harán este trabajo. Ejemplo: Simple comprobación de mayúsculas y minúsculas: Considere el archivo a.txt (6 líneas): -aa -ba -ca -da -eafa - - -Y el archivo b.txt (3 líneas): - -cg -dg -eg - -Sin un preprocesador las siguientes líneas se colocarán unas al lado de las otras: - -aa - cg -ba - dg -ca - eg -da -ea -fa - -Ésto no es lo que probablemente se desee ya que la primera letra contiene la información que es en realidad interesante. Para ayudar al algoritmo de coincidencia a ignorar la segunda letra utilizaremos una orden del preprocesador de líneas coincidentes para reemplazar g con a: - -Ejemplo: Prueba de mayúsculas sencilla: considerar el archivo a.txt (6 líneas): + aa + ba + ca + da + ea + fa + y el archivo b.txt (3 líneas): + cg + dg + eg +Sin un preprocesador las siguientes líneas se situarán unas al lado de otras: + aa - cg + ba - dg + ca - eg + da + ea + fa + Esto no es lo que probablemente lo que se desea ya qu ela primera letra contiene actualmetne la información interesante. Para ayudar al algoritmo de coincidencias a ignorar la segunda letra podemos utilizar una orden de preprocesador, que reemplace «g» con «a»: + sed 's/g/a/' - -Con esta orden el resultado de la comparación sería: - -aa -ba -ca - cg -da - dg -ea - eg -fa - -Internamente el algoritmo de coincidencia ve los archivos después de ejecutar la línea de coincidencia del preprocesador, pero la pantalla del archivo permanecerá sin cambios (el preprocesador normal también cambiará los datos en la pantalla). +> 's/g/a/' + Con esta orden el resultado del a comparación será: + aa + ba + ca - cg + da - dg + ea - eg + fa +Internamente el algoritmo de coincidencia ve los archivos después de la ejecución de la línea del preprocesador de coincidencia, pero en la pantalla el archivo continúa sin cambios (el preprocesador normal cambiará también los datos en la pantalla). Esta sección solo introduce algunas características muy básicas de <command >sed</command ->. Para obtener más información vea <ulink url="info:/sed" +>. Para obtener más información consulte <ulink url="info:/sed" >info:/sed</ulink > o <ulink url="http://www.gnu.org/software/sed/manual/html_mono/sed.html" >http://www.gnu.org/software/sed/manual/html_mono/sed.html</ulink ->. Una versión precompilada para &Windows; puede encontrarse en <ulink url="http://unxutils.sourceforge.net" +>. Una versión precompilada para Windows puede encontrarse en <ulink url="http://unxutils.sourceforge.net" >http://unxutils.sourceforge.net</ulink ->. Tenga en cuenta que los siguientes ejemplo asumen que la orden <command +>. Tenga en cuenta que los siguientes ejemplos asumen que la orden <command >sed</command -> se encuentra en algún directorio definido en la variable de entorno <envar ->PATH</envar ->. Si este no es el caso, deberá especificar la ruta completa absoluta de lo orden. Tenga en cuenta también que los siguientes ejemplos utilizan la comilla simple (<literal ->'</literal ->) que no funciona en &Windows;. En &Windows; debería utilizar las comillas dobles (<literal ->"</literal ->) en su lugar.</para> +> se encuentra en algún directorio definido en la variable de entorno PATH. Si este no es el caso, deberá especificar la ruta completa absoluta de lo orden. </para> +<note +><para +>También debe tener en cuenta que los siguientes ejemplos utilizan una marca de comilla simple (') que no funcionará para Windows. En Windows debería utilizar las marcas de comillas dobles (") en su lugar.</para +></note> <para >En este contexto solo se utiliza la orden de sustitución <command >sed</command ->:</para> -<screen -><command +>: <screen> + <command >sed</command > 's/<replaceable ->EXPRESIÓN-REGULAR</replaceable +>REGEXP</replaceable >/<replaceable >REEMPLAZO</replaceable >/<replaceable ->PARÃMETROS</replaceable ->'</screen> -<para ->Antes de utilizar una orden nueva dentro de &kdiff3;, debería comprobarlo primero en una consola. Aquí la orden <command +>MODIFICADORES</replaceable +>' +</screen +> Antes de utilizar una orden nueva con &kdiff3;, debería comprobarla en una consola. Aquí será práctica la orden <command >echo</command -> es práctica. Ejemplo:</para> - -<screen -><command +>. Ejemplo: <screen> + <command >echo</command > abrakadabra | <command >sed</command > 's/a/o/' -<computeroutput ->obrakadabra</computeroutput -></screen> - -<para ->Este ejemplo muestra una orden sed que tan solo reemplaza la primera aparición de «a» con «o». Si desea reemplazar todas las apariciones necesitará utilizar el parámetro <parameter ->g</parameter ->:</para> - -<screen -><command + -> obrakadabra +</screen +> Este ejemplo muestra una orden sed muy simple que reemplaza la primera aparición de «a» con «o». Si desea reemplazar todas las apariciones necesitará el modificador «g»: <screen> + <command >echo</command > abrakadabra | <command >sed</command > 's/a/o/g' -<computeroutput ->obrokodobro</computeroutput -></screen> - -<para ->El símbolo «<literal ->|</literal ->» es la orden que transfiere la salida de la orden anterior a la entrada de la siguiente orden. Si desea comprobarlo con un archivo largo puede utilizar <command + -> obrokodobro +</screen +> El símbolo «|» es la orden de tubería que transfiere la salida de la orden anterior a la entrada de la siguiente orden. Si desea comprobar el uso con un archivo largo puede utiilzar <command >cat</command -> en los sistemas de tipo Unix o <command +> en los sistemas tipo Unix o <command >type</command -> en los sistemas de tipo &Windows;. <command +> en los sistemas tipo Windows. <command >sed</command -> realiza la sustitución para cada línea.</para> - -<screen +> hará la sustitución para cada línea. <screen ><command >cat</command > <replaceable ->nombre-archivo</replaceable -> |<command +>nombrearchivo</replaceable +> | <command >sed</command > <replaceable >opciones</replaceable -></screen> - - +> +</screen> +</para> </sect2> <sect2 id="sedforkdiff3" ><title ->Ejemplo para la utilización de <command +>Ejemplos para <command >sed</command -> en &kdiff3; +> usados en &kdiff3; Ignorar otros tipos de comentarios En estos momentos &kdiff3; solo entiende los comentarios C/C++. Utilizando la orden del preprocesador de la línea de coincidencias puede ignorar otros tipos de comentarios, convirtiendo los comentarios a C/C++. - - -Para ignorar los comentarios que comiencen con #, podría querer convertirlos en //. Tenga en cuenta que también puede activar las opción Ignorar comentarios C/C++ para que tengan efecto. Una orden de preprocesado podría ser: - -En estos momentos &kdiff3; solo entiende los comentarios C/C++. Utilizando la orden del preprocesado de línea coincidente también puede ignorar otros tipos de comentarios, convirtiéndoles en comentarios C/C++. Ejemplo: Para ignorar los comentarios que comiencen con «#», debería convertirlos a «//». Tenga en cuenta que debe tener activada la opción «Ignorar comentarios C/C++» para que tenga efecto. Una línea de preprocesado de línea coincidente podría ser: + sed 's/#/\/\//' - - - 's/#/\/\//' +Al igual que para sed los caracteres / tienen un significado especial, y es necesarío reemplazar el caracter \ antes de cada / en la cadena de reemplazo. Algunas veces el \ es necesario para añadir o eliminar un significado especial de ciertos caracteres. Las comillas simples (') antes y después de la orden de sustitución son importantes, ya que sino el intérprete de órdenes intentará interpretar algunos caracteres especiales como #, $ o \ antes de pasarlos a el caracter «/» tienen un significado especial, y es necesarío reemplazar el caracter «\» antes de cada «/» en la cadena de reemplazo. Algunas veces el «\» es necesario para añadir o eliminar un significado especial de ciertos caracteres. Las comillas simples (') antes y después de la orden de sustitución son importantes, ya que sino el intérprete de órdenes intentará interpretar algunos caracteres especiales como «#», «$» o «\» antes de pasarlos a sed. Tenga en cuenta que en &Windows; aquí necesitará utilizar las dobles comillas ("). &Windows; sustituye otros caracteres como %, por ello debería experimentar un poquito. +>. Tenga en cuenta que en Windows aquí necesitará utilizar las comillas dobles ("). Windows sustituye otros caracteres como «%», por ello debería experimentar un poquito. - Sensibilidad de diff a mayúsculas y minúsculas - Use la siguiente orden de preprocesado para convertir todas las entradas a mayúsculas: - -Utilice la siguiente orden de preprocesado de coincidencia de línea para convertir todas las entradas a mayúsculas: + sed 's/\(.*\)/\U\1/' - -Aquí el «.*» es una expresión regular que incluye a todos los caracteres en la línea. El \1 en la cadena de reemplazo hace referencia al texto que coincide con el primer par de \( y \). La \U convierte el texto insertado a mayúsculas. +> 's/\(.*\)/\U\1/' +Aquí el «.*» es una expresión regular que incluye a todos los caracteres en la línea. El «\1» en la cadena de reemplazo hace referencia al texto que coincide con el primer par de «\(» y «\)». La «\U» convierte el texto insertado a mayúsculas. CVS y otros sistemas de control de versión utilizan algunas claves para insertar cadenas automáticamente generadas (info:/cvs/Keyword sustitución). Todos ellos siguen el modelo $PALABRA-CLAVE generada texto$. Ahora necesitaremos una orden de preprocesado que elimine solo el texto generado: -). Todos ellos siguen el modelo «$CLAVE generada texto$». Ahora necesitaremos una orden de preprocesado que elimine solo el texto generado: + sed 's/\$\(Revision\|Author\|Log\|Header\|Date\).*\$/\$\1\$/' - -\| separan las posibles palabras clave. Podría querer modificar esta lista de acuerdo a sus necesidades. La \ antes de $ es necesario porque sino el $ coincidiría con el final de la línea. +> 's/\$\(Revision\|Author\|Log\|Header\|Date\).*\$/\$\1\$/' + Las «\|» separan las posibles claves. Podría querer modificar esta lista para acomodarla a sus necesidades. La «\» before the «$» es necesaria porque de otra forma «$» coincidirá con el final de la línea. Mientras experimenta con sedIgnorar números Ignorar los números en realidad es una opción de construcción. Pero como en otros ejemplos, indica el aspecto que podría tener la orden de preprocesado. -Ignorar los números en realidad es una opción de construcción. Pero como en otros ejemplos, indica el aspecto que podría tener la orden de preprocesado. + sed 's/[0123456789.-]//g' -Cualquier caracter situado entre [ y ] será una coincidencia y no se reemplazará con nada. +> 's/[0123456789.-]//g' + Cualquier caracter entre «[» y «]» será una coincidencia y no se reemplazará con nada. Ignorar ciertas columnas Algunas veces una texto tiene un formato muy estricto y contiene columnas que desearía ignorar, mientras que otras columnas deseará conservarlas para el análisis. En el siguiente ejemplo las primeras cinco columnas (caracteres) se ignorarán, las siguientes diez se conservarán, otras cinco se ignorarán y el resto de la línea se conservará. - -Algunas veces una texto tiene un formato muy estricto y contiene columnas que desearía ignorar, mientras que otras columnas deseará conservarlas para el análisis. En el siguiente ejemplo las primeras cinco columnas (caracteres) se ignorarán, las siguientes diez se conservarán, otras cinco se ignorarán y el resto de la línea se conservará. + sed 's/.....\(..........\).....\(.*\)/\1\2/' - -Cada punto . coincide con cualquier caracter. El \1 y \2 en la cadena de reemplazo se refieren al texto coincidente en el primer y segundo par de \( y \) significando el texto conservado. +> 's/.....\(..........\).....\(.*\)/\1\2/' + Cada punto «.» coincidirá con cualquier caracter simple. El «\1» y el «\2» en la cadena de reemplazo hacen referencia al texto coincidente dentro del primer y segundo par de «\(» y «\)» indicando el texto que se conservará. Combinar varias sustituciones - Algunas veces deseará aplicar varias sustituciones a la vez. Puede utilizar el punto y coma ; para separarlas unas de otras. - -Algunas veces deseará aplicar varias sustituciones a la vez. Puede utilizar el punto y coma «;» para separarlas unas de otras. Ejemplo: echo abrakadabra | sed 's/a/o/g;s/\(.*\)/\U\1/' -OBROKODOBRO - + -> OBROKODOBRO + + En lugar de sed puede desear utilizar algo parecido a podría utilizar algo como perl. -. + perl -p -e 's/EXPRESIÓN-REGULAREXPREG/REEMPLAZO/PARÃMETROS' -Pero algunos detalles son diferentes en MODIFICADORES' + Pero algunos detalles son diferentes en perl. Tenga en cuenta que donde . Tenga en cuenta que sed necesita \( y \) necesita «\(» y «\)» perl requiere simplemente ( y ) sin estar precedido de \. - - necesita solo «(» y «)» sin estar precedido de «\». Ejemplo: sed 's/\(.*\)/\U\1/' -perl -p -e 's/(.*)/\U\1/' - +> -p -e 's/(.*)/\U\1/' + + @@ -1860,15 +1844,7 @@ La orden de preprocesado suele ser muy práctica, pero como con cualquier opción que modifique su texto u oculte ciertas diferencias automáticamente, puede saltarse accidentalmente ciertas diferencias y en el peor de los casos destruir datos importantes. Por esta razón durante un fusionado si &kdiff3; utiliza una orden de preprocesado normal le preguntará si desea desactivarla o no. Pero no se producirá ningún aviso si está activada la orden de preprocesado de líneas coincidentes. La fusión no se completará hasta que se resuelvan los conflictos. Si desactiva Mostrar espacios en blanco las diferencias eliminadas con la orden de preprocesado de líneas coincidentes también estarán visibles. Si el botón guardar continúa desactivado durante una fusión (porque aún existen conflictos), asegúrese de activar Mostrar espacios en blanco. Si no desea fusionar estas diferencias sin importancia de forma manual puede elegir Seleccionar [A|B|C] para todos los conflictos de espacios en blanco sin resolver en el menú Fusionar. +>Por esta razón durante un fusionado si &kdiff3; utiliza una orden de preprocesado normal le preguntará si desea desactivarla o no. Pero no se producirá ningún aviso si está activada la orden de preprocesado de líneas coincidentes. La fusión no se completará hasta que se resuelvan los conflictos. Si desactiva «Mostrar espacios en blanco» las diferencias eliminadas con la orden de preprocesado de líneas coincidentes también estarán visibles. Si el botón guardar continúa desactivado durante una fusión (porque aún existen conflictos), asegúrese de activar «Mostrar espacios en blanco». Si no desea fusionar estas diferencias sin importancia de forma manual puede elegir «Seleccionar [A|B|C] para todos los conflictos de espacios en blanco sin resolver» en el menú Fusionar. @@ -1879,11 +1855,11 @@ >Comparación y fusionado de directorios con &kdiff3; Introducción +>Iniciar la comparación y fusión del directorio Frecuentemente los programadores modifican varios archivos en un directorio para conseguir su propósito. Para esto &kdiff3; también le permite comparar y fusionar directorios completos recursivamente. Aunque la comparación y fusionado de directorios parezca bastante obvio, existen varios detalles que debería conocer. Lo más importante es el hecho de la operación podría afectar a muchos archivos. Si no tiene copias de seguridad de los datos originales, podría ser complicado e incluso imposible devolverlos a su estado original. Por lo tanto, antes de realizar un fusionado, asegúrese de guardar sus datos en un lugar seguro, de forma que sea posible volver atrás. Si crea un archivo o utiliza algún sistema de control de versiones es cosa suya, pero los programadores experimentados y los integradores pueden necesitan las antiguas fuentes. Y tenga en cuenta que a pesar de que yo (el autor de &kdiff3;) intento hacerlo lo mejor posible, no garantizo que no existan fallos. De acuerdo con la licencia GNU GPL NO EXISTE NINGUNA GARANTÃA para este programa. Por lo tanto, sea humilde y tenga siempre lo siguiente en mente: +>Aunque la comparación y fusionado de directorios parezca bastante obvio, existen varios detalles que debería conocer. Lo más importante es el hecho de que la operación podría afectar a muchos archivos. Si no tiene copias de seguridad de los datos originales, podría ser complicado e incluso imposible devolverlos a su estado original. Por lo tanto, antes de realizar un fusionado, asegúrese de guardar sus datos en un lugar seguro, de forma que sea posible volver atrás. Si crea un archivo o utiliza algún sistema de control de versiones es cosa suya, pero los programadores experimentados y los integradores pueden necesitan las antiguas fuentes. Y tenga en cuenta que a pesar de que yo (el autor de &kdiff3;) intento hacerlo lo mejor posible, no garantizo que no existan fallos. De acuerdo con la licencia GNU GPL NO EXISTE NINGUNA GARANTÃA para este programa. Por lo tanto, sea humilde y tenga siempre lo siguiente en mente:
Ésto es lo que este programa puede hacer por usted: &kdiff3;... +>Ésto es lo que este programa puede hacer por usted: &kdiff3; ... ... le permite ejecutar las operaciones seleccionadas para todos los elementos (tecla F7) o para el elemento seleccionado (tecla F6).... le permite ejecutar las operaciones seleccionadas para todos los elementos (tecla F7) o para el elemento seleccionado (tecla F6). ... le permite continuar la fusión después de la interacción manual con la tecla F7.... le permite continuar la fusión después de la interacción manual con la tecla F7. ... crea copias de seguridad opcionales, con la extensión .orig.... crea copias de seguridad opcionales, con la extensión «.orig». kdiff3 directorio1 directorio2 -o directorio-destino @@ -1981,13 +1947,11 @@ >kdiff3 directorio1 directorio2 directorio3 -kdiff3 directorio1 directorio2 directorio3 -o directorio-destino @@ -1999,15 +1963,13 @@ > como directorio destino para la fusión. Tenga en cuenta que solo la comparación se inicia automáticamente, no la fusión. Para esto debería seleccionar la entrada de menú o la tecla F7 (más detalles a continuación). +>Tenga en cuenta que solo la comparación se inicia automáticamente, no la fusión. Para esto debería seleccionar la entrada de menú o la tecla F7 (más detalles a continuación).
Información visible +>Información visible del directorio de fusión Mientras lee estos directorios se mostrará un cuadro de diálogo en el que se informará del progreso. Si cancela la exploración del directorio, solo se compararán los archivos listados. Cada archivo y directorio que se encuentre durante la exploración se mostrará aquí en un árbol. Puede seleccionar un elemento pulsando una vez con el ratón. De forma predeterminada los directorios están contraídos. Puede expandirlos y contraerlos pulsando en +/-, con una doble pulsación, o utilizando las teclas Flecha izquierda o Flecha derecha. El menú Directorio también contiene dos acciones Plegar todos los subdirectorios y Desplegar todos los subdirectorios con los que podrá contraer y expandir todos los directorios de una vez. De forma predeterminada los directorios están contraídos. Puede expandirlos y contraerlos pulsando en «+»/«-», con una doble pulsación, o utilizando las teclas Flecha izquierda o Flecha derecha. El menú «Directorio» también contiene dos acciones «Plegar todos los subdirectorios» y «Desplegar todos los subdirectorios» con los que podrá contraer y expandir todos los directorios de una vez. Si hace una doble pulsación sobre un elemento de fichero comenzará la comparación y aparecerá la ventana de diferencias de archivos. La columna Operación Después de comparar los directorios &kdiff3; también evalúa una propuesta para una operación de fusión. Esto se muestra en la columna Operación. Puede modificar la operación pulsando en la operación que desee cambiar. Aparecerá un pequeño menú y le permitirá seleccionar una operación para este elemento (también puede seleccionar las operaciones a través del teclado. Ctrl+1/2/3/4/Supr seleccionarán A/B/C/Fusionar/Borrar respectivamente si están disponibles). Esta operación se ejecutará durante la fusión. La disponibilidad de estas operaciones dependerá del elemento y del modo de fusión. El modo de fusión será uno de los siguientes: +>Después de comparar los directorios &kdiff3; también evalúa una propuesta para una operación de fusión. Esto se muestra en la columna «Operación». Puede modificar la operación pulsando en la operación que desee cambiar. Aparecerá un pequeño menú y le permitirá seleccionar una operación para este elemento (también puede seleccionar las operaciones a través del teclado. Ctrl+1/2/3/4/Supr seleccionarán A/B/C/Fusionar/Borrar respectivamente si están disponibles). Esta operación se ejecutará durante la fusión. La disponibilidad de estas operaciones dependerá del elemento y del modo de fusión. El modo de fusión será uno de los siguientes: Sincronizar dos directorios (activado a través de la opción Sincronizar directorios).Sincronizar dos directorios (activado a través de la opción «Sincronizar directorios»). Todos los directorios son iguales: Copiar desde C.... todos los árboles de directorios son iguales: Copiar desde C.
A y C son iguales pero B no: Copiar desde B (o si B no existe, borra el destino, si existe).... A y C son iguales pero B no: Copiar desde B (o si B no existe, borra el destino, si existe). A y B son iguales pero C no: Copiar desde C (o si C no existe, borra el destino, si existe).... A y B son iguales pero C no: Copiar desde C (o si C no existe, borra el destino, si existe). B y C son iguales pero A no: Copiar desde C (o si C no existe, borra el destino, si existe).... B y C son iguales pero A no: Copiar desde C (o si C no existe, borra el destino, si existe). Solo existe A: Borrar el destino (si existe).... solo existe A: Borrar el destino (si existe). Solo existe B: Copiar desde B.... solo existe B: Copiar desde B. Solo existe C: Copiar desde C.... solo existe C: Copiar desde C. A, B y C no son iguales: Fusionar.... A, B y C no son iguales: Fusionar. A, B y C no tienen el mismo tipo de archivo (⪚ A es un directorio, B es un archivo): Error: Conflicto en los tipos de archivo. Mientras existan elementos como éstos la fusión de directorio no comenzará.... A, B y C no tienen el mismo tipo de archivo (p.ej. A es un directorio, B es un archivo): «Error: Conflicto en los tipos de archivo». Mientras existan elementos como éstos la fusión de directorio no comenzará. Ambos directorios son iguales: Copiar desde B.... ambos directorios son iguales: Copiar desde B. A existe, pero B no: Copiar desde A.... A existe, pero B no: Copiar desde A. B existe, pero no A: Copiar desde B.... B existe, pero no A: Copiar desde B. A y B existe pero no son iguales: Fusionar.... A y B existe pero no son iguales: Fusionar. A y B no tienen el mismo tipo de archivo (⪚ A es un directorio, B es un archivo): Error: Conflicto en los tipos de archivo. Mientras existan de elementos como éstos la fusión de directorio no comenzará.... A y B no tienen el mismo tipo de archivo (p.ej. A es un directorio, B es un archivo): «Error: Conflicto en los tipos de archivo». Mientras existan de elementos como éstos la fusión de directorio no comenzará. El modo de sincronización estará activo si solo existen dos directorios, no se ha especificado destino y está activa la opción Sincronizar directorios. &kdiff3; seleccionará una operación predeterminada de forma que ambos directorios sean idénticos después. Si para un elemento: +>El modo de sincronización estará activo si solo existen dos directorios, no se ha especificado destino y está activa la opción «Sincronizar directorios». &kdiff3; seleccionará una operación predeterminada de forma que ambos directorios sean idénticos después. Si para un elemento ... ambos directorios son iguales: No se hará nada.... ambos directorios son iguales: No se hará nada. A existe, pero B no: copiar A a B.... A existe, pero B no: copiar A a B. B existe, pero A no: Copiar B a A.... B existe, pero A no: Copiar B a A. A y B existen, pero no son iguales: Fusionar y guardar el resultado en ambos directorios (para los usuarios el nombre de archivo guardado es B, pero entonces &kdiff3; copiará B a A).... A y B existen, pero no son iguales: Fusionar y guardar el resultado en ambos directorios (para los usuarios el nombre de archivo guardado es B, pero entonces &kdiff3; copiará B a A). A y B no tienen el mismo tipo de archivo (⪚ A es un directorio, B es un archivo): Error: Conflicto en los tipos de archivo. Mientras existan de elementos como éstos la fusión de directorio no comenzará.... A y B no tienen el mismo tipo de archivo (p.ej. A es un directorio, B es un archivo): «Error: Conflicto en los tipos de archivo». Mientras existan de elementos como éstos la fusión de directorio no comenzará. Cuando se fusionen dos directorios y esté seleccionada la opción Copiar nuevo en lugar de fusionar, &kdiff3; buscará en las fechas y propondrá como elección el nuevo archivo. Si los archivos no son iguales pero tienen las mismas fechas, la operación contendrá Error: Las fechas son iguales pero los archivos no. Mientras éstos elementos existan no se iniciará la fusión de directorios. +>Cuando se fusionen dos directorios y esté seleccionada la opción «Copiar nuevo en lugar de fusionar», &kdiff3; buscará en las fechas y propondrá como elección el nuevo archivo. Si los archivos no son iguales pero tienen las mismas fechas, la operación contendrá «Error: Las fechas son iguales pero los archivos no». Mientras éstos elementos existan no se iniciará la fusión de directorios. La columna estado Durante la fusión se procesará un archivo tras otro. La columna estado mostrará Hecho para los elementos donde se haya producido la operación de fusionado, y otro texto si sucede algo inesperado. Cuando se completa una fusión, debería hacer una última comprobación para ver si el estado de todos los elementos es el adecuado. +>Durante la fusión se procesará un archivo tras otro. La columna estado mostrará «Hecho» para los elementos donde se haya producido la operación de fusionado, y otro texto si sucede algo inesperado. Cuando se completa una fusión, debería hacer una última comprobación para ver si el estado de todos los elementos es el adecuado. Columnas estadísticas Cuando está activado en las opciones el modo de comparación de archivos Análisis completo, &kdiff3; mostrará columnas que contienen el número de conflictos sin resolver, resueltos, no en blanco o de espacios en blanco (la columna resueltos solo se mostrará cuando se comparen o fusionen directorios). +>Cuando está activado en las opciones el modo de comparación de archivos «Análisis completo», &kdiff3; mostrará columnas que contienen el número de conflictos sin resolver, resueltos, no en blanco o de espacios en blanco (la columna resueltos solo se mostrará cuando se comparen o fusionen directorios). + + +Seleccionar archivos listados +Varias opciones influyen en los archivos que se listarán aquí. Algunas son accesibles a través del diálogo preferencias. El menú Directorio contiene las entradas: + «Mostrar archivos idénticos». Archivos que se han detectado como iguales en todos los directorios. + «Mostrar archivos diferentes». Archivos que existen en dos o más directorios pero que no son iguales. + «Mostrar archivos solo en A». Archivos que existen solo en A, pero no en B o C. + «Mostrar archivos solo en B». Archivos que existen solo en B, pero no en A o B. + «Mostrar archivos solo en C». Archivos que existen solo en C, pero no en A o B. + +Active las opciones «Mostrar» para los elementos que desee listar. Si por ejemplo solo desea listar todos los elementos que existan en A o en B pero no en ambos, deberá activar «Mostrar archivos solo en A» y «Mostrar archivos solo en B» y desactivar todas las demás («Mostrar archivos idénticos», «Mostrar archivos diferentes», «Mostrar archivos solo en C»). La lista se actualizará inmediatamente para reflejar los cambios. Estas opciones también se aplican para los directorio con una excepción: Desactivar «Mostrar archivos diferentes» no ocultará ningún directorio. Solo funcionará para los archivos que contenga. Tenga en cuenta que de estas opciones solo es persistente la opción «Mostrar archivos idénticos». Los otros se activarán cuando se inicie &kdiff3;. @@ -2259,7 +2226,7 @@ Hacer una fusión +>Hacer una fusión de directorios Puede fusionar el elemento seleccionado (archivo o directorio) o todos los elementos. Cuando haya hecho todas sus operaciones de elección (en todos los subdirectorios también) podrá iniciar la fusión. Directorios recursivos: Si está desactivado, no se buscarán los elementos de los directorios.«Directorios recursivos»: Si está desactivado, no se buscarán los elementos de los directorios. Patrón/Anti-patrón: Incluir/excluir elementos que coincidan.«Patrón»/«Anti-patrón»: Incluir/excluir elementos que coincidan. Excluir archivos ocultos.«Excluir archivos ocultos» Listar solo deltas: Los archivos que coincidan en todos los directorios no aparecerán en el árbol, de ahí que no aparezcan en el destino.«Mostrar» opciones (Mostrar archivos idénticos/diferentes, archivos solo en A/B/C) (En la versión actual, debería volverlo a explorar por sí mismo a través del menú DirectorioVolver a buscar, después de cambiar opciones que afecten al directorio explorado). Si cambia las preferencias para listar más archivos, debería volver a buscar a través del menú «Directorio»->«Volver a buscar» (el motivo es que para realizar una comparación rápida &kdiff3; omite la comparación para los archivos suprimidos por este criterio). Si cambia sus patrones de archivo y directorio de exclusión de archivos, la lista de archivos se actualizará inmediatamente al cerrar el diálogo de las opciones. Tenga en cuenta que cuando escribe un nuevo directorio completo también deseará copiar los archivos idénticos. En este caso active la opción «Mostrar archivos idénticos». Si su directorio de destino es una de las entradas, ésto no será necesario ya que el archivo ya estará aquí. Si está satisfecho con ésto, el resto es sencillo. Para fusionar todos los elementos: Seleccione Comenzar/continuar fusión de directorio en el menú Directorio o pulse F7 (que es el acceso rápido). Para fusionar solo el elemento actual: Seleccione Realizar operación para el elemento actual o pulse F6. Para fusionar todos los elementos: Seleccione «Comenzar/continuar fusión de directorio» en el menú «Directorio» o pulse F7 (que es el acceso rápido). Para fusionar solo el elemento actual: Seleccione «Realizar operación para el elemento actual» o pulse F6. Si debido a tipos de archivos conflictivos todavía continúan existiendo operaciones no válidas, aparecerá un mensaje señalándolo, de forma que pueda seleccionar una operación válida para este elemento. Si fusiona todos los elementos aparecerá un diálogo proporcionándole las opciones Hacer, Simular y Cancelar. +>Si fusiona todos los elementos aparecerá un diálogo proporcionándole las opciones «Hacer», «Simular» y «Cancelar». Seleccione Simular si desea ver el resultado sin hacer la fusión. Se mostrará un lista de todas las operaciones.Seleccione «Simular» si desea ver el resultado sin hacer la fusión. Se mostrará un lista de todas las operaciones. Sino seleccione Hacer para realizar el fusionado.Sino seleccione «Hacer» para realizar el fusionado. vea la gran captura de pantalla). Cuando haya terminado con un archivo, seleccione de nuevo Comenzar/continuar fusión de directorio o la tecla F7. Si todavía no la había guardado, un diálogo le preguntará para hacerlo. Entonces &kdiff3; continuará con el siguiente elemento. Cuando haya terminado con un archivo, seleccione de nuevo «Comenzar/continuar fusión de directorio» o la tecla F7. Si todavía no la había guardado, un diálogo le preguntará para hacerlo. Entonces &kdiff3; continuará con el siguiente elemento. Cuando &kdiff3; encuentre un error, éste se lo indicará con información literal del estado. En la parte inferior de la lista, aparecerán algunos mensajes de error que deberían ayudarle a entender la causa del problema. Cuando continúe con la fusión (tecla F7) &kdiff3; le permitirá reintentar o saltarse el elemento que provocó el problema. Esto significa que antes de continuar puede seleccionar otra operación o resolver el problema por otros medios. Cuando &kdiff3; encuentre un error, éste se lo indicará con información literal del estado. En la parte inferior de la lista, aparecerán algunos mensajes de error que deberían ayudarle a entender la causa del problema. Cuando continúe con la fusión (tecla F7) &kdiff3; le permitirá reintentar o saltarse el elemento que provocó el problema. Esto significa que antes de continuar puede seleccionar otra operación o resolver el problema por otros medios. Cuando la fusión se haya completado, &kdiff3; le informará a través de un cuadro de diálogo. Si algunos elementos se fusionaron de forma individual &kdiff3; lo recordará (mientras esté en esta sesión de fusionado), y no les fusionará nuevamente cuando haga la fusión para todos los elementos. Incluso cuando se salte la fusión o no se guarde nada estos elementos se contarán como completos. Solo cuando cambie la operación de fusión el elemento se fusionará de nuevo. +>Si algunos elementos se fusionaron de forma individual &kdiff3; lo recordará (mientras esté en esta sesión de fusionado), y no les fusionará nuevamente cuando haga la fusión para todos los elementos. Incluso cuando se salte la fusión o no se guarde nada estos elementos se contarán como completos. Solo cuando cambie la operación de fusionado se eliminará el estado «hecho» del elemento y se podrá fusionar de nuevo. Opciones para comparación y fusión de directorios Las preferencias de &kdiff3; (menú PreferenciasConfigurar KDiff3) ahora tienen una sección llamada Fusión de directorio con estas opciones: +>Las preferencias de &kdiff3; (menú «Preferencias»->«Configurar &kdiff3;») ahora tienen una sección llamada «Fusión de directorio» con estas opciones: Directorios recursivos:Directorios recursivos: Patrón(es) de archivo(s):Patrón(es) de archivo(s):Solo los archivos que coincidan con el patrón se colocarán en el árbol. Puede especificarse más de un patrón utilizando el punto y coma ; como separador. Comodines válidos: * y ? (⪚ *.cpp;*.h). El valor predeterminado es *. Los directorios no necesitan coincidir con este patrón.Solo los archivos que coincidan con el patrón se colocarán en el árbol. Puede especificarse más de un patrón utilizando el punto y coma «;» como separador. Comodines válidos: «*» y «?» (p. ej. «*.cpp;*.h»). El valor predeterminado es «*». Este patrón no se utiliza en directorios. Anti-Patrón(es):Anti-patrón(es) de archivo:Los archivos y directorios que coincidan con este patrón se excluirán del árbol. Se puede especificar más de un patrón utilizando el ; como separador. Comodines válidos: * y ?. El valor predeterminado es *.orig;*.o.Los archivos y directorios que coincidan con este patrón se excluirán del árbol. Se puede especificar más de un patrón utilizando el «;» como separador. Comodines válidos: «*» y «?». El valor predeterminado es «*.orig;*.o;*.obj». Usar .cvsignore:Anti-patrón(es) de direcctorio:Ignora los archivos y directorios que también se vayan a ignorar por el CVS. Muchos archivos generados automáticamente se ingorarán por el CVS. La gran ventaja es que puede ser un directorio especificado a través del archivo local .cvsignore (vea Los archivos y directorios que coincidan con este patrón se excluirán del árbol. Se puede especificar más de un patrón utilizando el «;» como separador. Comodines válidos: «*» y «?». El valor predeterminado es «CVS;deps;.svn». + Usar .cvsignore:Ignora los archivos y directorios que también se vayan a ignorar por el CVS. Muchos archivos generados automáticamente se ingorarán por el CVS. La gran ventaja es que puede ser un directorio especificado a través del archivo local «.cvsignore» (vea info:/cvs/cvsignore). Buscar archivos y directorios ocultos:Buscar archivos y directorios ocultos:En algunos sistemas de archivos tienen un atributo «Oculto». En otros sistemas el nombre de archivo comienza con un punto (.), lo que hace que esté oculto. Esta opción le permite decidir si incluir o no estos archivos en el árbol. De forma predeterminada está activado.En algunos sistemas de archivos tienen un atributo «Oculto». En otros sistemas el nombre de archivo comienza con un punto («.»), lo que hace que esté oculto. Esta opción le permite decidir si incluir o no estos archivos en el árbol. De forma predeterminada está activado. Seguir enlaces de archivos:Seguir enlaces de archivos: Seguir enlaces de directorios:Seguir enlaces de directorios:Para los enlaces de los directorios: Cuando esté desactivado se compararán los enlaces simbólicos. Cuando esté activado, el enlace será tratado como un directorio y se explorará recursivamente (tenga en cuenta que el programa no comprueba si el enlace es «recursivo»). Así por ejemplo, un directorio que contenga un enlace al directorio puede provocar un bucle infinito, y después de cierto tiempo podrá sobrecargar la pila o utilizar toda la memoria, colgando el programa). De forma predeterminada está desactivada. +>
Listar solo deltas:Comparación de nombres de archivo sensible a mayúsculas y minúsculas:Solo los elementos que no sean iguales en todos los directorios de entrada se listarán y solo los cambios de los archivos serán visibles. De ahí que los archivos que sean iguales en todos los directorios no se compiarán durante una fusión y si el directorio de destino no contiene los archivos antes de la fusión, podría omitir algunos archivos posteriormente (probablemente esta opción se cambiará en una versión posterior). De forma predeterminada está desactivada.El valor predeterminado es false (falso) para Windows, true (verdadero) para otros sistemas operativos. - Modo de comparación de archivos:Modo de comparación de archivos: @@ -2496,8 +2399,8 @@ > Comparación binaria:Comparación binaria: Análisis completo:Análisis completo: Validar la fecha de modificación:Validar la fecha de modificación: Validar el tamaño:Validar el tamaño:Sincronizar directorios:Sincronizar directorios: Copiar el más nuevo en vez de fusionar:Copiar el más nuevo en vez de fusionar: Archivos de copia de seguridad:Archivos de copia de seguridad:Si se reemplaza un archivo o directorio por otro o se borra, la versión original se renombrará con una extensión .orig. Si ya existía un archivo con la extensión .orig se borrará sin hacer copia de seguridad. También afecta al fusionado normal de archivos simples, no solo al modo de fusionado de directorio. De forma predeterminada estará activada.Si se reemplaza un archivo o directorio por otro o se borra, la versión original se renombrará con una extensión «.orig». Si ya existía un archivo con la extensión «.orig» se borrará sin hacer copia de seguridad. También afecta al fusionado normal de archivos simples, no solo al modo de fusionado de directorio. De forma predeterminada estará activada.
@@ -2580,41 +2479,33 @@ Otras funciones +>Otras funciones en la ventana del directorio de fusión Modo de pantalla dividida/completa Normalmente la vista de la lista de fusionado de directorios permanece visible cuando se compara o fusiona un solo archivo. Con el ratón puede mover la barra divisoria que separa la lista de archivos de las ventanas de texto diff. Sino desea ésto, puede desactivar la Vista de pantalla dividida en el menú Directorio. A continuación utilice Cambiar vista en el menú Directorio para conmutar entre la lista de archivos y la ventana de texto diff que ocupará la pantalla completa. +>Normalmente la vista de la lista de fusionado de directorios permanece visible cuando se compara o fusiona un solo archivo. Con el ratón puede mover la barra divisoria que separa la lista de archivos de las ventanas de texto diff. Sino desea ésto, puede desactivar la «Vista de pantalla dividida» en el menú «Directorio». A continuación utilice «Cambiar vista» en el menú «Directorio» para conmutar entre la lista de archivos y la ventana de texto diff que ocupará la pantalla completa. Comparar o fusionar un solo archivo Probablemente preferirá una doble pulsación del ratón sobre un archivo para compararlos. Sin embargo existe una entrada en el menú Directorio. También puede fusionar directamente un solo archivo, sin iniciar el fusionado del directorio a través de la opción Fusionar un solo archivo en el menú Directorio. Al guardar el resultado, el estado cambiará a «hecho», y el archivo no se fusionará si se inicia un fusionado de directorio. Probablemente preferirá una doble pulsación del ratón sobre un archivo para compararlos. Sin embargo existe una entrada en el menú «Directorio». También puede fusionar directamente un solo archivo, sin iniciar el fusionado del directorio a través de la opción «Fusionar un solo archivo» en el menú «Directorio». Al guardar el resultado, el estado cambiará a «hecho», y el archivo no se fusionará si se inicia un fusionado de directorio. Pero tenga en cuenta que la información del estado se perderá cuando vuelva a explorar un directorio: DirectorioVolver a buscar. +>Pero tenga en cuenta que la información del estado se perderá cuando vuelva a explorar un directorio: Menú «Directorio»->«Volver a buscar». +Comparar o fusionar archivos con nombres diferentes +Algunas veces necesitará comparar o fusionar archivos con nombres diferentes (p. ej. el archivo actual y la copia de seguridad en la misma carpeta). Seleccione el archivo exacto pulsando en el icono en la columna A, B o C. El primer archivo seleccionado se marcará con una «A», el segundo y tercero con «B» y «C» con independencia de la columna en la que esté. Solo se podrá seleccionar en la parte superior de los árboles de archivos. Seleccione «Comparar explícitamente archivos seleccionados» o «Fusionar explícitamente archivos seleccionados» desde el menú «Directorio». Estas entradas también aparecerán como menú contextual cuando pulse el botón derecho cuando pulse el último archivo seleccionado. La comparación o fusión de un archivo se realizará en la misma ventana. Si este método se utiliza para directorios se abrirá una ventana nueva. @@ -2623,12 +2514,12 @@ >Temas variados Transparencia de red a través de KIO +>Transferencia de red a través de KIO KIO-Slaves &kde; soporta transparencia de red a través de los KIO-slaves. &kdiff3; lo utiliza para leer los archivos de entrada y para explorar directorios. Esto significa que puede especificar archivos y directorios locales y en recursos remotos a través de &URL;s. KDE soporta transparencia de red a través de los KIO-slaves. &kdiff3; lo utiliza para leer los archivos de entrada y para explorar directorios. Esto significa que puede especificar archivos y directorios locales y en recursos remotos a través de URLs. Ejemplo: @@ -2642,7 +2533,7 @@ La primera línea compara un archivo local con un archivo en un servidor &FTP;. La segunda línea compara un directorio con un archivo comprimido con un directorio local. La primera línea compara un archivo local con un archivo en un servidor FTP. La segunda línea compara un directorio con un archivo comprimido con un directorio local. Otros KIO-slaves interesantes son: @@ -2683,27 +2574,21 @@ Cómo escribir &URL;s +>Cómo escribir URLs Una &URL; tiene una sintaxis diferente comparada con las rutas de los archivos y directorios locales. Algunas cosas a considerar son: +>Una URL tiene una sintaxis diferente comparada con las rutas de los archivos y directorios locales. Algunas cosas a considerar son: Una ruta puede ser relativa y puede contener . o .. Ésto no es posible para &URL;s que son siempre absolutas. Una ruta puede ser relativa y puede contener «.» o «..» Ésto no es posible para URLs que son siempre absolutas. Los caracteres especiales deben escribirse «escapados» («#» se convertirá en «%23», los espacios se convertirán en «%20» y así sucesivamente). ⪚ Un archivo con el nombre «/#foo#» tendrá la &URL; file:///%23foo%23. Los caracteres especiales deben escribirse «escapados» («#» se convertirá en «%23», los espacios se convertirán en «%20» y así sucesivamente). P.ej. Un archivo con el nombre «/#foo#» tendrá el URL «file:///%23foo%23». Cuando una &URL; no funcione tal y como esperaba, intente abrirla primero en &konqueror;. Cuando un URL no funcione tal y como esperaba, intente abrirla primero en Konqueror. @@ -2745,29 +2630,15 @@ Utilizar &kdiff3; como un KPart &kdiff3; es un KPart. Actualmente implementa la interfaz KParts::ReadOnlyPart. KDiff3 es un KPart. Actualmente implementa la interfaz KParts::ReadOnlyPart-interface. Su principal utilización es la de visor de diferencias en KDevelop. KDevelop siempre inicia primero el visor interno de diferencias. Para llamar a &kdiff3; pulse el &RMB; en la ventana de diferencias y seleccione Mostrar en KDiff3Part en el menú contextual. Su principal utilización es la de visor de diferencias en KDevelop. KDevelop siempre inicia primero el visor interno de diferencias. Para llamar a &kdiff3; pulse el botón derecho del ratón en la ventana de diferencias y seleccione «Mostrar en KDiff3Part» en el menú contextual. &kdiff3; normalmente requiere dos archivos completos como entrada. Cuando se utiliza como una parte &kdiff3; asume que el archivo de entrada es un archivo de parches en formato unificado. &kdiff3; recupera el nombre del archivo original del archivo del parche. Al menos uno de los dos archivos debe estar disponible. &kdiff3; llamará a patch para volver a crear el segundo archivo. En &konqueror; puede seleccionar un archivo de parche y seleccionar Previsualizar enKDiff3Part desde el menú contextual. Sea consciente de que esto no funcionará si no está disponible ninguno de los archivos originales, y no será fiable si hubo modificaciones en el(los) archivo(s) original(es) desde que se generó el parche. En Konqueror puede seleccionar un archivo de parche y seleccionar «Previsualizar en» - «KDiff3Part» desde el menú contextual. Sea consciente de que esto no funcionará si no está disponible ninguno de los archivos originales, y no será fiable si hubo modificaciones en el(los) archivo(s) original(es) desde que se generó el parche. Cuando se ejecute como una parte, &kdiff3; solo proporcionará la diferencia de dos archivos, una pequeñísima barra de herramientas y un menú. La fusión y comparación de directorios no está soportada. @@ -2781,32 +2652,22 @@ ¿Por qué se llama &kdiff3;? ¿Por qué se llama «&kdiff3;»? Las herramientas llamadas KDiff y KDiff2 (ahora llamada &kompare;) ya existen. Por tanto &kdiff3; debería sugerir que incluye la fusión de forma similar a la herramienta diff3 de la colección de herramientas Diff. Las herramientas llamadas «KDiff» y «KDiff2» (ahora llamada «Kompare») ya existen. Por tanto «KDiff3» debería sugerir que incluye la fusión de forma similar a la herramienta «diff3» de la colección de herramientas Diff. ¿Por qué la he liberado bajo la GPL? ¿Por qué la he liberado bajo la GPL? He utilizado programas GPL durante mucho tiempo y aprendí mucho echando un vistazo a muchas fuentes. Ésta es mi forma de dar las «gracias» a todos programadores que han hecho lo mismo. He utilizado programas GPL durante mucho tiempo y aprendí mucho echando un vistazo a muchas fuentes. Ésta es mi forma de dar las «gracias» a todos programadores que han hecho lo mismo. @@ -2817,15 +2678,7 @@ >Compiló las fuentes, pero probablemente no especificó de forma correcta el parámetro «prefix» de &kde; en configure. De forma predeterminada configure intentará instalarlo en /usr/local pero &kde; no encuentra el archivo de recursos de la interfaz de usuario (&ie;, kdiff3ui.rc). El archivo README contiene más información sobre el parámetro «prefix» correcto. Compiló las fuentes, pero probablemente no especificó de forma correcta el parámetro «prefix» de KDE en configure. De forma predeterminada configure intentará instalarlo en /usr/local pero KDE no encuentra el archivo de recursos de la interfaz de usuario (p.ej. kdiff3ui.rc). El archivo README contiene más información sobre el parámetro «prefix» correcto. @@ -2836,7 +2689,9 @@ >Las líneas que solo contienen una cantidad diferente de espacios se tratan «igual» al principio, de forma que solo una diferencia en un caracter que no sea un espacio en blanco hará que las líneas sean «diferentes». Si aparecen líneas similares unas al lado de las otras, en realidad es una coincidencia, y sucede algunas veces. Las líneas que solo contienen una cantidad diferente de espacios se tratan «igual» al principio, de forma que solo una diferencia en un caracter que no sea un espacio en blanco hará que las líneas sean «diferentes». Si aparecen líneas similares unas al lado de las otras, en realidad es una coincidencia, y sucede algunas veces. Consulte el manual de ayuda de Diff. @@ -2854,6 +2709,19 @@ Cómo puedo sincronizar las vista de diferencia y de fusión, de forma que todas muestren la misma posición de texto? Pulse en la columna de resumen situada a la izquierda del texto (Consulte también estó.) + +¿Por qué el editor en la ventana de resultado no tiene una función «deshacer»? Puedo utilizar &kdiff3; para comparar archivos OpenOffice.Org, Word, Excel, Pdf, &etc;? A pesar de que &kdiff3; analizará cualquier tipo de archivo el resultado no será satisfactorio. &kdiff3; se creó para comparar archivos de texto puro. OpenOffice, Word, Excel, etc. guardan mucha más información en los archivos (relativa a tipos de letra, imágenes, páginas, colores, etc.) con la que &kdiff3; no sabe qué hacer. Por tanto &kdiff3; le mostrará el contenido del archivo interpretado como si fuera texto puro, pero esto no es para lo que se utiliza. Desde que muchos programa guardan su contenido en formato XML, puede ser capaz de leer éste como texto puro. Por tanto si el cambio es pequeño, &kdiff3; todavía puede ayudarle. La mejor solución si solo desea comparar texto (sin objetos empotrados como imágenes) es utilizar «Seleccionar todo» y «Copiar» en su programa para copiar el texto interesante al portapapeles y a continuación pegar en &kdiff3; el texto en cualquiera de las ventanas de diferencias (Consulte también Seleccionar, copiar y pegar). + +¿Donde está la opción de directorio «Listar solo deltas»? Ahora existen varias opciones «Mostrar» en el menú directorio. Desactivar «Mostrar archivos idénticos» activará «Listar solo deltas» + +¿Cómo puedo realizar una selección grande en la ventana de entrada de diferencias sin tardar demasiado tiempo? Inicie la selección de la forma habitual (pulse y mantenga pulsado el botón izquierdo del ratón). A continuación utilice las teclas de navegación (p.ej. RéPag, AvPág) manteniendo pulsado el botón izquierdo del ratón (consulte también Seleccionar, copiar y pegar). + +Aquí hay mucha información, pero ¿su pregunta no está respondida? &kdiff3; - Herramienta de comparación y fusionado de archivos y directorios. Programa copyright 2002-2005 Joachim Eibl joachim.eibl@gmx.de. +>Program copyright 2002-2005 Joachim Eibl joachim.eibl at gmx.de Algunas buenas ideas e informes de fallos me llegaron de colegas y de mucha gente a lo largo de la red ¡Gracias! Documentación Copyright © 2002-2005 Joachim Eibl joachim.eibl@gmx.de. +>Documentation Copyright © 2002-2005 Joachim Eibl joachim.eibl at gmx.de Traducido por Santiago Fernández Sancho santi@est.unileon.essanti@kde-es.org. &underFDL; &underGPL; @@ -2949,21 +2862,62 @@ Para utilizar adecuadamente todas las características de &kdiff3;, necesitará &kde; 3.1 o superior. Para obtener información sobre cómo ejecutar &kdiff3; en otras plataformas sin &kde; vea la Para obtener información sobre cómo ejecutar &kdiff3; en otras plataformas sin KDE vea la página principal. Puede encontrar una lista de cambios en http://kdiff3.sourceforge.net/ChangeLog o en el archivo ChangeLog del paquete fuente. +> o en el archivo «ChangeLog» del paquete fuente. Compilación e instalación -&install.compile.documentation; + +Para compilar en instalar &kdiff3; en un sistema con KDE, teclee lo siguiente en el directorio base de la distribución de &kdiff3;: + +% ./configure --prefix=kde-dir +% make +% make install + +kde-dir especifica el directorio que contiene KDE en su sistema. Sino está seguro, lea el archivo README para obtener los detalles. +Sino utiliza KDE utilice configure pero siga las instrucciones para los sistemas que solo tienen Qt en el archivo README. +Puesto que &kdiff3; utiliza autoconf y automake no debería tener problemas para compilarlo. Si tiene problemas al ejecutarlo, por favor, informe de ello a las listas de correo de &kde;. + + + &documentation.index; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/doc/pt/index.docbook --- a/kdiff3/doc/pt/index.docbook Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/doc/pt/index.docbook Sat Nov 04 00:05:00 2006 +0000 @@ -11,21 +11,26 @@ + + O Manual do &kdiff3; Joachim Eibl
joachim.eibl at gmx.de +>joachim.eibl at gmx.de +
+
PedroTradução -
20022005 +>2002-2006 Joachim Eibl + + &FDLNotice; + + 2005-01-30 +>2006-05-14 0.9.87 +>0.9.90 + &kdiff3; is a file and directory diff and merge tool which: +>O &kdiff3; é uma ferramenta de diferenças e junção das mesmas para ficheiros e pasta que compara e junta dois ou três ficheiros de texto ou pastas de entrada, supports Unicode, UTF-8 and other file encodings.suporta o Unicode, o UTF-8 e outras codificações de ficheiros, +imprime as diferenças, +suporta as palavras-chave de controlo de versões e de junção do histórico. - +Este documento descreve o &kdiff3; versão 0.9.89. + + KDE @@ -147,35 +174,23 @@ >Outra Interface para o Diff? Existem várias ferramentas de detecção de diferenças. Porquê escolher o &kdiff3;? Deixe que o autor diga porque o escreveu. - -&kdiff3; started because I had to do a difficult merge. Merging is necessary when several people work on the same files in a project. A merge can be somewhat automated, when the merge-tool not only has the new modified files (called branches), but also the original file (called base). The merge tool will automatically choose any modification that was only done in one branch. When several contributors change the same lines, then the merge tool detects a conflict which must be solved manually. - -"A junção foi então difícil porque um dos colaboradores alterou várias coisas e corrigiu a indentação em vários sítios. Outro também alterou bastante texto, o que resultou em vários conflitos de junção". - -"A ferramenta que usei então só mostrava as linhas modificadas, mas não o que tinha sido alterado dentro dessas linhas. E não havia nenhuma informação sobre os locais em que só a indentação tinha sido alterada. A junção foi um pequeno pesadelo por isso". - -"Daí, foi este o início. A primeira versão podia mostrar as diferenças dentro de uma linha e mostrava as diferenças de espaços em branco. Depois, muitas outras funcionalidades foram adicionada para aumentar a utilidade". - -"Por exemplo, se você quiser comparar algum texto rapidamente, então poderá copiá-lo para a área de transferência e colá-lo noutra janela de diferenças". - -"Uma funcionalidade que necessitou de um grande esforço foi a comparação de pastas e a funcionalidade de junção, o que transformou o programa quase num navegador de ficheiros completo". - -Espero que o &kdiff3; funcione para si também. Divirta-se! - -Joachim Eibl (2003) +>Existem várias ferramentas de detecção de diferenças. Porquê escolher o &kdiff3;? Deixe que o autor diga porque o escreveu. O &kdiff3; começou porque eu tinha de fazer uma junção difícil. A junção é necessária quando várias pessoas trabalham nos mesmos ficheiros de um projecto. Uma junção poderá de alguma forma ser automatizada, quando a ferramenta de junção não só tem os novos ficheiros modificados (chamados de 'ramificações' ou 'branches'), mas também o ficheiro original (chamado de 'base'). A ferramenta de junção irá escolher automaticamente as modificações que só foram feitas numa das ramificações. Quando vários contribuintes alteram as mesmas linhas, então a ferramenta de junção detecta um conflito que terá de ser resolvido manualmente. "A junção foi então difícil porque um dos colaboradores alterou várias coisas e corrigiu a indentação em vários sítios. Outro também alterou bastante texto, o que resultou em vários conflitos de junção". "A ferramenta que usei então só mostrava as linhas modificadas, mas não o que tinha sido alterado dentro dessas linhas. E não havia nenhuma informação sobre os locais em que só a indentação tinha sido alterada. A junção foi um pequeno pesadelo por isso". "Daí, foi este o início. A primeira versão podia mostrar as diferenças dentro de uma linha e mostrava as diferenças de espaços em branco. Depois, muitas outras funcionalidades foram adicionada para aumentar a utilidade". "Por exemplo, se você quiser comparar algum texto rapidamente, então poderá copiá-lo para a área de transferência e colá-lo noutra janela de diferenças". "Uma funcionalidade que necessitou de um grande esforço foi a comparação de pastas e a funcionalidade de junção, o que transformou o programa quase num navegador de ficheiros completo". Espero que o &kdiff3; funcione para si também. Divirta-se! Joachim Eibl (2003) 3-way-merging is fully supported. This is useful if two people change code independently. -The original file (the base) is used to help &kdiff3; to automatically select the correct changes. -The merge-editor below the diff-windows allows you to solve conflicts, while showing you the output you will get. -You can even edit the output. - -This screenshot shows three input files being merged: - +>A junção por 3-vias é suportada por completo. Isto é útil se duas pessoas alterarem o código independentemente. O ficheiro original (a base) é usado para ajudar o &kdiff3; a seleccionar automaticamente as alterações correctas. O editor de junções por baixo das janelas de diferenças permite-lhe resolver os conflitos, enquanto lhe mostra o resultado que você irá obter. Até poderá editar o resultado. Esta imagem mostra três ficheiros de entrada a serem reunidos: + O &kdiff3; também o ajuda a comparar e a juntar pastas completas. Esta imagem mostra o &kdiff3; durante a junção de pastas: - +>O &kdiff3; também o ajuda a comparar e a juntar pastas completas. Esta imagem mostra o &kdiff3; durante a junção de pastas: - + Visualizador de Diferenças Linha-a-Linha e Carácter-a-Carácter - Usando as possibilidades de um ambiente gráfico a cores, o &kdiff3; mostra exactamente o que é a diferença. Quando tiver de fazer várias revisões de código, irá gostar disto. - +>Usando as possibilidades de um ambiente gráfico a cores, o &kdiff3; mostra exactamente o que é a diferença. Quando tiver de fazer várias revisões de código, irá gostar disto. Ver as Diferenças de Espaços em Branco de uma Vez Os espaços e as tabulações que são diferentes aparecem visivelmente. Quando as linhas diferem apenas pelo número de espaços em branco, isto poderá ser visto num instante se olhar para a coluna do resumo do lado esquerdo. (Não há mais problemas quando as pessoas mudam a indentação). - Search for strings in all text windows. Find (&Ctrl;F) and Find Next (F3)Procurar por sequências de texto em todas as janelas de texto. Procurar (Ctrl-F) e Procurar o Seguinte (F3). Suporte para as línguas escritas da direita-para-esquerda. + ... @@ -360,7 +362,7 @@ Documentation of File Comparison And Merge +>Comparação e Junção de Ficheiros kdiff3</command > <replaceable >ficheiro1 ficheiro2</replaceable -></screen> +> +</screen> </sect2> <sect2 @@ -384,18 +387,19 @@ ><command >kdiff3</command > <replaceable ->file1 file2</replaceable +>ficheiro1 ficheiro2</replaceable > <option >-m</option> <command >kdiff3</command > <replaceable ->file1 file2</replaceable +>ficheiro1 ficheiro2</replaceable > <option >-o</option > <replaceable ->outputfile</replaceable -></screen> +>resultado</replaceable +> +</screen> </sect2> <sect2 @@ -406,7 +410,8 @@ >kdiff3</command > <replaceable >ficheiro1 ficheiro2 ficheiro3</replaceable -></screen> +> +</screen> </sect2> <sect2 @@ -416,18 +421,19 @@ ><command >kdiff3</command > <replaceable ->file1 file2 file3</replaceable +>ficheiro1 ficheiro2 ficheiro3</replaceable > <option >-m</option> <command >kdiff3</command > <replaceable ->file1 file2 file3</replaceable +>ficheiro1 ficheiro2 ficheiro3</replaceable > <option >-o</option > <replaceable ->outputfile</replaceable -></screen> +>resultado</replaceable +> +</screen> <para >Repare que o <replaceable >ficheiro1</replaceable @@ -442,13 +448,14 @@ ><title >Caso especial: Ficheiros com o mesmo nome If all files have the same name but are in different directories, you can reduce typework by specifying the filename only for the first file. ⪚: +>Se todos os ficheiros tiverem o mesmo nome mas estiverem em pastas diferentes, poderá reduzir o trabalho de escrita se indicar apenas o nome do ficheiro para o primeiro parâmetro. P.ex.: kdiff3 pasta1/ficheiro pasta2 pasta3 +> + kdiff3 dir1 dir2 +>pasta1 pasta2 kdiff3 dir1 dir2pasta1 pasta2 destdir +>destino kdiff3 dir1 dir2 dir3 +>pasta1 pasta2 pasta3 kdiff3 dir1 dir2 dir3pasta1 pasta2 pasta3 destdirdestino For more information on command line options use: +>Outras opções da linha de comandos +Para mais informações sobre as opções da linha de comandos use kdiff3 -Options: - -m, --merge Merge the input. - -b, --base file Explicit base file. For compatibility with certain tools. - -o, --output file Output file. Implies -m. E.g.: -o newfile.txt - --out file Output file, again. (For compatibility with certain tools.) - --auto No GUI if all conflicts are auto-solvable. (Needs -o file) - --qall Don't solve conflicts automatically. (For compatibility...) - --L1 alias1 Visible name replacement for input file 1 (base). - --L2 alias2 Visible name replacement for input file 2. - --L3 alias3 Visible name replacement for input file 3. - -L, --fname alias Alternative visible name replacement. Supply this once for every input. - -u Has no effect. For compatibility with certain tools. +> --help + +Exemplo do resultado: +kdiff3 --help +Opções: + -m, --merge Junta o resultado. + -b, --base ficheiro Ficheiro de base explícito. Para compatibilidade com certas ferramentas. + -o, --output ficheiro Ficheiro de resultado. O -m é implícito. P.ex.: -o novo_ficheiro.txt + --out ficheiro O ficheiro de resultado, mais uma vez. (Para compatibilidade com certas ferramentas.) + --auto Sem interface gráfica se todos os conflitos são resolúveis. (Necessita do -o) + --qall Não resolve os conflitos automaticamente. (Para compatibilidade...) + --L1 nome1 Substituto visível do nome do ficheiro 1 (base). + --L2 nome2 Substituto visível do nome do ficheiro 2. + --L3 nome3 Substituto visível do nome do ficheiro 3. + -L, --fname nome Um substituto visível alternativo para o nome. Use este uma vez para cada ficheiro de entrada. + --cs texto Substitui uma opção de configuração. Use uma vez para cada opção. P.ex. --cs "AutoAdvance=1" + --confighelp Mostra uma lista com as opções de configuração e os valores actuais. + --config ficheiro Usa um ficheiro de configuração diferente. + +A opção permite-lhe ajustar um valor de configuração que, de outro modo, só é ajustável através das janelas de configuração. Mas tenha em mente que, quando o &kdiff3; então terminar, o valor alterado será gravado com as outras opções. Com o , poderá descobrir os nomes dos itens disponíveis e dos valores actuais. +Através do , poderá indicar um ficheiro de configuração diferente. Quando usar frequentemente o &kdiff3; com opções completamente diferentes, isto permitir-lhe-á mudar rapidamente entre elas. + +Ignorar as opções da linha de comandos +Muitas pessoas querem usar o &kdiff3; com alguns sistemas de controlos de versões. Mas quando esse sistema de controlo de versões chama o &kdiff3;, usando os parâmetros da linha de comandos que o &kdiff3; não reconhece, então o &kdiff3; termina com um erro. A configuração da integração permite indicar parâmetros da linha de comandos que deverão ser ignorados pelo &kdiff3;. Eles irão aparecer na ajuda de utilização, como neste exemplo: +--xpto Ignorado. (Definido pelo utilizador.) + + + Opções da linha de comandos a ignorar:Uma lista de opções, separadas pelo ponto-e-vírgula ';'. Quando alguma destas opções aparecer na linha de comandos, então o &kdiff3; ignorá-la-á e irá executar sem indicar qualquer erro. (Por omissão é "u;query;html;abort"). + +Quando isto não for suficiente, então recomenda-se que crie um programa que faça a tradução das opções. @@ -527,103 +578,79 @@ The open dialog allows to edit the filenames by hand, selecting a file via the file-browser (File...) or allows to choose recent files from the drop-down lists. If you open the dialog again, then the current names still remain there. The third input file is not required. If the entry for C remains empty, then only a two file diff analysis will be done. A janela de abertura permite editar os nomes dos ficheiros à mão, seleccionando um ficheiro através do navegador dos ficheiros ("Ficheiro...") ou permite escolher os ficheiros recentes a partir das listas respectivas. Se abrir a janela de novo, então os nomes actuais irão nela permanecer. O terceiro ficheiro de entrada não é obrigatório. Se o item do "C" continuar em branco, então só será efectuada uma análise de diferenças com dois ficheiros. You can also select a directory via Dir.... If for A a directory is specified then a directory-comparison/merge starts. If A specifies a file but B, C or the output specify a directory, then &kdiff3; uses the filename from A in the specified directories. Poderá também seleccionar uma pasta com o "Dir...". Se for indicado como A uma pasta, então será iniciada uma comparação/junção de pastas. Se o A se referir a um ficheiro, mas o B, o C ou o destino corresponderem a pastas, então o &kdiff3; usa o nome do ficheiro em A nas pastas indicadas. If Merge is selected, then the Output line becomes editable. But it is not required to specify the output filename immediately. You can also postpone this until saving. Se a "Junção" estiver seleccionada, então o campo "Resultado" fica editável. Mas não é obrigatório indicar o nome do ficheiro do resultado imediatamente. Você poderá também adiar isto até à gravação. The Configure... button opens the options-dialog, so that you can set the options before running the analysis. +>O botão "Configurar..." abre a janela de opções, para que possa definir as opções antes de executar a análise. Colar e Arrastar Dados Sometimes you want to compare parts of a text that is not an own file. &kdiff3; also allows you to paste text from the clipboard into the diff input window that has the focus. The diff analysis happens immediately then. In the open dialog you need not specify files then, but just close it via Cancel. Em algumas ocasiões, você poderá querer comparar partes de um texto que não está em nenhum ficheiro próprio. O &kdiff3; também lhe permite colar texto da área de transferência para a janela de introdução de diferenças que esteja em primeiro plano. A análise de diferenças irá ocorrer então. Na janela de abertura, você não irá necessitar de indicar ficheiros, fechando-a então com o "Cancelar". O utilizador também poderá usar o 'drag and drop': Arraste um ficheiro de um gestor de ficheiros ou o texto seleccionado de um editor e arrastá-lo para uma janela de introdução de diferenças. Qual é a ideia? Algumas vezes um ficheiro contém duas funções semelhantes, mas a verificação sobre as semelhanças entre elas é um grande esforço, se você precisar de criar primeiro dois ficheiros e depois carregá-los. Assim, poderá simplesmente copiar, colar e comparar as secções relevantes. -Qual é a ideia? Algumas vezes um ficheiro contém duas funções semelhantes, mas a verificação sobre as semelhanças entre elas é um grande esforço, se você precisar de criar primeiro dois ficheiros e depois carregá-los. Assim, poderá simplesmente copiar, colar e comparar as secções relevantes. Currently you can't drag anything from &kdiff3;. Only dropping in the diff input is supported. -Nota: De momento, você não poderá arrastar nada a partir do &kdiff3;. Só é permitido largar dados nas janelas de introdução de diferenças. Some editors still interpret the drag and drop into another program like cut (instead of copy) and paste. Your original data might be lost then. +>Atenção: Alguns editores ainda interpretam à mesma o 'drag and drop' noutro programa como o Cortar (em vez do Copiar) e Colar. Os seus dados originais poderão deste modo perder-se. Interpreting The Information In The Input Windows +>Comparar os Ficheiros e Interpretar a Informação nas Janelas de Entrada -At the top of each text window is its info line. The info lines of the input windows contain a letter A, B or C, the filename and the line number of the first visible line in the window. (Note that window C is optional.) Each info line appears in a different color. (If the paths are too long to fit, then you can move the mouse onto the info line and a tooltip will show the complete name.) Linha de InformaçãoThe three input windows are assigned the letters A, B and C. A has color blue, B has green and C has magenta. (These are the defaults, but can be changed in the Settings menu.) No cimo de cada janela de texto existe a sua "linha de informação". As linhas de informação das janelas de introdução de diferenças contêm uma letra "A", "B" ou "C", o nome do ficheiro e o número da primeira linha visível da janela. (Lembre-se que a janela "C" é opcional). Cada linha de informação aparece com uma cor diferente. (Se as localizações forem demasiado extensas para caberem, poderá mover o cursor do rato para cima da linha de informação, de modo a que apareça uma dica com o nome completo). When a difference is detected then the color shows which input file differs. When both other input files differ then the color used to express this is red by default (Conflict color in the settings). This colorscheme is especially useful in the case of three input files, which will be seen in the next section (MergingQuando tiver seleccionado outro ficheiro através de navegação ou acabar de editar o nome do ficheiro aqui, carregando para tal em Enter, o novo ficheiro será carregado e comparado com os ficheiros já carregados previamente. ColoraçãoAs três janelas de entrada têm atribuídas as letras "A", "B" e "C". O "A" tem uma cor azul, o "B" tem uma verde e o "C" magenta. (Estas são as cores por omissão, mas podem ser alteradas no menu de configuração). Quando é detectada uma diferença, então a cor mostra qual o ficheiro de entrada que é diferente. Quando os outros ficheiros de entrada diferem todos, então a cor usada para exprimir isto é a vermelha por omissão ("Cor do conflito" na Configuração). Este esquema de cores é particularmente útil no caso de três ficheiros de entrada, os quais serão vistos na próxima secção (Juntar). Coluna de ResumoLeft of each text is the summary column. If differences occurred on a line then the summary column shows the respective color. For a white-space-only difference the summary is chequered. For programming languages where white space is not so important this is useful to see at one glance if anything of importance was modified. (In C/C++ white space is only interesting within strings, comments, for the preprocessor, and some only very esoteric situations.) À esquerda de cada texto está a "coluna de resumo". Se ocorrerem diferenças numa linha, então a coluna do resumo mostra a cor respectiva. Para uma diferença por espaços em branco, o resumo fica axadrezado. Para as linguagens de programação em que os espaços em branco não são muito importantes, isto é útil para ver de um modo geral se existe algo de importante modificado. (No C/C++, os espaços em branco só são importantes dentro de cadeias de caracteres, comentários, pré-processador e em algumas outras situações esotéricas. A linha vertical que separa a coluna do resumo e o texto é interrompida (tracejada), se o ficheiro de entrada não tiver aí nenhuma linha. Quando a mudança de linha estiver activa, então esta linha vertical aparece ponteada para as linhas repartidas. Coluna de ResumoOn the right side a overview column is visible left of the vertical scrollbar. It shows the compressed summary column of input A. All the differences and conflicts are visible at one glance. When only two input windows are used, then all differences appear red here because every difference is also a conflict. A black rectangle frames the visible part of the inputs. For very long input files, when the number of input lines is bigger than the height of the overview column in pixels, then several input lines share one overview line. A conflict then has top priority over simple differences, which have priority over no change, so that no difference or conflict is lost here. By clicking into this overview column the corresponding text will be shown. +>Do lado direito, aparece uma coluna de "resumo" à esquerda da barra de posicionamento vertical. Ela mostra a coluna de resumo comprimida dos dados de "A". Todas as diferenças e conflitos ficam visíveis numa vista rápida. Quando só são usadas duas janelas de entrada, então todas as diferenças aparecem a vermelho, dado que cada diferença é também um conflito. Um rectângulo preto delimita a parte visível dos dados de entrada. Para as linhas de dados bastante compridas, quando o número de linhas de dados é maior do que a altura da coluna de resumo em pixels, então várias linhas de dados de entrada irão partilhar uma linha de resumo. Um conflito, neste caso, terá então uma prioridade elevada sobre as diferenças simples, que por sua vez têm prioridade sobre a ausência de alterações, como tal não se perde nenhuma diferença ou conflito neste caso. Se carregar nesta coluna de resumo, será mostrado o texto correspondente. Alinhar Manualmente as LinhasEm alguns casos, o algoritmo coloca as linhas erradas a seguir umas às outras. Ou se deseja comparar um pedaço de texto com outro que se encontra numa posição completamente diferente no outro ficheiro. Para esses casos, poderá indicar manualmente ao &kdiff3; para alinhar certas linhas. Marque o texto, com o qual deseja melhorar o alinhamento, com o rato como faria na cópia e colagem na primeira janela de diferenças e escolhe então o "Adicionar o Alinhamento Manual das Diferenças" na janela de "Diferenças" (atalho de teclado "Ctrl-Y") . Irá aparecer uma barra laranja na coluna do resumo, a seguir ao texto escolhido. Repita isto para a segunda e (se disponível) a terceira janela de diferenças. O &kdiff3; irá calcular imediatamente de novo as diferenças sempre que fizer isto, alinhando as linhas escolhidas. Obviamente, algumas das linhas anteriormente correspondentes poderão não corresponder mais de novo. De momento, a junção não suporta a utilização da ajuda de diferenças manual. @@ -637,262 +664,248 @@ The merge output editor window (below the diff input windows) also has an info line at the top showing Output:, the filename and [Modified] if you edited something. Usually it will contain some text through the automatic merge facilities, but often it will also contain conflicts. A janela do editor do resultado da junção (por baixo das janelas de introdução de diferenças) também tem uma linha de informação no topo que mostra "Resultado:", o nome do ficheiro e "[Modificado]" se você tiver alterado alguma coisa. Normalmente irá conter algum texto resultante das funcionalidades de junção automática, mas frequentemente irá conter também conflitos. Saving is disabled until all conflicts are resolved. (Use the Go to prev/next unsolved conflicts buttons to find the remaining conflicts.) A gravação está desactivada até que todos os conflitos estejam resolvidos. (Use os botões para "Ir para o Conflito por Resolver Anterior/Seguinte" para descobrir os conflitos que faltam.) Com apenas dois ficheiros de entrada, todas as diferenças são também conflitos que necessitam de ser resolvidos manualmente. Com três ficheiros de entrada, o primeiro ficheiro é tratado como a base, enquanto que o segundo e o terceiro contêm as modificações. Quando, em qualquer linha, só o ficheiro B ou o C tiverem sido alterados mas não ambos, então será seleccionada a origem alterada. Só quando o B e o C alteraram as mesmas linhas é que a ferramenta detecta um conflito que deverá ser resolvido manualmente. Quando o B e o C são iguais mas não são o mesmo que o A, é seleccionado o C. A Coluna de ResumoThe merge output editor window also has a summary column on the left. It shows the letter of the input from which a line was selected or nothing if all three sources where equal on a line. For conflicts it shows a questionmark ? and the line shows <Merge Conflict>, all in red. Because solving conflicts line by line would take very long, the lines are grouped into groups that have the same difference and conflict characteristics. But only-white-space-conflicts are separated from non-white-space-conflicts in order to ease the merging of files were the indentation changed for many lines. A janela do editor do resultado da junção também tem uma coluna de resumo à esquerda. Mostra a letra do ficheiro de entrada para o qual foi seleccionada a linha ou nada, se todas as três origens são iguais nessa linha. Para os conflitos, ela mostra um ponto de interrogação "?" e a linha mostra "<Conflito na Junção>", tudo a vermelho. Dado que a resolução de conflitos linha a linha poderá levar bastante tempo, as linhas são reunidas em grupos com as mesmas características de diferenças e conflitos. Mas os conflitos só com espaços em branco são separados dos outros conflitos para facilitar a junção dos ficheiros em que a indentação foi alterada em várias linhas. Configurar o Grupo Actual e Sincronizar a Posição de Visualização da Junção e DiferençasWhen clicking into the summary column with the left mouse button in either window then the group belonging to that line will be selected in all windows and the beginning of that group will be shown. (This might involve an automatic position jump in the windows if the beginning of a group is not visible.) This group then becomes the current group. It is highlighted with the Current range (diff) background color and a black bar appears on the left side of the text. Ao carregar na coluna do resumo com o &LMB; em ambas as janelas, o grupo que pertença a essa linha será seleccionado em todas as janelas e o início desse grupo será mostrado. (Isto poderá envolver um salto de posição automático para a janelas se o início do grupo não estiver visível). Este grupo fica então o "grupo actual". Fica realçado com a "Cor de fundo do intervalo actual" e aparece uma barra preta do lado esquerdo do texto. Escolher as Entras A, B ou C para os Conflitos e Edições ActuaisNote the input selector buttons containing the letters A, B and C in the button bar below the menu bar. When clicking on either input selector button, the lines from that input will be added at the end of the selected group if that group didn't contain that source before. Otherwise the lines from that input will be removed. A barra de botões por baixo do menu contém três botões de selecção que contêm as letras "A", "B" e "C". Carregue no selector de entrada para inserir (ou remover se já estiver inserido) as linhas da origem respectiva. Para escolher as linhas de várias entradas, carregue nos botões respectivos pela ordem necessária. Por exemplo, se quiser que as linhas de "B" apareçam antes das linhas de "A" no resultado, carregue primeiro em "B" e depois em "A". Besides, you can directly edit any line. The summary column will show m for every line that was modified. Se usar a opção de avanço automático ("Ir automaticamente para o próximo conflito não resolvido após a selecção da fonte"), deverá desactivar isto antes de escolher as linhas de várias entradas ou se quiser editar as linhas após a sua escolha. Caso contrário, o &kdiff3; irá saltar para o próximo conflito após a selecção da primeira entrada. Sometimes, when a line is removed either by automatic merge or by editing and no other lines remain in that group, then the text <No src line> will appear in that line. This is just a placeholder for the group for when you might change your mind and select some source again. This text won't appear in the saved file or in any selections you want to copy and paste. Normalmente é útil editar directamente o resultado da junção. A coluna de resumo irá mostrar "m" por cada linha modificada manualmente. Quando, por exemplo, as diferenças estão alinhadas de forma que não seja satisfatório escolher simplesmente as entradas, então poderá marcar o texto necessário e usar a cópia e colagem normais para colocar no resultado da junção. The text <Merge Conflict> will appear in the clipboard if you copy and paste some text containing such a line. Algumas das vezes, quando uma linha é removida tanto por junção automática como por edição e não ficam mais nenhumas linhas nesse grupo, então o texto "<Sem linha de origem>" irá aparecer nessa linha. Isto é apenas um substituto para o grupo, quando decidir mudar de ideias e seleccionar algum texto de origem de novo. Este texto não irá aparecer no ficheiro gravado ou em qualquer selecção que deseje copiar e colar. The normal merge will start by solving simple conflicts automatically. But the Merge menu provides some actions for other common needs. If you have to select the same source for most conflicts, then you can choose A, B or C everywhere, or only for the remaining unsolved conflicts, or for unsolved whitespace conflicts. If you want to decide every single delta yourself, you can Set deltas to conflicts. Or if you want to return to the automatic choices of &kdiff3; then select Automatically solve simple conflicts. &kdiff3; then restarts the merge. For actions that change your previous modifications KDiff3 will ask for your confirmation before proceeding. - -O texto "<Conflito na Junção>" irá aparecer na área de transferência se copiar e colar algum texto que tenha uma dessas linhas. Mas tenha à mesma cuidado ao fazê-lo. Escolher a Entrada A, B ou C para Todos os ConflitosWhen choosing either source for unsolved whitespace conflicts and the options Ignore Numbers or Ignore C/C++ Comments are used then changes in numbers or comments will be treated like whitespace too. +>A junção normal irá começar por resolver os conflitos simples automaticamente. Mas o menu "Juntar" oferece algumas acções para outros usos comuns. Se você tiver de seleccionar a mesma origem para a maioria dos conflitos, então poderá escolher "A", "B" ou "C" em qualquer lado ou apenas para os conflitos que continuem ainda por resolver ou então para os conflitos de espaços em branco por resolver. Se quiser decidir cada um dos deltas por si próprio, poderá "Passar os deltas para conflitos". Ou, se preferir voltar às escolhas automáticas do &kdiff3;, seleccione então a opção "Resolver automaticamente os conflitos simples". Nesse caso, o &kdiff3; irá reiniciar a junção. Para as acções que alteram as suas modificações anteriores, o &kdiff3; pedir-lhe-á uma confirmação antes de prosseguir. Nota: Ao escolher uma das origens para os conflitos que não sejam de espaços em branco e as opções "Ignorar os Números" ou "Ignorar os Comentários de C/C++" forem usadas, então as alterações nos números ou comentários serão tratadas como espaços em branco também. Junção Automática das Palavras-Chave e do Histórico do Controlo de Versões (Registo)Muitos sistemas de controlo de versões suportam palavras-chave especiais no ficheiro. (p.ex. "$Date: 2006-03-31 15:21:46 +0100 (Sex, 31 Mar 2006) $", "$Header$", "$Author: scripty $", "$Log$" etc.) Durante o envio de novas versões, o sistema de controlo de versões (SCV) muda essas linhas. Por exemplo, o "$Date: 2006-03-31 15:21:46 +0100 (Sex, 31 Mar 2006) $" passará a "$Date: 2006-03-30 17:52:41 +0200 (Thu, 30 Mar 2006) $". Dado que esta linha será diferente em cada versão do ficheiro, iria necessitar de intervenção manual durante a junção. O &kdiff3; oferece a junção automática destes itens. Para as linhas simples que correspondam à opção da "Expressão regular da junção automática" para todos os ficheiros de entrada, o &kdiff3; irá escolher a linha do B ou - se disponível - do C. (Para além disso, é necessário que as linhas em questão se alinhem na comparação e a linha anterior não contenha conflitos). Esta junção automática pode tanto correr automaticamente após o início de uma junção (active a opção "Executar a junção automática da expressão regular no início da junção") como posteriormente, através do menu de junção "Executar a Junção Automática da Expressão Regular". A junção automática para o histórico do controlo de versões (também chamado de "registo") é também suportada. A junção automática do histórico tanto poderá correr automaticamente quando iniciar a junção, activando para tal a opção "Juntar o histórico do controlo de versões no início da junção" ou mais tarde através do menu de junção "Resolver Automaticamente os Conflitos do Histórico". Normalmente, o histórico do controlo de versões começa por uma linha que contém a palavra-chave "$Log$". Isto deverá corresponder à opção "Expressão regular do início do histórico". O &kdiff3; detecta quais as linhas subsequentes no histórico, analisando os caracteres iniciais que aparecem antes da palavra-chave "$Log$". Se também aparecer o mesmo "comentário inicial" nas linhas seguintes, então estas também serão incluídas no histórico. Durante o envio de cada nova versão, o SCV grava uma linha única que indica a versão, a data e a hora, seguida de linhas com os comentários dos utilizadores. Essas linhas formam um item de histórico. Esta secção do histórico vai crescendo com o envio de versões novas e os itens mais recentes aparecem no topo (a seguir à linha inicial do histórico). Quando, em desenvolvimentos paralelos, dois ou mais programadores enviam versões em ramificações diferentes, o histórico da junção irá conter vários itens que aparecem como conflitos na junção das ramificações. Dado que a junção destes se poderá tornar demasiado aborrecidas, o &kdiff3; oferece o suporte com duas estratégias possíveis: basta introduzir a informação de histórico de ambas as contribuições no topo ou ordenar a informação de histórico do utilizador, usando uma chave definida pelo mesmo. O método basta-inserir-todos-os-itens é mais fácil de configurar. O &kdiff3; só precisa de um método para detectar as linhas que pertencem a um item de histórico. A maioria dos SCV inserem uma linha em branco, após cada item do histórico. Se não existirem mais linhas em branco, então este será um critério suficiente para o &kdiff3;. Basta introduzir uma "Expressão regular do início do item de histórico" em branco. Se o critério da linha vazia não for suficiente, poderá indicar uma expressão regular para detectar o início do item do histórico. Lembre-se que o &kdiff3; irá remover os itens de histórico duplicados. Se um item de histórico aparecia várias vezes no histórico de um ficheiro de entra, só um irá aparecer no resultado. Se quiser ordenar o histórico, então terá de indicar como deverá ser gerada a chave de ordenação. Use parêntesis na "Expressão regular do início do item de histórico" para agrupar as partes da expressão regular que deverão mais tarde ser usadas na chave de ordenação. Indique depois a "Ordem da chave de ordenação do início do item de histórico", indicando para tal uma lista de números separados por ",", referentes à posição do grupo na expressão regular. Dado que isto não é tão simples de pôr a funcionar logo, poderá testar e melhorar as expressões regulares e gerar as chaves, numa janela dedicada, se carregar no botão "Testar as suas expressões regulares". Exemplo: Assuma um histórico que se pareça ao seguinte: +/************************************************************************** +** HISTORY: $Log: \janela_do_ze\Aplicacao\src\algoritmo-complexo.cpp $ +** +** \principal\ramo_integracao_12 2 Abr 2001 10:45:41 ze +** Juntou-se a ramificação manel_versao_15. +** +** \principal\ramo_correccao_erros_7\1 30 Mar 2001 19:22:05 pedro +** Melhorias na velocidade da sub-rotina convertToMesh(). +** Correcção do estoiro. +**************************************************************************/ + A linha inicial do histórico corresponde à expressão regular ".*\$Log.*\$.*". Depois, seguem-se os itens de histórico. A linha com a palavra-chave "$Log$" começa com dois "*", após os quais se segue um espaço. O &kdiff3; usa o primeiro texto não-branco como "comentários iniciais" e assume que o histórico termina na primeira linha sem esse comentário inicial. Neste exemplo, a última linha termina com um texto que também começa por dois "*" mas, em vez de um espaço, seguem-se mais "*". Como tal, esta linha termina o histórico. Se a ordenação do histórico não for necessária, então a expressão regular do início de linha do item de histórico poderá ser algo como se segue. (Esta linha está dividida em dois, por não caber de outra forma.) +\s*\\principal\\\S+\s+[0-9]+ (Jan|Fev|Mar|Abr|Mai|Jun|Jul|Ago|Set|Out|Nov|Dez) + [0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\s+.* + Para mais detalhes sobre as expressões regulares, veja por favor a documentação da Trolltech sobre expressões regulares. Repare que o "\s" (com o "s" minúsculo) corresponde a qualquer espaço em branco e o "\S" (com o "S" maiúsculo) corresponde a qualquer carácter não-branco. No nosso exemplo, o início do item de histórico, contém primeiro a informação da versão com a expressão regular "\\principal\\\S+", a data consiste no dia "[0-9]+", mês "(Jan|Fev|Mar|Abr|Mai|Jun|Jul|Ago|Set|Out|Nov|Dez)" e no ano "[0-9][0-9][0-9][0-9]", a hora "[0-9][0-9]:[0-9][0-9]:[0-9][0-9]" e, finalmente, o nomes do programador ".*". Lembre-se que o comentário inicial (no exemplo "**") já será removido pelo &kdiff3; antes de tentar a correspondência, logo a expressão regular começa com uma correspondência para zero ou mais caracteres em branco "\s*". Se precisar de um histórico ordenado, então deverá ser calculada a chave de ordenação. Para tal, as partes relevantes da expressão regular deverão ser agrupadas entre parêntesis. (os parêntesis extra poderão ficar à mesma, mesmo que a ordenação do histórico esteja desactivada.) +\s*\\principal\\(\S+)\s+([0-9]+) (Jan|Fev|Mar|Abr|Mai|Jun|Jul|Ago|Set|Out|Nov|Dez) + ([0-9][0-9][0-9][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9])\s+(.*) + Os parêntesis contêm agora 1. a informação de versão, 2. dia, 3. mês, 4. ano, 5. hora, 6. nome. Mas, se pretender ordenar por data e hora, é necessário construir uma chave com os elementos por uma ordem de aparência diferente: Primeiro o ano, seguido do mês, dia, hora, informação de versão e nome. Daí, a ordem da chave de ordenação será "4,3,2,5,1,6". Dado que os nomes dos meses não são bons para ordenar (o "Abr" viria em primeiro lugar), o &kdiff3; detecta em que ordem os nomes dos meses foram dados e usa esse número em alternativa ("Abr"->"04"). E, se for encontrado um número puro, será transformado num valor de 4 algarismos com zeros iniciais para ordenar. Finalmente, a chave de ordenação resultante da linha inicial do primeiro item de histórico será: 2001 04 0002 10:45:41 ramo_integracao_12 ze + +Para mais informações, veja também a Configuração de Diferenças e Junção. + Navegação e Edição Much navigation will be done with the scroll bars and the mouse but you can also navigate with the keys. If you click into either window then you can use the cursor buttons Left Arrow, Right Arrow, Up Arrow, Down Arrow, Page Up, Page Down, Home, End, &Ctrl;Home, &Ctrl;End as you would in other programs. The overview-column next to the vertical scroll bar of the input files can also be used for navigating by clicking into it. Muita da navegação será feita com as barras de posicionamento e com o rato, mas você poderá também navegar com as teclas. Se carregar numa das janelas, então poderá usar as teclas de cursores, o Page Up, o Page Down, o Home, o End, o Ctrl-Home ou o Ctrl-End como iria usar noutros programas. A coluna de resumo ao lado da barra de posicionamento vertical dos ficheiros de entrada poderá também ser usada para navegar se carregar nela. You can also use a wheel mouse to scroll up and down. Poderá também usar a roda do rato para subir ou descer. In the merge output editor you can also use the other keys for editing. You can toggle between insert and overwrite mode with the Insert key. (Default is insert-mode.) No editor do resultado da junção, poderá também usar as outras teclas para editar. Poderá alternar entre o modo de inserção ou sobreposição com a tecla Insert. (Por omissão, está no modo de inserção). A &LMB; click into any summary column will synchronise all windows to show the beginning of the same group of lines (as explained in section "Merging"Um 'click' com o botão esquerdo do rato em qualquer coluna de resumo irá sincronizar todas as janelas para mostrar o início do mesmo grupo de linhas (tal como é explicado em Configurar o Grupo Actual e Sincronizar a Posição da Janela de Junção e Diferença). The button bar also contains seven navigation buttons with which you can jump to the current/first/last difference, to the next/previous difference (&Ctrl;Down Arrow/&Ctrl;Up Arrow), to the next/previous conflict (&Ctrl;Page Down/&Ctrl;Page Up), or to the next/previous unsolved conflict. Note that for &kdiff3; a conflict that was not automatically solved at the start of the merge stays a conflict even if it is solved. Hence the necessity to distinguish unsolved conflicts. There also is a button Automatically go to next unsolved conflict after source selection (Auto-Advance). If you enable this, then, when one source is selected, then &kdiff3; will jump to and select the next unsolved conflict automatically. This can help when you always want to choose one source only. When you need both sources, or you want to edit after selecting, then you probably want to switch this off. Before proceeding to the next unsolved conflict &kdiff3; shows you the effect of your choice for a short time. This delay is adjustable in the Diff & Merge Settings: You can specify the Auto-Advance delay in milli seconds between 0 and 2000. -Tired of many clicks? Use a small Auto-Advance-delay and the shortcuts &Ctrl;1, &Ctrl;2 and &Ctrl;3 to select files A, B or C for many conflicts. +>A barra de botões também contém sete botões de navegação com os quais poderá saltar para a primeira/última/actual diferença, para a diferença seguinte/anterior (Ctrl-Baixo/Ctrl-Cima), para o conflito seguinte/anterior (Ctrl-Pg Down/Ctrl-Pg Up) ou para o conflito seguinte/anterior por resolver. Repare que, para o &kdiff3;, um "conflito" que não foi resolvido automaticamente no início da junção irá permanecer como "conflito", mesmo que resolvido. Daí a necessidade de distinguir os "conflitos por resolver". +Avanço Automático +Existe também um botão "Ir automaticamente para o próximo conflito por resolver após a selecção do código" (Avanço Automático). Se activar esta opção, então sempre que seleccionar uma origem, o &kdiff3; irá saltar para o próximo conflito por resolver automaticamente. Isto poderá ajudar quando quiser sempre escolher apenas uma origem. Quando precisar de ambas as origens, ou se quiser editar depois de seleccionar, então provavelmente irá querer desligar esta opção. Antes de prosseguir para o próximo conflito por resolver, o &kdiff3; mostra-lhe o efeito da sua escolha durante algum tempo. Este atraso é ajustável na Configuração da Diferença & Junção: Poderá indicar o "Atraso no avanço automático" num valor entre 0 e 2 000 milisegundos. Sugestão: Cansado de muitos 'clicks'? - Use um atraso de avanço automático reduzido e os atalhos Ctrl-1/2/3 para seleccionar o A/B/C em muitos conflitos. + Seleccionar, Copiar e Colar The input windows don't show a cursor, so selections must be made with the mouse by clicking with the &LMB; at the start, holding down the mousebutton and moving to the end, where you release the mouse button again. You can also select a word by double clicking it. In the merge output editor you can also select via the keyboard by holding the &Shift; button and navigation with the cursor keys. As janelas de entrada não mostram nenhum cursor, como tal as selecções necessitam de ser feitas com o rato, ao carregar com o botão esquerdo do rato no início, mantendo o botão do rato carregado e indo até ao fim, momento em que larga o botão do rato de novo. Poderá também seleccionar uma palavra se fizer duplo-click nela. No editor do resultado da junção poderá também seleccionar com o teclado se mantiver a tecla Shift carregada enquanto navega com as teclas de cursores. To copy to the clipboard you must press the Copy button (&Ctrl;C or &Ctrl;Insert). But there exists an option Auto Copy Selection. If this is enabled, then whatever you select is copied immediately and you don't need to explicitly copy. But pay attention when using this because the contents of the clipboard might then be destroyed accidentally. Se a selecção ultrapassar o intervalo visível, você poderá passar o rato por cima dos extremos da janela, o que fará com que o &kdiff3; se desloque nessa direcção. Cut (&Ctrl;X or &Shift;Delete) copies to the clipboard and deletes the selected text and Paste (&Ctrl;V or &Shift;Insert) inserts the text in the clipboard at the cursor position or over the current selection. +>Para as selecções muito grandes, poderá também usar as teclas de navegação, enquanto mantém pressionado o rato. P. ex., use o Page Up e o Page Down para ir rapidamente para uma dada posição. Na posição final, largue o botão do rato. Para seleccionar tudo na janela actual, use a opção do menu "Editar"->"Seleccionar Tudo" (Ctrl-A). Para copiar para a área de transferência, precisa de carregar no botão "Copiar" (Ctrl-C ou Ctrl-Insert). Porém, existe uma opção para "Copiar Automaticamente a Selecção". Se esta estiver activa, então tudo o que seleccionar será copiado imediatamente, sem que você tenha de copiar explicitamente. Todavia, preste atenção ao usar isto, dado que o conteúdo da área de transferência poderá ficar assim destruído por acidente. O "Cortar" (Ctrl-X ou Shift-Delete) copia para a área de transferência e apaga o texto seleccionado. O "Colar" (Ctrl-V ou Shift-Insert) insere o texto da área de transferência na posição do cursor ou na selecção actual. Se colar numa das janelas de entrada de diferenças, o conteúdo da área de transferência será mostrado nessa janela e a comparação irá reiniciar imediatamente. Isto é útil se quiser pegar rapidamente num pedaço de texto de qualquer local e compará-lo com outra coisa, sem ter de criar ficheiros primeiro. Gravar Saving will only be allowed, when all conflicts were solved. If the file already exists and the Backup files option is enabled then the existing file will be renamed with an .orig extension, but if such a file exists it will be deleted. When you exit or start another diff-analysis and data wasn't saved yet, then &kdiff3; will ask if you want to Save, Cancel or Proceed without saving. &kdiff3; does not catch any signals. So if you kill &kdiff3; then your data will be lost.) A gravação só será permitida quando todos os conflitos tiverem sido resolvidos. Se o ficheiro já existir e a opção de "Salvaguarda dos ficheiros" estiver activa, então o ficheiro existente verá o seu nome mudado de modo a ter uma extensão ".orig", mas se existir um destes ficheiros será removido. Quando você sair ou iniciar outra análise de diferenças e os dados não tiverem sido gravados ainda, então o &kdiff3; irá perguntar se você deseja gravar, cancelar ou prosseguir sem gravar. (O &kdiff3; não lida com nenhuns sinais ('signals') do sistema. Por isso, se fizer um "kill" ao &kdiff3;, então os seus dados serão perdidos.) Line endings are saved according to the normal method on the underlying operating system. For Unices each line ends with an linefeed-character \n, while for &Windows; based systems each line ends with a carriage-return + a linefeed \r\n. &kdiff3; does not preserve the line-endings of the input files, which also means that you shouldn't use &kdiff3; with binary files. +>Os fins de linha são gravados de acordo com o método normal do sistema operativo subjacente. Para os UNIXes, cada linha terminada com um carácter de 'linefeed' "\n", enquanto que nos sistemas baseados em Win32, cada linha termina com um 'carriage-return' + um 'linefeed' "\r\n". O &kdiff3; não preserva os fins de linha dos ficheiros de entrada, o que também significa que você não deverá usar o &kdiff3; com ficheiros binários. Procurar Sequências de Texto You can search for a string in any text-window of &kdiff3;. The Find ... command (&Ctrl;F) in the Edit menu opens a dialog that lets you specify the string to search for. You can also select the windows which should be searched. Searching will always start at the top. Use the Find Next command (F3) to proceed to the next occurence. If you select to search several windows then the first window will be searched from top to bottom before the search starts in the next window at the top again, &etc; +>Você poderá procurar por uma sequência de texto em qualquer janela de texto do &kdiff3;. O comando "Procurar ..." (Ctrl-F) no menu "Editar" abre uma janela que lhe permite indicar o texto a procurar. Poderá também seleccionar as janelas que deverão ser pesquisadas. A procura irá ter início sempre no topo do ficheiro. Use o comando "Procurar o Seguinte" (F3) para prosseguir com a próxima ocorrência. Se optar por procurar em várias janelas, então a primeira janela será percorrida de alto a baixo antes de a procura começar na próxima janela a partir do topo de novo, etc. +Impressão +O &kdiff3; suporta a impressão das diferenças do ficheiro de texto. O comando "Imprimir..." (Ctrl-P) no menu Ficheiro abre uma janela que lhe permite seleccionar a impressora e ajustar as outras opções. Existem várias possibilidades para ajustar o intervalo. Devido às diferentes janelas de impressão nos diferentes sistemas operativos, o método para obter certas selecções de intervalos varia. + + Tudo:Imprime tudo. + Actual:Imprime uma página que começa na primeira linha visível da janela. (Nos sistemas sem esta opção, isto poderá ser obtido se indicar o número de página 10000 na impressão.) + Selecção:Antes de optar por imprimir, seleccione o texto com o rato (como acontece na cópia e colagem) numa das janelas de entrada das diferenças, para definir a linha inicial e final. Se não foi seleccionado nenhum texto numa das janelas de entrada, então esta opção não estará disponível. (Nos sistemas sem esta opção, isto poderá ser conseguido se indicar para imprimir a página 9999.) + Intervalo:Indica a primeira e última página. + +As outras opções importantes serão retiradas das opções normais: + Tamanho e tipo de letra + Mostrar os números de linha + Mudança de linha + Cores + etc. + +A formatação em paisagem (na horizontal) também é recomendada na impressão. + Opções Options and the recent-file-list will be saved when you exit the program, and reloaded when you start it. (Menu SettingsConfigure KDiff3 ...) +>As opções e a lista de ficheiros recentes serão gravadas quando você sair do programa e serão carregadas de novo quando o iniciar. (Menu Configuração->Configurar o &kdiff3;...) Tipo de Letra @@ -901,8 +914,8 @@ Texto Itálico para os Deltas:Texto Itálico para os Deltas:Colors +>Cores Cor principal:Cor principal: Cor de fundo:Cor de fundo: Cor de Fundo das Diferenças:Cor de Fundo das Diferenças: Cor A:Cor A: Cor B:Cor B: Cor C:Cor C: Cor do Conflito:Cor do Conflito: Cor de fundo do intervalo actual:Cor de fundo do intervalo actual: Cor de fundo da diferença do intervalo actual:Cor de fundo da diferença do intervalo actual:Normalmente a amarelo escuro. + Cor para os intervalos de diferenças seleccionados manualmente:Normalmente a laranja. + Cor dos ficheiros mais recentes na comparação de pastas:Normalmente a verde. + Cor dos ficheiros mais antigos na comparação de pastas:Normalmente a vermelho. + Cor dos ficheiros intermédios na comparação de pastas:Normalmente a amarelo escuro. + Cor dos ficheiros em falta na comparação de pastas:Normalmente preto. On systems with only 16 or 256 colors some colors are not available in pure form. On such systems the Defaults button will choose a pure color. +>A mudança das cores na comparação das pastas só fará efeito quando iniciar a próxima comparação de pastas. +Nos sistemas com apenas 16 ou 256 cores, alguns dos tons acima descritos não estão disponíveis de forma pura. Nesses sistemas, o botão "Predefinições" irá escolher uma cor pura. O Tab insere espaços:O Tab insere espaços: Tamanho das tabulações:Tamanho das tabulações: Indentação automática:Indentação automática:When pressing &Enter; or Return the indentation of the previous line is used for the new line. Ao carregar em Enter ou Return, a indentação da linha anterior é usada para uma nova linha. Copiar automaticamente a selecção:Copiar automaticamente a selecção: Estilo de fim de linha:Estilo de fim de linha:Ao gravar, o utilizador poderá seleccionar o estilo do fim de linha que prefere.O valor por omissão é a escolha comum para o sistema operativo usado. - Use locale encoding:For displaying foreign characters. Try changing this if some characters of your language aren't displayed correctly.
-Diff & Merge Settings +>Configuração da Diferença e Junção Ao comparar os ficheiros, o &kdiff3; tenta primeiro corresponder as linhas iguais em todos os ficheiros de entrada. Só durante este passo é que poderá ignorar os espaços em branco. O segundo passo compara cada uma das linhas. Neste passo, os espaços em branco não serão ignorados. Também durante a junção os espaços em branco não serão ignorados. Manter o 'Carriage Return':Manter o 'Carriage Return':Some editors (on some systems) save carriage return \r and linefeed \n characters at the end of line, while others will only save the linefeed \n. Usually &kdiff3; ignores the carriage return, but then files that don't have equal sizes, look equal in side by side comparison. When this option is on, then the carriage return characters are made visible but are treated as white space. This option must be off during a merge. Default is off.Alguns editores (em alguns sistemas) gravam os caracteres de 'carriage return' "\r" e 'linefeed' "\n" no fim da linha, enquanto que outros só irão gravar o 'linefeed' "\n". Normalmente o &kdiff3; ignora o 'carriage return', mas aí os ficheiros que não tenham tamanhos iguais pareçam de facto iguais numa comparação lado-a-lado. Quando esta opção estiver activa, então os caracteres de 'carriage return' ficarão visíveis mas serão tratados como espaços em branco. Ela necessita estar desligada durante uma junção. Por omissão, está desligada. Ignorar os números:Ignorar os números:Default is off. Number characters (0-9, ., -) will be ignored in the first part of the analysis in which the line matching is done. In the result the differences will be shown nevertheless, but they are treated as white space. Por omissão está desligado. Os caracteres dos números ("0-9", ".", "-") serão ignorados na primeira parte da análise, na qual é feita a correspondência de linhas. No resultado, as diferenças serão mostradas de qualquer forma, mas serão tratadas como espaços em branco. Ignorar comentários de C/C++:Ignorar comentários de C/C++: Ignorar a capitalização:Ignorar a capitalização:Default is off. Case-differences of characters (like A vs. a) will be treated like changes in white space. Por omissão está desligado. As diferenças de capitalização dos caracteres (como o 'A' vs. 'a') serão tratadas como alterações de espaços em branco. Comando do pré-processador:Comando do pré-processador: Comando do Pré-processador para a Correspondência de Linhas:Comando do Pré-processador para a Correspondência de Linhas: Tentar com Persistência:Tentar com Persistência: Atraso no Avanço Automático (ms):Atraso no Avanço Automático (ms): Predefinição da junção de espaço em branco com 2/3 ficheiros:Predefinição da junção de espaço em branco com 2/3 ficheiros:Automatically solve all white-space conflict by choosing the specified file. (Default is manual choice.) Useful if white-space really isn't important in many files. If you need this only occasionally better use Choose A/B/C For All Unsolved Whitespace Conflicts in the Merge menu. Note that if you enable either Ignore numbers or Ignore C/C++ comments then this auto-choice also applies for conflicts in numbers or comments. Resolve automaticamente todos os conflitos de espaços em branco, seleccionando o ficheiro indicado. (Por omissão, é com uma escolha manual). É útil se os espaços em branco não serão importantes em muitos dos ficheiros. Se precisar disto apenas ocasionalmente, é melhor usar o "Escolher A/B/C nos Conflitos de Espaços em Branco Por Resolver" no menu "Junção". Lembre-se que, se activar o "Ignorar os Números" ou o "Ignorar os Comentários de C/C++", então esta escolha automática também se aplica para os conflitos nos números ou nos comentários. + Expressão regular de junção automática:A expressão regular para as linhas onde o &kdiff3; deverá escolher automaticamente uma origem. Veja também a Junção Automática ... + Executar a junção automática da expressão regular no início da junção:Se for activado, o &kdiff3; executa a junção automática com a "Expressão regular da junção automática", quando for iniciada uma junção. + Expressão regular do início do histórico:A expressão regular do início do item de histórico. Normalmente, esta linha contém a palavra-chave "$Log$". Valor por omissão: ".*\$Log.*\$.*" + Expressão regular do início do item de histórico:Um item de junção do histórico consiste em várias linhas. Indique a expressão regular que detecta a primeira linha (sem o comentário inicial). Use os parêntesis para agrupar as chaves que deseja usar na ordenação. Se for deixado em branco, o &kdiff3; assume que as linhas em branco separam os itens de histórico. Veja também a Junção Automática ... + Ordenação da junção do histórico:Activa a ordenação do histórico do controlo de versões. + Ordem da chave de ordenação do início do item de histórico:Cada grupo de parêntesis usado na expressão regular do item de início de histórico agrupa uma chave que poderá ser usada na ordenação. Indique a lista de chaves (que são numeradas por ordem de ocorrência, a começar em 1), usando o ',' como separador (p.ex., "4,5,6,1,2,3,7"). Se for deixado em branco, então não será feita nenhuma ordenação. Veja também a Junção Automática ... + Juntar o histórico do controlo de versões no início da junção:Se estiver activado, o &kdiff3; executa a junção automática do histórico, usando as opções acima mencionadas, quando for iniciada uma junção. + Testar as suas expressões regularesEste botão mostra uma janela que lhe permite melhorar e testar as expressões regulares acima. Basta copiar os dados respectivos dos seus ficheiros para as linhas de exemplo. O "Resultados da correspondência" irá mostrar imediatamente se a correspondência é bem sucedida ou não. O "Resultado da chave de ordenação" irá mostrar a chave usada no histórico da junção do histórico. + Comando de junção irrelevante:Indique um comando próprio, que deverá ser chamado quando o &kdiff3; detectar que, numa junção de três ficheiros, o ficheiro de B não contribui com dados relevantes que não estivessem já contidos no ficheiro em C. O comando é chamado com os três nomes de ficheiros como parâmetros. Os dados correspondentes à "Expressão regular da junção automática" ou no histórico não são considerados relevantes. @@ -1233,16 +1346,12 @@ Ficheiros de segurança:Ficheiros de segurança:When a file is saved and an older version already exists, then the original version will be renamed with an .orig extension. If an old backup file with .orig extension already exists then this will be deleted without backup. Quando um ficheiro é gravado e já existe uma versão anterior, então a versão original irá mudar para um nome com uma extensão ".orig". Se já existir um ficheiro de cópia de segurança antigo com uma extensão ".orig", então este será removido sem ficar nenhuma cópia de segurança. @@ -1254,18 +1363,18 @@ Língua:Língua: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.) Ajusta a língua da interface do utilizador. Se mudar esta opção não afectará o programa em execução. Terá de sair e reiniciar o &kdiff3; para que a língua seja alterada. (Esta opção não está disponível na versão para KDE do &kdiff3;, porque a língua é ajustável na configuração global do KDE). Utilizar a mesma codificação para tudo:Utilizar a mesma codificação para tudo: Codificação Local:Codificação Local: Codificação do Ficheiro para o A/B/C:Codificação do Ficheiro para o A/B/C: Codificação do Ficheiro para Junção de Resultado e Gravação:Codificação do Ficheiro para Junção de Resultado e Gravação: Codificação do Ficheiro dos Ficheiros de Pré-processador:Codificação do Ficheiro dos Ficheiros de Pré-processador: Língua da Esquerda-para-a-Direita:Língua da Esquerda-para-a-Direita: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 then all layouting will be done right to left too. (This is a feature provided by &Qt;.) This handbook 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. Algumas línguas são escritas da direita para a esquerda. Quando esta opção está activa, o &kdiff3; desenha o texto da direita para a esquerda nas janelas de diferenças dos ficheiros de entrada e na janela do resultado da junção. Repare que, se iniciar o &kdiff3; com a opção da linha de comandos "--reverse", então toda a disposição será feita também da direita para a esquerda. (Esta é uma funcionalidade oferecida pelo Qt.) Esta documentação foi escrita a assumir que a "Língua da direita-para-a-esquerda" ou a disposição inversa estão desactivadas. Por isso, algumas das referências a "esquerda" ou "direita" deverão ser substituídas pela versão inversa, se usar estas opções. @@ -1338,12 +1439,12 @@ >Diversos These options and actions are available in menus or the buttonbar. +>(Estas opções e acções estão disponíveis nos menus ou na barra de botões.) Mostrar os números de linha:Mostrar os números de linha: Mostrar as diferenças de espaços e tabulações:Mostrar as diferenças de espaços e tabulações: Mostrar os espaços em branco:Mostrar os espaços em branco:Turn this off to suppress any highlighting of white-space-only changes in the text or overview-columns. (Note that this also applies to changes in numbers or comments if the options Ignore numbers or "Ignore C/C++ comments" are active.)Desligue isto para suprimir o realce das alterações apenas nos espaços em branco no texto ou nas colunas de vista geral. (Lembre-se que isto também se aplica às alterações nos números ou comentários se as opções "Ignorar os números" ou "Ignorar os Comentários de C/C++" estiverem activas.) Opções da vista geral:Opções da vista geral:These choices are only available when you compare three files. In normal mode all differences are shown in one color-coded overview-column. But sometimes you are especially interested in the differences between only two of these three files. Selecting A vs. B, A vs. C or B vs. C overview will show a second overview column with the required information next to the normal overview. Estas opções só estão disponíveis quando você compara três ficheiros. No modo normal, todas as diferenças são mostradas na coluna de resumo codificada a cores. Mas, em alguns casos, você está especialmente interessado nas diferenças entre apenas dois desses três ficheiros. Se seleccionar "A vs. B", "A vs. C" ou "B vs. C" na coluna de resumo irá aparecer uma segunda coluna com a informação necessária ao lado do resumo normal. Quebrar linha nas janelas de diferenças:Quebrar linha nas janelas de diferenças: Mostrar a Janela A/B/C:Mostrar a Janela A/B/C:Sometimes you want to use the space on the screen better for long lines. Hide the windows that are not important. (In the Windows menu.)Em algumas vezes, você poderá usar melhor o espaço no ecrã para as linhas compridas. Esconda as janelas que não são importantes. (No menu "Janelas".) Comutar a Orientação da Repartição:Comutar a Orientação da Repartição:Switch between diff windows shown next to each other (A left of B left of C) or above each other (A above B above C). This should also help for long lines. (In the Windows menu.) Define se as janelas de diferenças são mostradas uma ao lado da outra (a A à esquerda da B, que está à esquerda da C) ou uma por cima da outra (a A sobre a B, que está sobre a C). Isto também deverá ajudar para as linhas compridas (No menu "Janelas"). Iniciar uma junção rapidamente:Iniciar uma junção rapidamente:Sometimes you are viewing the deltas and decide to merge. Às vezes, você está a ver os deltas e decide juntá-los. Merge current file in the Directory menu also works if you only compare two files. A single click starts the merge and uses the filename of the last input-file as the default output filename. (When this is used to restart a merge, then the output filename will be preserved.) O "Juntar o ficheiro actual" no menu "Directoria" também resulta se só comparar dois ficheiros. Um único 'click' começa a junção e usa o nome do último ficheiro de entrada como nome do ficheiro do resultado por omissão. (Quando isto for usado para reiniciar uma junção, então o nome do ficheiro do resultado será mantido.) @@ -1447,13 +1532,7 @@ >Configurar os Atalhos de Teclado Currently only the &kde; version supports user-configurable keyboard-shortcuts. (SettingsConfigure Shortcuts...) +>De momento, só a versão para KDE suporta os atalhos de teclado configuráveis pelo utilizador. (No menu Configuração->Configurar os Atalhos...) @@ -1466,18 +1545,18 @@ Comando do pré-processador:Comando do pré-processador:When any file is read, it will be piped through this external command. The output of this command will be visible instead of the original file. You can write your own preprocessor that fulfills your specific needs. Use this to cut away disturbing parts of the file, or to automatically correct the indentation &etc;. Quando for lido qualquer ficheiro, ele será encaminhado através deste comando externo. O resultado deste comando será visível em vez do ficheiro original. O utilizador poderá criar o seu próprio pré-processador que corresponda às suas necessidades específicas. Use isto para cortar partes desnecessárias do ficheiro ou para corrigir automaticamente a indentação, etc. Comando do Pré-processador para a Correspondência de Linhas:Comando do Pré-processador para a Correspondência de Linhas:perl encarregar-se-ão disso. Example: Simple testcase: Consider file a.txt (6 lines): -aa -ba -ca -da -eafa - - -And file b.txt (3 lines): - -cg -dg -eg - -Without a preprocessor the following lines would be placed next to each other: - -aa - cg -ba - dg -ca - eg -da -ea -fa - -This is probably not wanted since the first letter contains the actually interesting information. To help the matching algorithm to ignore the second letter we can use a line matching preprocessor command, that replaces g with a: - -Exemplo: Caso de teste simples. Considere o ficheiro a.txt (6 linhas): + aa + ba + ca + da + ea + fa + E o ficheiro b.txt (3 linhas): + cg + dg + eg + Sem um pré-processador as seguintes linhas teriam sido colocadas lado a lado: + aa - cg + ba - dg + ca - eg + da + ea + fa + Isto provavelmente não será o desejado, dado que a primeira letra contém a informação realmente interessante. Para ajudar o algoritmo de correspondência a ignorar aa segunda letra, poder-se-ia usar um comando de pré-processamento de correspondências de linhas que substituísse o 'g' pelo 'a': + sed 's/g/a/' - -With this command the result of the comparison would be: - -aa -ba -ca - cg -da - dg -ea - eg -fa - -Internally the matching algorithm sees the files after running the line matching preprocessor, but on the screen the file is unchanged. (The normal preprocessor would change the data also on the screen.) +> 's/g/a/' + Com este comando, o resultado da comparação seria: + aa + ba + ca - cg + da - dg + ea - eg + fa + Internamente, o algoritmo de correspondência vê os ficheiros depois de correr o pré-processador de correspondência de linhas, mas no ecrã o ficheiro fica inalterado. (O pré-processador normal iria alterar também os dados no ecrã.) sed</command > This section only introduces some very basic features of Esta secção só introduz algumas funcionalidades muito básicas do sed. For more information see . Para mais informações veja as páginas info:/sed or ou http://www.gnu.org/software/sed/manual/html_mono/sed.html. A precompiled version for &Windows; can be found at . Existe uma versão pré-compilada para o Windows em http://unxutils.sourceforge.net. Note that the following examples assume that the . Repare no facto de que os exemplos seguintes assumem que o comando sed command is in some directory in the PATH environment variable. If this is not the case, you have to specify the full absolute path for the command. Also note that the following examples use the single quotation mark (') which won't work for &Windows;. On &Windows; you should use the double quotation marks (") instead. +> está numa pasta referida pela sua variável de ambiente PATH. Se não for este o caso, você terá de indicar a localização absoluta completa para o comando. +Lembre-se também que os exemplos seguintes usam a plica simples (') que não irá funcionar no Windows. No Windows, deverá usar as aspas (") em alternativa. In this context only the Neste contexto apenas o comando de substituição do sed substitute command is used: - será usado: + sed 's/REGEXPEXPREG/REPLACEMENTSUBSTITUTO/FLAGS' -Before you use a new command within &kdiff3;, you should first test it in a console. Here the OPÇÕES' + Antes de você usar um comando novo no &kdiff3;, deverá primeiro testá-lo numa consola. Aqui, o comando echo-command is useful. Example: - - é útil. Exemplo: + echo abrakadabra | abracadabra | sed 's/a/o/' -obrakadabra - -This example shows a very simple sed-command that replaces the first occurance of a with o. If you want to replace all occurances then you need the g flag: - - obracadabra + Este exemplo mostra um comando 'sed' muito simples que substitui a primeira ocorrência do "a" por um "o". Se quiser substituir todas as ocorrências, então irá necessitar da opção "g": + echo abrakadabra | abracadabra | sed 's/a/o/g' -obrokodobro - -The | symbol is the pipe-command that transfers the output of the previous command to the input of the following command. If you want to test with a longer file then you can use obrocodobro + O símbolo "|" é o 'pipe' ou canal que transfere o resultado do comando anterior para os dados de entrada do comando seguinte. Se quiser testar com um ficheiro maior, então poderá usar o cat on Unix-like systems or no sistemas do tipo do Unix ou o type on &Windows;-like systems. nos sistemas do tipo Windows. O sed will do the substitution for each line. - - irá fazer a substituição para cada linha. cat filename |ficheiro | sed options - - +>opções + + <title >Ignorar Outros Tipos de Comentários Currently &kdiff3; understands only C/C++ comments. Using the Line-Matching-Preprocessor-Command you can also ignore other types of comments, by converting them into C/C++-comments. - - -To ignore comments starting with De momento, o &kdiff3; só compreende comentários de C/C++. Se usar o comando "Pré-Processador de Correspondência de Linhas", poderá também ignorar outros tipos de comentários, convertendo-os em comentários de C/C++. Exemplo: Para ignorar comentários que comecem por "#", poderá convertê-los para "//". Lembre-se que terá também de activar a opção "Ignorar os Comentários de C/C++" para obter efeito. Um comando "Pré-Processador de Correspondência de Linhas" seria: + sed 's/#/\/\//' + Dado que para o sed o carácter / tem um significado especial, é necessário colocar o carácter \ antes de cada / no texto de substituição. Algumas das vezes o \ é necessário para adicionar ou remover um significado especial para certos caracteres. As plicas simples (') antes e depois do comando de substituição são importantes, caso contrário a linha de comandos iria tentar interpretar alguns caracteres especiais como o #, you would like to convert them to //. Note that you also must enable the Ignore C/C++-Comments option to get an effect. An appropriate Line-Matching-Preprocessor-Command would be: - -, o $ ou o \ antes de os passar para o sed 's/#/\/\//' - - -Since for sed the / character has a special meaning, it is necessary to place the \ character before each / in the replacement string. Sometimes the \ is required to add or remove a special meaning of certain characters. The single quotation marks (') before and after the substitution-command are important now, because otherwise the shell will try to interpret some special characters like #, $ or \ before passing them to sed. Note that on &Windows; you will need the double quotation marks (. Lembre-se que no &Windows; irá necessitar aqui das aspas (") here. &Windows; substitutes other characters like ). O &Windows; substitui os outros caracteres como o %, so you might have to experiment a little bit. +>, por isso você terá de fazer algumas experiências. - Diff sem Distinguir Capitalização - Use the following Line-Matching-Preprocessor-Command to convert all input to uppercase: - -Use o comando "Pré-Processador de Correspondência de Linhas" para converter todo o texto para maiúsculas: + sed 's/\(.*\)/\U\1/' - -Here the 's/\(.*\)/\U\1/' + Aqui o .* is a regular expression that matches any string and in this context matches all characters in the line. The é uma expressão regular que corresponde a qualquer texto e, no seu contexto, irá corresponder a todos os caracteres da linha. O \1 in the replacement string refers to the matched text within the first pair of no texto de substituição refere-se ao texto correspondente ao primeiro par de \( and e \). The . O \U converts the inserted text to uppercase. +> converte o texto inserido para maiúsculas. Ignorar as Palavras-Chave do Controlo de Versões CVS and other version control systems use several keywords to insert automatically generated strings (O CVS e outros sistemas de controlo de versões usam várias palavras-chave para inserir texto gerado automaticamente (info:/cvs/Keyword substitution). All of them follow the pattern $KEYWORD generated text$. We now need a Line-Matching-Preprocessor-Command that removes only the generated text: -). Todas elas seguem o padrão "$PALAVRACHAVE texto gerado$". É preciso agora um comando Pré-Processador de Correspondência de Linhas que remova apenas o texto gerado: + sed 's/\$\(Revision\|Author\|Log\|Header\|Date\).*\$/\$\1\$/' - -The \| separates the possible keywords. You might want to modify this list according to your needs. The \ before the $ is necessary because otherwise the $ matches the end of the line. +> 's/\$\(Revision\|Author\|Log\|Header\|Date\).*\$/\$\1\$/' + O "\|" separa as palavras-chave possíveis. Poderá querer modificar esta lista de acordo com as suas necessidades. O "\" antes do "$" é necessário, caso contrário o "$" irá corresponder ao fim da linha. Ao experimentar com o sedIgnorar os Números Ignoring numbers actually is a built-in option. But as another example, this is how it would look as a Line-Matching-Preprocessor-command. -A indiferença em relação aos números é de facto uma opção incorporada. Mas, como outro exemplo, seria assim como iria ficar como um comando do Pré-Processador da Correspondência de Linhas. + sed 's/[0123456789.-]//g' -Any character within [ and ] is a match and will be replaced with nothing. +> 's/[0123456789.-]//g' + Todos os caracteres dentro de '[' e ']' são uma correspondência e será substituído por nada. Ignorar Certas Colunas Sometimes a text is very strictly formatted, and contains columns that you always want to ignore, while there are other columns you want to preserve for analysis. In the following example the first five columns (characters) are ignored, the next ten columns are preserved, then again five columns are ignored and the rest of the line is preserved. - -Em algumas ocasiões um determinado texto tem uma formatação demasiado restrita e contém colunas que deseja sempre ignorar, enquanto que existem outras colunas que deseje preservar para análise. No exemplo seguinte, as primeiras cinco colunas (caracteres) são ignoradas, as próximas dez são preservadas, depois as próximas cinco colunas serão ignoradas de novo e o resto da linha é preservada. + sed 's/.....\(..........\).....\(.*\)/\1\2/' - -Each dot . matches any single character. The \1 and \2 in the replacement string refer to the matched text within the first and second pair of \( and \) denoting the text to be preserved. +> 's/.....\(..........\).....\(.*\)/\1\2/' + Cada ponto '.' corresponde a um único carácter. O "\1" e o "\2" no texto de substituição refere-se ao texto correspondente dentro do primeiro e segundo par de "\(" e "\)", demarcando o texto a ser preservado. Combinar Várias Substituições - Sometimes you want to apply several substitutions at once. You can then use the semicolon ; to separate these from each other. - -Em algumas situações você deseja aplicar várias substituições de uma vez. Poderá então usar o ponto-e-vírgula ";" para separar uma da outra. Exemplo: echo abrakadabra | abracadabra | sed 's/a/o/g;s/\(.*\)/\U\1/' -OBROKODOBRO - + -> OBROCODOBRO + + sed Instead of Em vez do sed you might want to use something else like , você poderá querer usar algo diferente como o perl. -. + perl -p -e 's/REGEXPEXPREG/REPLACEMENTSUBSTITUTO/FLAGS' -But some details are different in OPÇÕES' + Porém, alguns detalhes são diferentes no perl. Note that where . Repare que, onde o sed needed \( and \) necessitava do "\(" e do "\)", o perl requires the simpler ( and ) without preceding \. - - necessita dos "(" e ")" mais simples e sem o '\' precedente. Exemplo: sed 's/\(.*\)/\U\1/' -perl -p -e 's/(.*)/\U\1/' - +> -p -e 's/(.*)/\U\1/' + + @@ -1922,15 +1883,7 @@ Os comandos do pré-processador são normalmente muito úteis, mas como acontece com qualquer opção que modifica os seus textos ou esconde algumas diferenças automaticamente, você poderá saltar por cima de certas diferenças e, no pior dos casos, destruir dados importantes. For this reason during a merge if a normal preprocessor-command is being used &kdiff3; will tell you so and ask you if it should be disabled or not. But it won't warn you if a Line-Matching-Preprocessor-command is active. The merge will not complete until all conflicts are solved. If you disabled Show White Space then the differences that were removed with the Line-Matching-Preprocessor-command will also be invisible. If the Save-button remains disabled during a merge (because of remaining conflicts), make sure to enable Show White Space. If you don't wan't to merge these less important differences manually you can select Choose [A|B|C] For All Unsolved Whitespace Conflicts in the Merge menu. +>Por esta razão, durante uma junção, se for usado um comando pré-processador normal, o &kdiff3; dizer-lhe-á isso e perguntar-lhe-á se deverá ser desactivado ou não. Mas não o irá avisar se estiver um Pré-Processador de Correspondência de Linhas activo. A junção não irá ficar completa até que todos os conflitos tenham sido resolvidos. Se tiver desactivado o "Mostrar os Espaços em Branco", então as diferenças que foram removidas com o Pré-Processador de Correspondência de Linhas ficarão também invisíveis. Se o botão para Gravar continuar inactivo durante uma junção (devido a conflitos por resolver), verifique se activa o "Mostrar os Espaços em Branco". Se não quiser juntar essas diferenças menos importantes poderá escolher a opção "Escolher [A|B|C] nos Conflitos de Espaço em Branco por Resolver" no menu "Juntar". @@ -1941,11 +1894,11 @@ >Comparação e Junção de Directorias com o &kdiff3; Introdução +>Introdução à Comparação ou Junção de Pastas Normalmente, os programadores precisam de modificar vários ficheiros numa pasta para atingir os seus fins. Para isso, o &kdiff3; também lhe permite comparar e juntar várias pastas de forma recursiva! Even though comparing and merging directories seems to be quite obvious, there are several details that you should know about. Most important is of course the fact that now many files might be affected by each operation. If you don't have backups of your original data, then it can be very hard or even impossible to return to the original state. So before starting a merge, make sure that your data is safe, and going back is possible. If you make an archive or use some version control system is your decision, but even experienced programmers and integrators need the old sources now and then. And note that even though I (the author of &kdiff3;) try to do my best, I can't guarantee that there are no bugs. According to the GNU GPL there is NO WARRANTY whatsoever for this program. So be humble and always keep in mind: +>Ainda que a comparação e junção de pastas pareça ser bastante óbvia, existem vários detalhes que o utilizador deverá conhecer. O mais importante é, obviamente, o facto de que vários ficheiros poderão ser afectados por cada operação. Se não tiver cópias de segurança dos seus dados originais, então poderá ser bastante difícil ou mesmo impossível de voltar ao estado original. Por isso, antes de começar uma junção, certifique-se que os seus dados estão a salvo e que é possível voltar atrás. Se cria um pacote ou usa um sistema de controlo de versões é uma decisão sua, mas mesmo os programadores experientes e os integradores precisam do código antigo e do novo. E repare que até ao autor do &kdiff3; tenta fazer o seu melhor, mas não pode garantir que não existam erros. De acordo com a GPL da GNU, não existe NENHUMA GARANTIA de qualquer forma para este programa. Por isso, seja humilde e tenha sempre em mente:
... lets you run the selected operation for all items (key F7) or the selected item (key F6),... permite-lhe executar a operação seleccionada para todos os itens (tecla F7) ou para o item seleccionado (tecla F6), ... lets you continue the merge after manual interaction with key F7,... permite-lhe continuar a junção depois de uma interacção manual com a tecla F7, ... optionally creates backups, with the .orig extension,... cria opcionalmente cópias de segurança com a extensão ".orig", kdiff3 dir1 dir2 +>pasta1 pasta2 kdiff3 dir1 dir2 destdirpasta1 pasta2 -o destino kdiff3 dir1 dir2 dir3 +>pasta1 pasta2 pasta3 kdiff3 dir1 dir2 dir3 destdirpasta1 pasta2 pasta3 -o destino como pasta de destino para a junção. Note that only the comparison starts automatically, not the merge. For this you first must select a menu entry or the key F7. (More details later.) +>Repare que só a comparação é que começa automaticamente, não a junção. Para tal, terá de seleccionar primeiro um item do menu ou a tecla F7. (Mais detalhes posteriormente.) Visible Information +>Informação Visível da Junção de Pastas Ao ler as pastas, aparece uma mensagem que o informa do progresso. Se você interromper a pesquisa das pastas, então só os ficheiros que tenham sido comparados até então serão listados. Cada ficheiro e pasta encontrado durante a pesquisa é aqui mostrado numa árvore. Você poderá seleccionar um item se carregar nele uma vez com o rato. The directories are collapsed by default. You can expand and collapse them by clicking on the +/- or by double-clicking the item or by using the Left Arrow or Right Arrow keys. The Directory menu also contains two actions Fold all subdirs and Unfold all subdirs with which you can collapse or expand all directories at once. As pastas estão fechadas por omissão. Você poderá expandi-las e fechá-las se carregar no "+"/"-" ou se fizer duplo-click no item ou ainda usando as teclas de cursores esquerda/direita. O menu "Directoria" também contém duas acções "Fechar Todas as Sub-Directorias" e "Expandir Todas as Sub-Directorias", com as quais poderá fechar ou abrir todas as subpastas de uma vez. Se fizer duplo-click num item de um ficheiro, então a comparação do ficheiro irá começar e irá aparecer a janela de diferenças do ficheiro. The image in the name column reflects the file type in the first directory (A). It can be one of these: +>A imagem na coluna do nome reflecte o tio de ficheiro na primeira pasta ("A"). Poderá ser um dos seguintes: A Coluna de Operação After comparing the directories &kdiff3; also evaluates a proposal for a merge operation. This is shown in the Operation column. You can modify the operation by clicking on the operation you want to change. A small menu will popup and allows you to select an operation for that item. (You can also select the most needed operations via keyboard. Ctrl+1/2/3/4/Del will select A/B/C/Merge/Delete respectively if available.) This operation will be executed during the merge. It depends on the item and on the merge-mode you are in, what operations are available. The merge-mode is one of +>Depois de comparar as patas, o &kdiff3; avalia também uma proposta para uma operação de junção. Esta é mostrada na coluna de "Operação". O utilizador poderá modificar a operação se carregar na operação que deseja alterar. Irá aparecer um pequeno menu que lhe permite seleccionar uma operação para esse item (Poderá também seleccionar as operações mais necessárias através do teclado. O Ctrl+1/2/3/4/Del irá seleccionar o A/B/C/Juntar/Remover, respectivamente, se estiver disponível.) Esta operação será executada durante a junção. Depende do item e do modo de junção em que se encontra e de que operações estão disponíveis. O modo de junção é um dos seguintes Three directory-merge (A is treated as older base of both).Junção de três pastas (a "A" é tratada como a base mais antiga de ambas). Two directory-sync-mode (activate via option Synchronize Directories).Modo de sincronização de duas pastas (activado com a opção "Sincronizar as Directorias"). all three directories are equal: Copy from C... todas as três pastas forem iguais: Copiar do C A and C are equal but B is not: Copy from B (or if B does not exist, delete the destination if exists)... o A e o C são iguais mas o B não: Copiar a partir do B (ou se o B não existir, remover o destino se existir) A and B are equal but C is not: Copy from C (or if C does not exist, delete the destination if exists)... o A e o B são iguais mas o C não: Copiar a partir do C (ou se o C não existir, remover o destino se existir) B and C are equal but A is not: Copy from C (or if C does not exist, delete the destination if exists)... o B e o C são iguais mas o A não: Copiar a partir do C (ou se o C não existir, remover o destino se existir) only A exists: Delete the destination (if exists)... só o A existir: Remover o destino (se existir) only B exists: Copy from B... só o B existir: Copiar a partir do B only C exists: Copy from C... só o C existir: Copiar a partir do C A, B and C are not equal: Merge... o A, o B e o C não são iguais: Juntar A, B and C don't have the same file type (⪚ A is a directory, B is a file): Error: Conflicting File Types. While such items exist the directory merge cannot start.... o A, o B e o C não tiverem o mesmo tipo de ficheiro (⪚ o A é uma pasta e o B um ficheiro): "Erro: Tipo de Ficheiros em Conflito". Enquanto existirem itens nesta situação, a junção de pastas não poderá começar. both directories are equal: Copy from B... ambas as pastas forem iguais: Copiar do B A exists, but not B: Copy from A... o A existir, mas o B não: Copiar a partir do A B exists, but not A: Copy from B... o B existir, mas o A não: Copiar a partir do B A and B exist but are not equal: Merge... o A e o B existirem mas não forem iguais: Juntar A and B don't have the same file type (⪚ A is a directory, B is a file): Error: Conflicting File Types. While such items exist the directory merge cannot start.... o A e o B não tiverem o mesmo tipo de ficheiro (p.ex., o A é uma pasta e o B um ficheiro): "Erro: Tipo de Ficheiros em Conflito". Enquanto existirem itens nesta situação, a junção de pastas não poderá começar. Sync-mode is active if only two directories and no explicit destination were specified and if the option Synchronize directories is active. &kdiff3; then selects a default operation so that both directories are the same afterwards. If for an item +>O modo de sincronização só está activo se forem indicadas duas pastas e não se não for indicado nenhum destino explícito, assim como a opção "Sincronizar as directorias" terá de estar activa. Nesse caso, o &kdiff3; irá seleccionar uma operação por omissão, de modo a que ambas as pastas fiquem iguais no fim. Se, para um item ... both directories are equal: Nothing will be done.... ambas as pastas forem iguais: Não será feito nada. A exists, but not B: Copy A to B... o A existir mas o B não: Copiar o A para o B B exists, but not A: Copy B to A... o B existir mas o A não: Copiar o B para o A A and B exist, but are not equal: Merge and store the result in both directories. (For the user the visible save-filename is B, but then &kdiff3; copies B also to A.)... o A e o B existirem, mas não forem iguais: Juntar e guardar o resultado em ambas as pastas. (Para o utilizador, o nome do ficheiro gravado visível será o B, mas o &kdiff3; irá copiar o B também para o A.) A and B don't have the same file type (⪚ A is a directory, B is a file): Error: Conflicting File Types. While such items exist the directory merge cannot start.... o A e o B não tiverem o mesmo tipo de ficheiro (p.ex., o A é uma pasta e o B um ficheiro): "Erro: Tipo de Ficheiros em Conflito". Enquanto existirem itens nesta situação, a junção de pastas não poderá começar. When two directories are merged and the option Copy newer instead of merging is selected, then &kdiff3; looks at the dates and proposes to choose the newer file. If the files are not equal but have equal dates, then the operation will contain Error: Dates are equal but files are not. While such items exist the directory merge cannot start. +>Quando duas pastas forem reunidas e a opção "Copiar o mais recente em vez de juntar" estiver seleccionada, então o &kdiff3; irá olhar para as datas e irá optar por escolher o ficheiro mais recente. Se os ficheiros não forem iguais mas tiverem datas iguais, então a operação irá conter "Erro: As datas são iguais mas os ficheiros não.". Enquanto esses itens existirem a junção de pastas não poderá começar. A Coluna de Estado During the merge one file after the other will be processed. The status column will show Done for items where the merge operation has succeeded, and other texts if something unexpected happened. When a merge is complete, then you should make a last check to see if the status for all items is agreeable. +>Durante a junção, os ficheiros serão processados um a seguir ao outro. A coluna de estado irá mostrar "Terminado" para os itens em que a operação de junção foi bem sucedida e outros textos se algo ocorreu de inesperado. Quando se terminar uma junção, o utilizador deverá então fazer uma última verificação para confirmar se o estado de todos os itens é aceitável. Colunas de Estatísticas When the file comparison mode Full Analysis is enabled in the options, then &kdiff3; will show extra columns containing the numbers of unsolved, solved, nonwhite and whitespace conflicts. (The solved-column will only show when comparing or merging three directories.) +>Quando o modo de comparação de ficheiros "Análise Completa" estiver activo nas opções, então o &kdiff3; irá mostrar colunas extra que contêm o número de conflitos não resolvidos, resolvidos, de espaços em branco e dos outros conflitos. (A coluna de resolvidos só irá aparecer ao comparar ou ao juntar três pastas.) + + +Seleccionar os Ficheiros Listados +Diversas opções influenciam os ficheiros que são listados aqui. Algumas estão acessíveis na janela de configuração. O menu Directoria contém os itens: + "Mostrar os Ficheiros Idênticos": Os ficheiros que foram detectados como iguais em todas as pastas de entrada. + "Mostrar os Ficheiros Diferentes": Os ficheiros que existem em duas ou mais pastas, mas que não são iguais entre si. + "Mostrar os Ficheiros Apenas em A": Os ficheiros que existem apenas em A, mas não em B ou C. + "Mostrar os Ficheiros Apenas em B": Os ficheiros que existem apenas em B, mas não em A ou C. + "Mostrar os Ficheiros Apenas em C": Os ficheiros que existem apenas em C, mas não em A ou B. + +Active apenas as opções "Mostrar" para os itens que deseja listar. Se, por exemplo, quiser listar apenas os itens que existem ou em A ou em B, mas não em ambos, terá de activar o "Mostrar os Ficheiros Apenas em A" e "Mostrar os Ficheiros Apenas em B" e desactivar todos os outros ("Mostrar os Ficheiros Idênticos", "Mostrar os Ficheiros Diferentes", "Mostrar os Ficheiros Apenas em C"). A lista será actualizada imediatamente para reflectir as alterações. Estas opções também se aplicam nas pastas, com uma excepção: Se desactivar o "Mostrar os Ficheiros Diferentes" não irá esconder as pastas por completo. Isto só irá funcionar para os ficheiros dentro delas. Lembre-se que, destas opções, só a "Mostrar os Ficheiros Idênticos" é persistente. As outras ficam activas ao iniciar o &kdiff3;. @@ -2325,93 +2265,53 @@ Doing A Merge +>Fazer uma Junção de Pastas O utilizador tanto poderá reunir o item seleccionado de momento (ficheiro ou pasta) ou todos os itens. Quando tiver feito todas as suas opções de operação (em todas as subpastas também), aí então poderá iniciar a junção. Be aware that if you didn't specify a destination directory explicitely, then the destination will be C in three directory mode, B in two directory merge mode, and in sync-mode it will be A and/or B. Tenha em atenção que, se não tiver indicado explicitamente uma pasta de destino, então o destino será o "C" no modo de três pastas, o "B" no modo de junção de duas pastas e no modo de sincronização será o "A" e/ou o "B". Se tiver indicado uma pasta de destino, verifique também que todos os itens que deverão estar no resultado, estão na árvore respectiva. Existem algumas opções que fazem com que certos itens sejam omitidos na comparação e junção de pastas. Assinale estas opções para evitar surpresas desagradáveis: Recursive Directories: If this is off, then items in subdirectories will not be found."Directorias Recursivas": Se estiver desligada, então os itens em todas as subpastas não serão tratados. Pattern/Anti-Pattern: Include/exclude items that match"Padrão"/"Anti-Padrão": Inclui/exclui os itens que correspondam ao padrão Exclude Hidden Files"Excluir os Ficheiros Escondidos" List only Deltas: Files that match in all directories don't appear in the tree, and hence also not in the destination.As opções "Mostrar" (Mostrar os Ficheiros Iguais/Diferentes, Ficheiros apenas em A/B/C) (In the current version, you must do a rescan via menu DirectoryRescan yourself, after changing options affecting the directory scan.) Se mudar a configuração, para mostrar mais ficheiros, é preciso fazer uma nova pesquisa, com a opção "Directoria"->"Pesquisar de Novo". (A razão para tal é que o &kdiff3; omite a comparação dos ficheiros suprimidos por estes critérios.) Se mudou os seus padrões de ficheiros e pastas para excluir os ficheiros, então a lista de ficheiros será imediatamente actualizada, ao fechar a janela de opções. Lembre-se que, quando gravar numa pasta completamente nova, normalmente também irá querer copiar os ficheiros iguais. Nesse caso, active a opção "Mostrar os Ficheiros Iguais". Se a sua pasta de destino é uma das entradas, então não será necessário, porque o ficheiro já estará lá. Se estiver satisfeito até agora, o resto é simples. To merge all items: Select Start/Continue directory merge in the Directory menu or press F7 (which is the shortcut). To merge only the current item: Select Run Operation For Current Item or press F6. Para juntar todos os itens: Seleccione "Iniciar/Continuar a junção da directoria" no menu "Directoria" ou carregue em F7 (que é o atalho). Para juntar apenas o item actual: Seleccione "Executar a Operação no Item Actual" ou carregue em F6. Se, devido à existência de tipos de ficheiro em conflito, ainda permanecerem alguns itens com operações inválidas, então irá aparecer uma mensagem onde serão evidenciados esses itens, para que possa seleccionar uma operação válida para cada item. If you merge all items a dialog will appear giving you the options Do it, Simulate it and Cancel. +>Se juntar todos os itens, irá aparecer uma janela que lhe apresenta as opções "Fazê-lo", "Simulá-lo" e "Cancelar". Select Simulate it if you want to see what would be done without actually doing it. A verbose list of all operations will be shown.Seleccione "Simulá-lo" se quiser ver o que seria feito sobre o item sem aplicar de facto as modificações. Será apresentada uma lista descritiva com todas as operações. Otherwise select Do it to really start merging.Caso contrário, seleccione "Fazê-lo" para iniciar de facto a junção. ver a imagem grande). When you have finished with a file, again select Start/Continue directory merge or the key F7. If you haven't saved yet, a dialog will ask you to do so. Then &kdiff3; will continue with the next item. Quando tiver terminado um ficheiro, seleccione de novo "Iniciar/Continuar a junção da directoria" ou a tecla F7. Se não tiver ainda gravado nada, irá aparecer uma janela a pedir-lhe isso. Aí, o &kdiff3; irá passar ao próximo item. When &kdiff3; encounters an error, it will tell you so and will show the verbose-status-information. At the bottom of this list, there will be some error messages which should help you to understand the cause of the problem. When you continue merging (F7 key) &kdiff3; will give you the choice to retry or skip the item that caused the problem. This means that before continuing you can choose another operation or solve the problem by other means. Quando o &kdiff3; encontrar um erro, indicar-lhe-á tal facto e irá mostrar a informação descritiva do estado. No fundo desta lista, existirão algumas mensagens de erro que o deverão ajudar a compreender a causa do problema. Quando continuar a junção (com a tecla F7), o &kdiff3; indicar-lhe-á a opção para repetir ou saltar o item que causou o problema. Isto significa que, antes de continuar, poderá escolher outra operação ou resolver o problema por outros meios. Quando a junção estiver completa, o &kdiff3; informá-lo-á então com uma mensagem. If some items were merged individually then &kdiff3; remembers this (while this merge-session goes on), and doesn't merge them again when later the merge for all items is run. Even when the merge was skipped or nothing was saved these items count as completed. Only when you change the merge operation the item will be merged again. +>Se alguns dos itens foram reunidos individualmente, então o &kdiff3; irá recordar isto (enquanto esta sessão de junção prosseguir) e não os juntará de novo, até que a junção para todos os itens tenha sido executada. Mesmo quando a junção tenha sido ignorada ou não tenha sido gravado nada, estes itens irão contar como completos. Só quando tiver alterado a operação de junção é que o estado de "Pronto" do item será removido e este poderá ser reunido de novo. Opções para Comparar e Juntar Pastas The &kdiff3; preferences (menu SettingsConfigure KDiff3) now has a section called Directory Merge with these options: +>As preferências do &kdiff3; (no menu "Configuração"->"Configurar o &kdiff3;") têm agora uma secção intitulada "Junção de Directorias" com as seguintes opções: Directorias Recursivas:Directorias Recursivas: Padrões de Ficheiros:Padrões de Ficheiros:Only files that match any pattern here will be put in the tree. More than one pattern may be specified here via using the semicolon ; as separator. Valid wildcards: * and ?. (⪚ *.cpp;*.h). Default is *. Directories need not match this pattern.Só os ficheiros que correspondam ao padrão ou padrões aqui indicados é que serão colocados na árvore. Poderá ser indicado mais do que um padrão através do separador ponto-e-vírgula ";". São considerados caracteres especiais válidos o "*" e o "?". (⪚ "*.cpp;*.h"). Por omissão, este campo é igual a "*". As pastas não precisam de corresponder a este padrão. Anti-Pattern(s):Anti-Padrões de Ficheiros:Files and directories that match this pattern will be excluded from the tree. More than one pattern may be specified here via using the semicolon ; as separator. Valid wildcards: * and ?. Default is *.orig;*.o.Os ficheiros que correspondam ao padrão ou padrões aqui indicados serão excluídos da árvore. Poderá ser indicado mais do que um padrão através do separador ponto-e-vírgula ";". São considerados caracteres especiais válidos o "*" e o "?". Por omissão, este campo é igual a "*.orig;*.o;*.obj". Usar CVS-Ignore:Anti-Padrões da Directoria:Ignore files and directories that would also be ignored by CVS. Many automatically generated files are ignored by CVS. The big advantage is that this can be directory specific via a local .cvsignore file. (See As pastas que correspondam ao padrão ou padrões aqui indicados serão excluídas da árvore. Poderá ser indicado mais do que um padrão através do separador ponto-e-vírgula ";". São considerados caracteres especiais válidos o "*" e o "?". Por omissão, este campo é igual a "CVS;deps;.svn". + Usar CVS-Ignore:Ignora os ficheiros e pastas que são também ignorados pelo CVS. Muitos dos ficheiros gerados automaticamente são ignorados pelo CVS. A grande vantagem é que esta funcionalidade é específica para cada pasta através de um ficheiro ".cvsignore" local. (Veja em info:/cvs/cvsignore.) Procurar os Ficheiros e Directorias Escondidos:Procurar os Ficheiros e Directorias Escondidos:On some filesystems files have an Hidden attribute. On other systems a filename starting with a dot (.) causes it to be hidden. This option allows you to decide whether to include these files in the tree or not. Default is on.Em alguns sistemas de ficheiros, existe um atributo "Escondido". Em outros sistemas, um nome de ficheiro que comece por "." faz com que este seja considerados escondido. Esta opção permite-lhe decidir se deve incluir estes ficheiros na árvore ou não. Por omissão, são incluídos. Seguir as Ligações de Ficheiros:Seguir as Ligações de Ficheiros: Seguir as Ligações de Directorias:Seguir as Ligações de Directorias:For links to directories: When disabled, then the symbolic links will be compared. When enabled then the link will be treated like a directory and it will be scanned recursively. (Note that the program doesn't check if the link is recursive. So for example a directory that contains a link to the directory would cause an infinite loop, and after some time when the stack overflows or all memory is used up, crash the program.) Default is off.Para as ligações a pastas: Quando a opção estiver desactivada, as ligações simbólicas serão comparadas. Se estiver activa, então a ligação será tratada como uma pasta e será pesquisada recursivamente. (Lembre-se que o programa não verifica se a ligação é "recursiva". Por isso, se uma pasta contiver por exemplo uma ligação para ela própria irá causar um ciclo infinito, pelo que ao fim de algum tempo a pilha estoira ou toda a memória será usada e o programa irá estoirar deste modo). Por omissão, a opção está desligada. +> List only deltas:Comparação de Nomes de Ficheiros com Distinção de Maiúsculas:Only items that are not equal in all input directories will be listed and only the changed files are visible. Hence files that are equal in all directories won't be copied during a merge and if the destination dir does not contain the files before the merge, you might miss some files later. (This option is likely to be changed in a later version.) Default is off.Por omissão, é falso no Windows e verdadeiro nos outros sistemas operativos. - Modo de Comparação de Ficheiros:Modo de Comparação de Ficheiros: @@ -2574,8 +2438,8 @@ > Comparação Binária:Comparação Binária: Análise Completa:Análise Completa: Confiar na data de modificação:Confiar na data de modificação: Confiar no tamanho:Confiar no tamanho:Sincronizar as Directorias:Sincronizar as Directorias: Copiar o mais recente em vez de juntar:Copiar o mais recente em vez de juntar:Instead of merging the proposed operation will copy the newer source if changes happened. (Considered unsafe, because it implies that the knowledge, that the other file hasn't been edited too. Check to make sure in every case.) Default is off.Em vez de juntar, a operação proposta irá copiar os ficheiros mais recentes se ocorreram algumas alterações. (É considerado inseguro, porque implica saber se o outro ficheiro não foi também alterado. Verifique para se certificar em qualquer um dos casos.). Por omissão, a opção está desligada. Ficheiros de segurança:Ficheiros de segurança:If a file or complete directory is replaced by another or is deleted then the original version will be renamed with an .orig extension. If an old backup file with .orig extension already exists then this will be deleted without backup. This also affects the normal merging of single files, not only in directory-merge mode. Default is on.Se um ficheiro ou uma pasta completa for substituído por outro ou for removido, então a versão original mudará para um nome com uma extensão ".orig". Se já existir um ficheiro antigo com uma extensão ".orig", então este será removido sem ser criada nenhuma cópia de segurança. Isto também afecta a junção normal de ficheiros simples, não só no modo de junção de pastas. Por omissão, a opção está activa. @@ -2658,41 +2518,33 @@ Other Functions +>Outras Funções na Janela de Junção de Pastas Modo de Ecrã Repartido/Completo Usually the directory merge list view remains visible while a single file is compared or merged. With the mouse you can move the the splitter bar that separates the file list from the text-diff windows. If you don't want this, you can disable Split Screen View in the Directory menu. Then you can use Toggle View in the Directory menu to switch between the file list and the text-diff view that then occupy the full screen. +>Normalmente a lista de junção da pasta fica visível enquanto um único ficheiro é comparado ou reunido. Com o rato, o utilizador poderá mover a barra separadora que delimita a lista de ficheiros das janelas de diferenças do texto. Se não a quiser, poderá desactivar a "Janela Repartida" no menu "Directoria". Aí, poderá usar a opção "Comutar a Vista" no menu "Directoria" para alternar entre a lista de ficheiros e a janela de diferenças no texto que irá então ocupar o ecrã completo. Comparar ou Juntar um Único Ficheiro Probably you will prefer a simple double mouse click on a file in order to compare it. Nevertheless there also exists an entry in the Directory menu. You can also directly merge a single file, without starting the directory merge via the Merge single file in the Directory Menu. On saving the result, the status will be set to done, and the file will not be merged again if a directory merge is started. Provavelmente, você irá preferir um duplo-click do rato simples sobre um ficheiro para o poder comparar. Contudo, existe também um item no menu "Directoria". Poderá também juntar directamente um único ficheiro sem iniciar a junção de pastas, através da opção "Juntar o ficheiro actual" do menu "Juntar". Ao gravar o resultado, o estado ficará como terminado e o ficheiro não será reunido de novo se for iniciada uma junção de pastas. But note that this status information will be lost when you rerun a directory scan: DirectoryRescan +>Mas repare que esta informação de estado será perdida quando voltar a executar uma pesquisa de pastas: menu "Directoria"->"Pesquisar de novo" +Comparar ou Juntar Ficheiros com Nomes Diferentes +Em alguns casos, terá de comparar ou juntar ficheiros com nomes diferentes (p.ex., o ficheiro actual e a cópia de segurança na mesma pasta). Seleccione o ficheiro exacto, carregando no ícone na coluna A, B ou C. O primeiro ficheiro seleccionado será então marcado com um "A", enquanto o segundo e o terceiro ficará com um "B" e um "C", independentemente da coluna em que se encontram. Só poderá escolher até três ficheiros desta forma. Siga com a escolha de "Comparar os Ficheiros Explicitamente Seleccionados" ou "Juntar os Ficheiros Explicitamente Seleccionados" no menu "Pasta". Por conveniência, estes itens de menu também aparecem como um menu de contexto, quando carregar com o botão direito no último ficheiro seleccionado. A comparação ou junção de um ficheiro irá acontecer na mesma janela. Se este método for usado para as pastas, será aberta uma nova janela. @@ -2701,12 +2553,12 @@ >Tópicos Diversos Network Transparency via KIO +>Transparência na rede através do KIO KIO-Slaves &kde; supports networktransparency via KIO-slaves. &kdiff3; uses this for reading input files and for scanning directories. This means that you can specify files and directories on local and remote resources via &URL;s. O KDE suporta a transparência na rede através dos 'KIO-slaves'. O &kdiff3; usa isto para ler os ficheiros de entrada e para pesquisar as pastas. Isto significa que você poderá indicar ficheiros e pastas em recursos locais e remotos através dos URLs. Exemplo: @@ -2720,7 +2572,7 @@ The first line compares a local file with a file on an &FTP; server. The second line compares a directory within an compressed archive with a local directory. A primeira linha compara um ficheiro local com outro ficheiro num servidor de FTP. A segunda linha compara uma pasta dentro de um pacote comprimido com uma pasta local. Outros 'KIO-slaves' que serão interessantes: @@ -2738,7 +2590,7 @@ > Windows-resources (smb:),Recursos do Windows (smb:), How To Write &URL;s +>Como Escrever URLs A &URL; has a different syntax compared with paths for local files and directories. Some things should be considered: +>Um dado URL tem uma sintaxe diferente, em comparação com as localizações dos ficheiros e pastas locais. Alguns factores terão de ser tidos em consideração: A path can be relative and can contain . or ... This is not possible for &URL;s which are always absolute. Uma localização poderá ser relativa e conter "." ou "..". Isto não é possível para os URLs, dado que estes são sempre absolutos. Special characters must be written with escaping. (# becomes %23, spaces become %20 and so on.) ⪚ A file with the name /#foo# would have the &URL; file:///%23foo%23. Os caracteres especiais têm de ser escritos "escapados". ("#"->"%23", espaço->"%20", etc.) ⪚ Um ficheiro com o nome "/#xpto#" iria ter o URL "file:/%23xpto%23". When &URL;s don't work as expected, try to open them in &konqueror; first. Quando os URLs não funcionarem como seria de esperar, tente abri-los primeiro no Konqueror. @@ -2801,9 +2637,9 @@ >Capacidades dos 'KIO-Slaves' Network transparency has one drawback: Not all ressources have the same capabilities. A transparência na rede tem um senão: nem todos os recursos têm as mesmas capacidades. Sometimes this is due to the filesystem of the server, sometimes due to the protocol. Here is a short list of restrictions: +>Algumas das vezes estas são devidas ao sistema de ficheiros do servidor, enquanto que noutras ocasiões poderá ser devido ao protocolo. Aqui está uma pequena lista das restrições: Usar o &kdiff3; como uma KPart &kdiff3; is a KPart. Currently it implements the KParts::ReadOnlyPart interface. O &kdiff3; é uma KPart. De momento, implementa a interface "KParts::ReadOnlyPart". It's main use is as difference-viewer in KDevelop. Kdevelop always starts the internal difference viewer first. To invoke &kdiff3; press the &RMB; on the difference viewer window and select Show in KDiff3Part from the contextmenu. A sua utilização principal é como visualizador de diferenças no KDevelop. O KDevelop inicia sempre o visualizador de diferenças interno em primeiro lugar. Para invocar o &kdiff3;, carregue com o botão direito do rato na janela do visualizador de diferenças e seleccionar "Mostrar no KDiff3Part" no menu de contexto. O &kdiff3; necessita normalmente de dois ficheiros completos como entrada. Se for usado como componente KPart, o &kdiff3; irá assumir que o ficheiro de entrada é um ficheiro de 'patch' no formato unificado. O &kdiff3; irá então obter os nomes dos ficheiros originais do ficheiro de 'patch'. Pelo menos um dos dois ficheiros terá de estar disponível. O &kdiff3; irá então invocar o patch para criar de novo o segundo ficheiro. In &konqueror; you can select a patch file and select Preview inKDiff3Part from the contextmenu. Be aware that this won't work if none of the original files are available, and it is not reliable if the original file(s) have changed since the patch-file was generated. No Konqueror;, o utilizador poderá seleccionar um ficheiro de 'patch' e seleccionar "Antevisão em"-"KDiff3Part" no menu de contexto. Tenha em atenção que isto não irá funcionar se nenhum dos ficheiros originais estiver disponível e não é fiável se os ficheiros originais tiverem sido alterados desde que o ficheiro de 'patch' foi gerado. When run as a part &kdiff3; only provides the a two file diff, a very small toolbar and menu. Merging or directory comparison are not supported. +>Quando é executado como um componente, o &kdiff3; só oferece uma diferença de dois ficheiros, uma barra de ferramentas muito pequena e um menu. A junção ou a comparação de pastas não é suportada nesse caso. @@ -2869,34 +2691,22 @@ Why is it called &kdiff3;? Porque é que se chama "&kdiff3;"? Tools named KDiff and KDiff2 (now called &kompare;) already exist. Also &kdiff3; should suggest that it can merge like the diff3 tool in the Diff-Tool collection. As ferramentas "KDiff" e "KDiff2" (agora chamada Kompare;) já existiam. Para além disso, o &kdiff3; deveria sugerir que consegue juntar ficheiros como a ferramenta "diff3" da colecção de ferramentas do Diff. Why did I release it under GPL? Porque é que é lançado segundo a GPL? I'm using GPL programs for a very long time now and learned very much by having a look at many of the sources. Hence this is my Thank You to all programmers that also did so or will do the same. O autor usou programas GPL durante bastante tempo até agora e aprendeu bastante ao olhar para bastante código. Daí, este é o "Muito Obrigado" para todos os programadores que também o fizeram ou irão fazer no futuro. @@ -2907,15 +2717,7 @@ >You compiled from source but you probably didn't specify the correct &kde; prefix with configure. By default configure wants to install in /usr/local but then &kde; can't find the user interface ressource file (&ie; kdiff3ui.rc). The README file contains more information about the correct prefix. Você compilou a partir do código mas não indicou provavelmente o prefixo correcto do KDE com o "configure". Por omissão, o "configure" deseja instalar no "/usr/local", mas aí o KDE não consegue encontrar o ficheiro de recursos da interface do utilizador (isto é, o "kdiff3ui.rc"). O ficheiro README contém mais informações sobre o prefixo correcto. @@ -2926,11 +2728,9 @@ >Lines where only the amount of white space characters is different are treated as equalat first, while just one different non-white character causes the lines to be different. If similar lines appear next to each other, this actually is coincidence but this fortunately is often the case. As linhas em que apenas a quantidade de espaços em branco é diferente são tratadas como "iguais" à primeira vista, embora apenas um carácter que não seja um espaço em branco faça com que as linhas sejam "diferentes". Se as linhas semelhantes aparecerem uma ao lado da outra, isto poderá ser de facto uma coincidência, mas é felizmente o caso mais frequente. Veja também em Ajuda das Diferenças Manuais. @@ -2948,9 +2748,20 @@ Why does the editor in the merge result window not have an undo function? Como é que posso sincronizar as janelas de diferenças e junção, de modo que todas mostrem a mesma posição de texto? Carregue na coluna de resumo à esquerda do texto. (Veja também aqui.) + +Porque é que o editor na janela do resultado da junção não tem uma função para "desfazer"? When I removed some text, then suddenly <No src line> appeared and can't be deleted. What does that mean and how can one remove this? Quando eu removi algum texto, apareceu de repente "<Sem linha de origem>" e esta não pode ser removida. O que é que significa e como é que se poderá removê-la? For each equal or different section the editor in the merge result window remembers where it begins or ends. <No src line> means that there is nothing left in a section, not even a new line character. This can happen either while merging automatically or by editing. This is no problem, since this hint won't appear in the saved file. If you want the orignal source back just select the section (click on the left summary column) and then click the source button with the needed contents (A/B or C). Para cada secção igual ou diferente, o editor na janela do resultado da junção recorda onde é que esta começa ou termina. O "<Sem linha de origem>" significa que não existe mais nada livre numa secção, nem mesmo um carácter de mudança de linha. Isto poderá acontecer durante a junção automática ou durante a edição. Isto não é nenhum problema, dado que esta dica não irá aparecer no ficheiro gravado. Se você quiser os dados originais de volta, basta seleccionar a secção (carregue na coluna de resumo à esquerda) e depois no botão da origem com o conteúdo necessário (A/B ou C). @@ -2987,6 +2794,51 @@ Posso usar o &kdiff3; para comparar ficheiros do OpenOffice.Org, Word, Excel, PDF, &etc;? Ainda que o &kdiff3; analise qualquer tipo de ficheiro, o resultado poderá não ser muito satisfatório para si. O &kdiff3; foi feito para comparar ficheiros de texto puros. O OpenOffice, Word, Excel etc. gravam muito mais informação nos ficheiros (acerca dos tipos de letra, imagens, páginas, cores, etc.), que o &kdiff3; não conhece. Deste modo, o &kdiff3; mostrar-lhe-á o conteúdo do ficheiro interpretado como texto puro, mas este poderá estar ilegível ou, pelo menos, ficará muito esquisito. Dado que a maioria dos programas, nos dias de hoje, gravam o seu conteúdo no formato XML, poderá ser capaz de os ler como texto puro. Por isso, se a alteração foi pequena, o &kdiff3; podê-lo-á ajudar à mesma. A melhor solução, se quiser apenas comparar o texto (sem as imagens incorporadas, como as imagens), é usar o "Seleccionar Tudo" e o "Copiar" no seu programa, para copiar o texto interessante para a área de transferência e depois, no &kdiff3;, colar o texto em qualquer uma das janelas de entrada. (Veja também o Seleccionar, Copiar e Colar.) + +Para onde foi a opção de pastas "Listar apenas os deltas"? Existem agora várias opções "Mostrar" no menu de pastas. Se desactivar o "Mostrar os ficheiros iguais", irá obter o resultado que o "Listar apenas os deltas" fazia. + +Como é que faço uma grande selecção na janela de entrada de diferenças, dado que o deslocamento leva tanto tempo? Comece a selecção da forma normal (carregue e mantenha o botão esquerdo do rato carregado). Depois, use as teclas de navegação (p.ex., o Page Up, Page Down), enquanto mantém carregado o botão esquerdo do rato. (Veja também em Seleccionar, Copiar e Colar.) + +Existe demasiada informação aqui, mas a sua dúvida ainda não foi respondida? &kdiff3; - Ferramenta de Comparação e Junção de Ficheiros e Pastas Program copyright 2002-2005 Joachim Eibl joachim.eibl@gmx.dePrograma com 'copyright' 2002-2006 de Joachim Eibl joachim.eibl at gmx.de Vieram várias ideias giras e relatórios de erros dos colegas do autor e de pessoas da Wild Wild Web. Muito obrigado! Documentação Copyright © 2002-2005 Joachim Eibl Documentação Copyright © 2002-2006 Joachim Eibl joachim.eibl at gmx.de @@ -3047,23 +2899,64 @@ >Requisitos In order to successfully use all features of &kdiff3;, you need &kde; 3.1 or greater. Para poder usar todas as funcionalidades com sucesso do &kdiff3;, precisa do &kde; 3.1 ou posterior. For information about how to run &kdiff3; on other platforms without &kde; please see the homepagePara mais informações sobre como correr o &kdiff3; noutras plataformas sem o KDE, veja por favor a página pessoal. You can find a list of changes at O utilizador poderá encontrar uma lista das alterações em http://kdiff3.sourceforge.net/ChangeLog or in the ChangeLog file of the source package. +> ou no ficheiro "ChangeLog" do pacote de código. Compilação e Instalação -&install.compile.documentation; + +Para poder compilar e instalar o &kdiff3; num sistema com o KDE, escreva o seguinte na pasta de base da distribuição do &kdiff3;: + +% ./configure --prefix=kde-dir +% make +% make install + +O kde-dir corresponde à pasta que contém o KDE no seu sistema. Se não tiver a certeza, leia o ficheiro README para mais detalhes. +Se não usar o KDE, não use o configure, mas siga sim as instruções dos sistemas apenas em Qt, no ficheiro README. +Dado que o &kdiff3; usa o autoconf e o automake, você não deverá ter problemas a compilá-lo. No caso de ter alguns problemas, por favor comunique-os nas listas de correio do &kde;. + + + &documentation.index; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/doc/sv/index.docbook --- a/kdiff3/doc/sv/index.docbook Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/doc/sv/index.docbook Sat Nov 04 00:05:00 2006 +0000 @@ -68,9 +68,9 @@ Do NOT change these in the translation. --> 2006-04-09 +>2006-05-14 0.9.89 +>0.9.90 @@ -700,13 +700,13 @@ >Sammanfoga automatiskt nyckelord för versionshantering och historik (logg)Many version control systems support special keywords in the file. (e.g. "$Date$", "$Header$", "$Author$", "$Log$" etc.) During the check-in the version control system (VCS) changes these lines. For instance "$Date$" will turn into "$Date$". Since this line will be different in every version of the file, it would require manual interaction during the merge. MÃ¥nga versionshanteringssystem stöder särskilda nyckelord i filen (t.ex. "$Date$", "$Header$", "$Author$", "$Log$" etc.) Vid arkivering ändrar versionshanteringssystemet (VCN) dessa rader. Till exempel ändras "$Date$" till "$Date: 2005/03/22 18:45:01 $". Eftersom raden är olika i varje version av filen, skulle den kräva manuell interaktion under sammanfogningen. &kdiff3; erbjuder automatisk sammanfogning av dessa poster. För enkla rader som matchar alternativet "Reguljärt uttryck för automatisk sammanfogning" i alla indatafiler väljer &kdiff3; raden frÃ¥n B, eller om tillgänglig, den frÃ¥n C. (Dessutom är det nödvändigt att raderna i frÃ¥ga radas upp i jämförelsen och att föregÃ¥ende rad inte innehÃ¥ller en konflikt.) Den automatiska sammanfogningen kan antingen utföras omedelbart när sammanfogningen startas (aktivera alternativet "Kör automatisk sammanfogning med reguljärt uttryck när sammanfogning startar") eller senare via "Kör automatisk sammanfogning med reguljärt uttryck" i menyn Sammanfoga. Automatisk sammanfogning för versionshanteringshistorik (ocksÃ¥ kallat "logg") stöds ocksÃ¥. Automatisk sammanfogning av historik kan antingen utföras omedelbart när sammanfogningen startas genom att aktivera alternativet "Sammanfogning enligt versionshanteringshistorik när sammanfogning startar" eller senare via "Lös automatiskt historikkonflikter" i menyn Sammanfoga. Oftast börjar versionshanteringshistoriken med en rad som innehÃ¥ller nyckelordet "$Log$". Den mÃ¥ste matchas av alternativet "Reguljärt uttryck för historikens början". &kdiff3; detekterar vilka efterföljande rader som ingÃ¥r i historiken genom att analysera de inledande tecknen som fanns före nyckelordet "$Log$". Om samma "inledande kommentar" ocksÃ¥ finns pÃ¥ följande rader inkluderas de ocksÃ¥ i historiken. Oftast börjar versionshanteringshistoriken med en rad som innehÃ¥ller nyckelordet "$Log$". Den mÃ¥ste matchas av alternativet "Reguljärt uttryck för historikens början". &kdiff3; detekterar vilka efterföljande rader som ingÃ¥r i historiken genom att analysera de inledande tecknen som fanns före nyckelordet "$Log$". Om samma "inledande kommentar" ocksÃ¥ finns pÃ¥ följande rader inkluderas de ocksÃ¥ i historiken. Vid varje arkivering skriver VCS en unik rad som anger version, datum- och tidsinformation följd av rader med användarens kommentarer. Raderna utgör en historikpost. Historikavsnittet växer vid varje arkivering och de senaste posterna visas längst upp (efter historikens startrad). Antag att historiken ser ut sÃ¥ här: /************************************************************************** -** HISTORIK: $Log: \toms_sammanfogning_huvudvy\Mitt_program\kod\komplexalgoritm.cpp $ +** HISTORIK: $Log: \toms_sammanfogning_huvudvy\Mitt_program\kod\komplexalgoritm.cpp $ ** ** \head\integreringsgren_12 2 Apr 2001 10:45:41 tom ** Sammanfogade grenen simongren_15. @@ -732,9 +732,9 @@ ** Fixade krasch. **************************************************************************/ Historikens inledande rad matchar det reguljära uttrycket ".*\$Log.*\$.*". Därefter följer historikposterna. Historikens inledande rad matchar det reguljära uttrycket ".*\$Log.*\$.*". Därefter följer historikposterna. Raden med nyckelordet "$Log$" börjar med tvÃ¥ "*" och därefter följer ett mellanslag. &kdiff3; använder den första strängen utan blanktecken som "inledande kommentar" och antar att historiken slutar med den första raden utan denna inledande kommentar. I exemplet slutar den sista raden med en sträng som ocksÃ¥ börjar med tvÃ¥ "*", men istället för ett mellanslag följer fler "*". Därför avslutar denna rad historiken. Raden med nyckelordet "$Log$" börjar med tvÃ¥ "*" och därefter följer ett mellanslag. &kdiff3; använder den första strängen utan blanktecken som "inledande kommentar" och antar att historiken slutar med den första raden utan denna inledande kommentar. I exemplet slutar den sista raden med en sträng som ocksÃ¥ börjar med tvÃ¥ "*", men istället för ett mellanslag följer fler "*". Därför avslutar denna rad historiken. Om sortering av historiken inte krävs kan det reguljära uttrycket för historikpostens början se ut sÃ¥ här. (Raden är delad i tvÃ¥ eftersom den inte skulle fÃ¥ plats annars.) \s*\\main\\\S+\s+[0-9]+ (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) @@ -1250,7 +1250,7 @@ >Reguljärt uttryck för början av historikposten för sammanfogning. Oftast innehÃ¥ller raden nyckelordet "$Log$". Förvalt värde: ".*\$Log.*\$.*" Reguljärt uttryck för början av historikposten för sammanfogning. Oftast innehÃ¥ller raden nyckelordet "$Log$". Förvalt värde: ".*\$Log.*\$.*" &kdiff3;: Verktyg för jämförelser och sammanfogning av filer och kataloger Program copyright 2002-2005 Joachim Eibl Program copyright 2002-2006 Joachim Eibl joachim.eibl snabela gmx.de Flera häftiga idéer och felrapporter kom frÃ¥n kolleger och mÃ¥nga personer ute i den Vida Vilda Världen. Tack! Dokumentation Copyright © 2002-2005 Joachim Eibl Dokumentation Copyright © 2002-2006 Joachim Eibl joachim. eibl snabela gmx.de diff -r 069521efec1a -r 08ea9b86c12c kdiff3/kdiff3.kdevelop --- a/kdiff3/kdiff3.kdevelop Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/kdiff3.kdevelop Sat Nov 04 00:05:00 2006 +0000 @@ -2,8 +2,8 @@ Joachim Eibl - joachim@gmx.de - 0.9.88 + joachim dot eibl at gmx dot de + 0.9.91 KDevKDEAutoProject C++ @@ -31,7 +31,7 @@ true true - + @@ -155,7 +155,9 @@ true 250 - + + Qt + set @@ -165,7 +167,7 @@ true - false + true 3 /usr/lib/qt3 diff -r 069521efec1a -r 08ea9b86c12c kdiff3/kdiff3.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/kdiff3.spec Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,61 @@ +Name: kdiff3 +Version: 0.9.91 +Release: 1.fc + +URL: http://www.kde-apps.org/content/show.php?content=9807 +License: GPL +Summary: Tool for Comparison and Merge of Files and Directories +Group: Development/Tools + +Source: http://heanet.dl.sourceforge.net/sourceforge/kdiff3/kdiff3-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +Requires: kdelibs > 3.3 +BuildRequires: gcc-c++ >= 3.2 +BuildRequires: xorg-x11-devel +BuildRequires: qt-devel >= 3.3 +BuildRequires: kdelibs-devel >= 3.3 + +%description +Shows the differences line by line and character by character (!). +Provides an automatic merge-facility and +an integrated editor for comfortable solving of merge-conflicts. +Supports KIO on KDE (allows accessing ftp, sftp, fish, smb etc.). +Unicode & UTF-8 support + +%prep +%setup + +%build +[ -n "$QTDIR" ] || . %{_sysconfdir}/profile.d/qt.sh + +export KDEDIR=%{_prefix} + +%configure --prefix=/usr +%{__make} %{?_smp_mflags} + +%install +%{__rm} -rf %{buildroot} +source /etc/profile.d/qt.sh +%makeinstall + +%clean +%{__rm} -rf %{buildroot} + +%files +%doc AUTHORS ChangeLog COPYING NEWS README TODO +%{_bindir}/kdiff3 +%{_datadir}/applnk/* +%{_datadir}/apps/kdiff3/* +%{_datadir}/apps/kdiff3part/* +%{_datadir}/doc/HTML/* +%{_datadir}/icons/* +%{_datadir}/locale/* +%{_datadir}/man/man1/kdiff3* +%{_datadir}/services/kdiff3* +%{_libdir}/kde3/libkdiff3* + +%changelog +* Mon May 15 2006 Vadim Likhota - 0.9.90-1.fc +- write spec for fc/rhel/centos/asp for kdiff3 + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/README --- a/kdiff3/po/README Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/README Sat Nov 04 00:05:00 2006 +0000 @@ -88,7 +88,7 @@ For Qt-strings in $QTDIR/translations (already as .qm-files) -For KDE-libs in the CVS-repository, where we can reuse the previous trick to get +For KDE-libs in the SVN-repository, where we can reuse the previous trick to get all kdelibs*.po-files: for i in `cat subdirs`; do wget http://websvn.kde.org/*checkout*/trunk/l10n/$i/messages/kdelibs/kdelibs.po -O kdelibs_$i.po; done diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/az.po --- a/kdiff3/po/az.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/az.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2004-03-15 21:45+0200\n" "Last-Translator: MÉ™tin Æmirov \n" "Language-Team: Azerbaijani \n" @@ -52,13 +52,13 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "" @@ -238,7 +238,7 @@ msgid "Changing All Merge Operations" msgstr "" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "" @@ -600,14 +600,6 @@ msgid "Unfold All Subdirs" msgstr "" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "" @@ -680,91 +672,91 @@ msgid "Merge to A && B" msgstr "" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "YaddaÅŸ çatışmır" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "" @@ -1104,11 +1096,11 @@ msgid "Toggle the statusbar..." msgstr "" -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "" @@ -1203,118 +1195,118 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "" @@ -1867,74 +1859,74 @@ msgid "Regional Settings" msgstr "" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "ÆmÉ™liyyat" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -1942,7 +1934,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -1952,19 +1944,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" @@ -2093,11 +2085,11 @@ msgid "Search Complete" msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/bg.po --- a/kdiff3/po/bg.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/bg.po Sat Nov 04 00:05:00 2006 +0000 @@ -4,14 +4,14 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" -"PO-Revision-Date: 2006-04-04 11:08+0300\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-09-15 08:44+0300\n" "Last-Translator: Zlatko Popov \n" "Language-Team: Bulgarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.2\n" +"X-Generator: KBabel 1.11.4\n" #: _translatorinfo.cpp:1 msgid "" @@ -63,7 +63,7 @@ "\n" "Командата за предварителна обработка за ÑравнÑване на редове ще бъде неактивна." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -71,7 +71,7 @@ "Грешка от загуба на данни:\n" "Ðко продължава, молÑ, Ñвържете Ñе Ñ Ð°Ð²Ñ‚Ð¾Ñ€Ð°.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Сериозна вътрешна грешка" @@ -258,7 +258,7 @@ msgid "Changing All Merge Operations" msgstr "ПромÑна на вÑички операции по Ñливане" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Продължение" @@ -487,7 +487,7 @@ msgid "" "An error occurred. Press OK to see detailed information.\n" msgstr "" -"Възникнала е грешка. ÐатиÑнете \"О'кей\", за да видите подробна информациÑ.\n" +"Възникнала е грешка. ÐатиÑнете \"ОК\", за да видите подробна информациÑ.\n" #: directorymergewindow.cpp:2344 msgid "Error: While deleting %1: Creating backup failed." @@ -660,14 +660,6 @@ msgid "Unfold All Subdirs" msgstr "Показване на вÑички поддиректории" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Ð—Ð°Ð¿Ð¸Ñ Ð½Ð° ÑÑŠÑтоÑние при Ñливане ..." - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "Зареждане на ÑÑŠÑтоÑние при Ñливане ..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Изберете Рза вÑички елементи" @@ -740,7 +732,7 @@ msgid "Merge to A && B" msgstr "Сливане в Ри Б" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -749,7 +741,7 @@ "неуÑпешно.\n" "Име на файл: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -757,53 +749,53 @@ "Ð’ процеÑа на Ñъздаване на ново резервно копие, преименуването беше неуÑпешно.\n" "Имена на файлове: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Вземане ÑтатуÑа на файл: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Чете на файл: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Ð—Ð°Ð¿Ð¸Ñ Ð½Ð° файл: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "ÐÑма памет" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Създаване на директориÑ: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Премахване на директориÑ: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Премахване на файл: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Създаване на връзка към Ñимволи: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Преименуване на файл: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Копиране на файл: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -811,7 +803,7 @@ "Грешка по време на копиране: ОтварÑнето на файл за четене беше неуÑпешно. Име " "на файл: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -819,21 +811,21 @@ "Грешка по време на копиране: ОтварÑнето на файл за Ð·Ð°Ð¿Ð¸Ñ Ð±ÐµÑˆÐµ неуÑпешно. Име на " "файл: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Грешка по време на копиране: Четенето беше неуÑпешно. Име на файл: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Грешка по време на копиране: ЗапиÑÑŠÑ‚ беше неуÑпешен. Име на файл: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Четене на директориÑ: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "СпиÑък на директориÑ: %1" @@ -1060,9 +1052,8 @@ msgstr "РазделÑне на разликата при маркираното" #: kdiff3.cpp:505 -#, fuzzy msgid "Join Selected Diffs" -msgstr "СравнÑване на маркираните файлове" +msgstr "Сливане на маркираните файлове" #: kdiff3.cpp:507 msgid "Show Window A" @@ -1183,11 +1174,11 @@ msgid "Toggle the statusbar..." msgstr "Превключване на лентата за ÑÑŠÑтоÑнието..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Ðе Ñа открити файлове за ÑравнÑване." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1292,13 +1283,13 @@ msgstr "" "+ Много благодарноÑти за тези, които Ñе обадиха за грешките и имаха нови идеи!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "Брой оÑтаващи нерешени конфликти: %1 (от които %2 Ñа интервали)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1306,55 +1297,55 @@ "Изходът е променен.\n" "Ðко продължите промените ще бъдат загубени." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Ð’Ñички входни файлове Ñа двоично еднакви." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Входните файлове Ñъдържат еднакъв текÑÑ‚." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Файлове Ри Б Ñа двоично еднакви.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Файлове Ри Б Ñъдържат еднакъв текÑÑ‚. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Файлове Ри Ð’ Ñа двоично еднакви.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Файлове Ри Ð’ Ñъдържат еднакъв текÑÑ‚. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Файлове Б и Ð’ Ñа двоично еднакви.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Файлове Б и Ð’ Ñъдържат еднакъв текÑÑ‚. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Общ брой конфликти: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1362,7 +1353,7 @@ "\n" "Брой автоматично решени конфликти: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1370,31 +1361,31 @@ "\n" "Брой нерешени конфликти: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Конфликти" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "<ÐÑма входен ред>" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "<Сливане на конфликт (Само интервали)>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<Сливане на конфликт>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Резултат" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Променен]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1402,11 +1393,11 @@ "Ð’Ñе още не вÑички конфликти Ñа решени.\n" "Файлът не е запиÑан.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "ОÑтаващи конфликти" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1416,11 +1407,11 @@ "\n" "Създаването на резервно копие беше неуÑпешно. Файлът не е запиÑан." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Грешка при Ð·Ð°Ð¿Ð¸Ñ Ð½Ð° файл" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Грешка по време на запиÑ." @@ -1505,7 +1496,6 @@ msgstr "Текущ обхват за цвета на фон на разделител:" #: optiondialog.cpp:622 -#, fuzzy msgid "Color for manually aligned difference ranges:" msgstr "ЦвÑÑ‚ на обхват за ръчно избрани разлики:" @@ -1612,7 +1602,7 @@ "Show carriage return characters '\\r' if they exist.\n" "Helps to compare files that were modified under different operating systems." msgstr "" -"Показване на Ñимвол за нов ред '\\r' ако ÑъщеÑтвуват.\n" +"Показване на Ñимвол за нов ред \"\\r\" ако ÑъщеÑтвуват.\n" "Помага за ÑравнÑването на файлове, които Ñа променени под различни операционни " "ÑиÑтеми." @@ -1645,7 +1635,7 @@ #: optiondialog.cpp:765 msgid "Treat case differences like white space changes. ('a'<=>'A')" msgstr "" -"Третиране на разликата в региÑтъра като промÑна в интервалите. ('a'<=>'A')" +"Третиране на разликата в региÑтъра като промÑна в интервалите. (\"a\"<=>\"A\")" #: optiondialog.cpp:769 msgid "Preprocessor command:" @@ -1724,7 +1714,6 @@ msgstr "ÐвтоÑливане на регулÑрни изрази:" #: optiondialog.cpp:841 -#, fuzzy msgid "" "Regular expression for lines where KDiff3 should automatically choose one " "source.\n" @@ -1733,8 +1722,8 @@ msgstr "" "РегулÑрните изрази за редовете, където KDiff3 трÑбва автоматично да избере " "източник.\n" -"Когато нÑкой ред Ñ ÐºÐ¾Ð½Ñ„Ð»Ð¸ÐºÑ‚ Ñъвпадне Ñ Ñ€ÐµÐ³ÑƒÐ»ÑÑ€Ð½Ð¸Ñ Ð¸Ð·Ñ€Ð°Ð· \"then/n- if available " -"- C\", иначе ще бъде избран B." +"Когато нÑкой ред Ñ ÐºÐ¾Ð½Ñ„Ð»Ð¸ÐºÑ‚ Ñъвпадне Ñ Ñ€ÐµÐ³ÑƒÐ»ÑÑ€Ð½Ð¸Ñ Ð¸Ð·Ñ€Ð°Ð·,\n" +"тогава \"- if available - C\", иначе ще бъде избран B." #: optiondialog.cpp:847 msgid "Run regular expression auto merge on merge start" @@ -1757,7 +1746,6 @@ msgstr "РегулÑрен израз за начало на иÑториÑ:" #: optiondialog.cpp:867 -#, fuzzy msgid "" "Regular expression for the start of the version control history entry.\n" "Usually this line contains the \"$Log$\"-keyword.\n" @@ -1772,7 +1760,6 @@ msgstr "РегулÑрен израз за начало на иÑториÑта:" #: optiondialog.cpp:885 -#, fuzzy msgid "" "A version control history entry consists of several lines.\n" "Specify the regular expression to detect the first line (without the leading " @@ -1918,7 +1905,7 @@ #: optiondialog.cpp:1004 msgid "Finds files and directories starting with '.'." -msgstr "Открива файлове и директории, започващи Ñ '.'." +msgstr "Открива файлове и директории, започващи Ñ \".\"." #: optiondialog.cpp:1008 msgid "Follow file links" @@ -2068,11 +2055,11 @@ msgid "Regional Settings" msgstr "Регионални наÑтройки" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Език (нужно е реÑтартиране)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2080,11 +2067,11 @@ "Изберете език за ГПИ-низовете или \"Ðвтоматично\".\n" "За да Ñе Ñмени езика, излезте от KDiff3 и Ñ Ñ€ÐµÑтартирайте." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Използване на еднаква кодова таблица за вÑичко:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2093,35 +2080,35 @@ "първата.\n" "Изключете Ñа необходими различни индивидуални наÑтройки." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Забележка: Локалната кодова таблица е " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Файлова кодова таблица за Ð:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Файлова кодова таблица за Б:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Файлова кодова таблица за Ð’:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Кодова таблица на файла за резултата от Ñливането и запиÑване:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Кодова таблица на файл за файлове за предварителна обработка:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Езици тип \"отдÑÑно на лÑво\"" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2129,19 +2116,19 @@ "ÐÑкои езици Ñе четат отдÑÑно налÑво.\n" "Тази наÑтройка ще промени Ñъответно редактора и визуализатора." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "ИнтеграциÑ" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "ÐаÑтройки на интеграциÑта" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Опции за команден ред, които да бъдат игнорирани:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2153,7 +2140,7 @@ "Могат да бъдат поÑочени нÑколко ÑтойноÑти, разделени Ñ \";\" \n" "Това ще елиминира грешката \"ÐеизвеÑтна грешка\"." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2169,19 +2156,19 @@ "\n" "ИÑкате ли да продължите или ще изберете друг шрифт?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "ÐеÑъвмеÑтими шрифтове" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Продължете на ÑобÑтвена отговорноÑÑ‚" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Изберете друг шрифт" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Това ще възÑтанови вÑички наÑтройки. Ðе Ñамо тези в текущата тема." @@ -2254,23 +2241,20 @@ msgstr "Разлика на ред: A <-> B" #: pdiff.cpp:509 -#, fuzzy msgid "All input files contain the same text, but are not binary equal." -msgstr "Входните файлове Ñъдържат еднакъв текÑÑ‚." +msgstr "Входните файлове Ñъдържат еднакъв текÑÑ‚, но не Ñа двоично еднакви." #: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 -#, fuzzy msgid "" "Files %1 and %2 are binary equal.\n" msgstr "" -"Файлове Б и Ð’ Ñа двоично еднакви.\n" +"Файлове %1 и %2 Ñа двоично еднакви.\n" #: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 -#, fuzzy msgid "" "Files %1 and %2 have equal text, but are not binary equal. \n" msgstr "" -"Файлове Ри Б Ñа двоично еднакви.\n" +"Файлове %1 и %2 Ñа Ñ ÐµÐ´Ð½Ð°ÐºÑŠÐ² текÑÑ‚, но не Ñа двоично еднакви. \n" #: pdiff.cpp:526 msgid "" @@ -2323,11 +2307,11 @@ msgid "Search Complete" msgstr "ТърÑенето завърши" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "Ðищо не е избрано в прозореца за разлики." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Грешка при ръчно добавÑне на охват за разликите" @@ -2409,15 +2393,15 @@ #: smalldialogs.cpp:114 smalldialogs.cpp:115 smalldialogs.cpp:116 msgid "Swap %1<->%2" -msgstr "" +msgstr "Суап %1<->%2" #: smalldialogs.cpp:117 smalldialogs.cpp:118 smalldialogs.cpp:119 msgid "Copy %1->Output" -msgstr "" +msgstr "Копиране %1-> Изходни данни" #: smalldialogs.cpp:120 smalldialogs.cpp:121 smalldialogs.cpp:122 msgid "Swap %1<->Output" -msgstr "" +msgstr "Суап %1 <-> Изходни данни" #: smalldialogs.cpp:129 msgid "Output (optional):" @@ -2460,7 +2444,6 @@ msgstr "ТеÑÑ‚ за регулÑрни изрази" #: smalldialogs.cpp:387 -#, fuzzy msgid "Example auto merge line:" msgstr "Примерен ред за начало на автоÑливане:" @@ -2477,13 +2460,12 @@ msgstr "Ред за примерно Ñтартиране на иÑÑ‚Ð¾Ñ€Ð¸Ñ (в водещ коментар):" #: smalldialogs.cpp:417 -#, fuzzy msgid "" "Copy a history start line as used in your files,\n" "including the leading comment." msgstr "" "Копирайте ред на започване на иÑÑ‚Ð¾Ñ€Ð¸Ñ ÐºÐ°Ñ‚Ð¾ във файловете,\n" -"но пропуÑнете Ð²Ð¾Ð´ÐµÑ‰Ð¸Ñ ÐºÐ¾Ð¼ÐµÐ½Ñ‚Ð°Ñ€." +"включително и Ð²Ð¾Ð´ÐµÑ‰Ð¸Ñ ÐºÐ¾Ð¼ÐµÐ½Ñ‚Ð°Ñ€." #: smalldialogs.cpp:443 msgid "History sort key order:" @@ -2516,30 +2498,3 @@ #: smalldialogs.cpp:541 msgid "Opening and closing parentheses don't match in regular expression." msgstr "ОтварÑнето и затварÑнето на дървото не Ñъвпада Ñ Ñ€ÐµÐ³ÑƒÐ»ÑÑ€Ð½Ð¸Ñ Ð¸Ð·Ñ€Ð°Ð·." - -#~ msgid "Synchronize Directories" -#~ msgstr "Синхронизиране на директории" - -#~ msgid "Copy Newer Files Instead of Merging" -#~ msgstr "Копиране на по-новите файлове, вмеÑто Ñливане" - -#~ msgid "List only deltas" -#~ msgstr "Показване Ñамо на дейÑтвиÑта" - -#~ msgid "Files and directories without change will not appear in the list." -#~ msgstr "Файлове и директории без промÑна нÑма да бъдат показани в ÑпиÑъка." - -#~ msgid "Please click the lines that should match in all windows." -#~ msgstr "МолÑ, щракнете върху редовете, които трÑбва да Ñъвпаднат във вÑички прозорци." - -#~ msgid "Swap" -#~ msgstr "Суап" - -#~ msgid "no selection" -#~ msgstr "нÑма маркирано" - -#~ msgid "Manually match lines" -#~ msgstr "Ръчно Ñъвпадане на редове" - -#~ msgid "Ok" -#~ msgstr "О'кей" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/br.po --- a/kdiff3/po/br.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/br.po Sat Nov 04 00:05:00 2006 +0000 @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: kdeextragear-1/kdiff3.po\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2004-09-20 15:44+0200\n" "Last-Translator: Thierry Vignaud \n" "Language-Team: br \n" @@ -49,13 +49,13 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Fazi diabarzh grevus" @@ -234,7 +234,7 @@ msgid "Changing All Merge Operations" msgstr "" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Kenderc'hel" @@ -598,14 +598,6 @@ msgid "Unfold All Subdirs" msgstr "" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "" @@ -678,91 +670,91 @@ msgid "Merge to A && B" msgstr "" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Emaon o lenn ar restr : %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Emaon o skrivañ ar restr : %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Memor ebet" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Oc'h oberiañ ar renkell : %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Emaon o tilemel ar renkell : %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Emaon o tilemel ar restr : %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Emaon oc'h adenvel ar restr : %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Emaon oc'h eilañ ar restr : %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Emaon o lenn ar renkell :" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "" @@ -1102,11 +1094,11 @@ msgid "Toggle the statusbar..." msgstr "Diskouez/Kuzhat ar varenn stad ..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1201,118 +1193,118 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Ezkas" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Kemmet]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Fazi en ur skrivañ." @@ -1865,73 +1857,73 @@ msgid "Regional Settings" msgstr "Kefluniadur rann-vro" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -1939,7 +1931,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -1949,19 +1941,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Dibab un nodrezh all" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" @@ -2090,11 +2082,11 @@ msgid "Search Complete" msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/cs.po --- a/kdiff3/po/cs.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/cs.po Sat Nov 04 00:05:00 2006 +0000 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-19 16:41+0200\n" "Last-Translator: Klara Cihlarova \n" "Language-Team: cs_CZ \n" @@ -54,7 +54,7 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -62,7 +62,7 @@ "Chyba, ztracená data:\n" "Pokud lze chybu reprodukovat, kontaktujte autora.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Závažná interní chyba" @@ -246,7 +246,7 @@ msgid "Changing All Merge Operations" msgstr "" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "P&okraÄovat" @@ -614,14 +614,6 @@ msgid "Unfold All Subdirs" msgstr "" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "" @@ -694,91 +686,91 @@ msgid "Merge to A && B" msgstr "" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Nedostatek pamÄ›ti" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "" @@ -1118,11 +1110,11 @@ msgid "Toggle the statusbar..." msgstr "PÅ™epnout stavovou liÅ¡tu..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "" @@ -1217,118 +1209,118 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Konfilkty" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Výstup" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "" @@ -1881,73 +1873,73 @@ msgid "Regional Settings" msgstr "" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Integrace" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -1955,7 +1947,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -1965,19 +1957,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" @@ -2106,11 +2098,11 @@ msgid "Search Complete" msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/cy.po --- a/kdiff3/po/cy.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/cy.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: ../cy/messages//kdeextragear-1/kdiff3.po\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2004-09-20 15:44+0200\n" "Last-Translator: Thierry Vignaud \n" "Language-Team: cy \n" @@ -47,13 +47,13 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "" @@ -233,7 +233,7 @@ msgid "Changing All Merge Operations" msgstr "" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Mynd ymlaen" @@ -595,14 +595,6 @@ msgid "Unfold All Subdirs" msgstr "" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "" @@ -675,91 +667,91 @@ msgid "Merge to A && B" msgstr "" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Allan o Gof." -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "" @@ -1100,11 +1092,11 @@ msgid "Toggle the statusbar..." msgstr "Dangos/cuddio'r bar cyflwr..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "" @@ -1199,118 +1191,118 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Gwrthdrawiadau" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Allbwn" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "" @@ -1864,75 +1856,75 @@ msgid "Regional Settings" msgstr "Gosodiadau Rhanbarthol" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Gweithrediad" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Gosodiadau Rhanbarthol" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -1940,7 +1932,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -1950,19 +1942,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" @@ -2091,11 +2083,11 @@ msgid "Search Complete" msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/da.po --- a/kdiff3/po/da.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/da.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,4 +1,3 @@ -# translation of kdiff3.po to # Danish translation of kdiff3 # Copyright (C). # @@ -6,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-11 11:47-0400\n" "Last-Translator: Erik Kjær Pedersen \n" "Language-Team: Danish \n" @@ -64,7 +63,7 @@ "\n" "Forbehandlingskommandoen til linje-matchning vil blibe deaktiveret nu." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -72,7 +71,7 @@ "Fejl med datatab:\n" "Hvis dette kan gentages so kontakt venligst forfatteren.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Alvorlig intern fejl" @@ -258,7 +257,7 @@ msgid "Changing All Merge Operations" msgstr "Ændrer alle indfletningsoperationer" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Fortsæt" @@ -648,14 +647,6 @@ msgid "Unfold All Subdirs" msgstr "Fold alle undermapper ud" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Gem tilstand for mappesammenfletning..." - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "Indlæs tilstand for mappesammenfletning..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Vælg A for alle punkter" @@ -728,7 +719,7 @@ msgid "Merge to A && B" msgstr "Indflet til A && B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -736,7 +727,7 @@ "Det mislykkedes at slette en ældre sikkerhedskopi under sikkerhedskopieringen.\n" "Filnavn: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -744,53 +735,53 @@ "Det mislykkedes at ændre navnet under sikkerhedskopieringen\n" "Filnavne:" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Henter filstatus: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Læser fil: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Skriver fil: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Ude af hukommelse" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Opretter mappe: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Fjerner mappe: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Fjerner fil: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Laver symbolsk link: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Omdøber fil: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Kopierer fil: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -798,7 +789,7 @@ "Fejl under kopieringsoperationen: Ã…bning af fil til læsning mislykkedes. " "Filnavn: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -806,21 +797,21 @@ "Fejl under kopieringsoperationen: Ã…bning af fil til skrivning mislykkedes. " "Filnavn: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Fejl under kopieringsoperationen: Læsning mislykkedes. Filnavn: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Fejl under kopieringsoperationen: Skrivning mislykkedes. Filnavn: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Læser mappe:" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Giver en liste af mappe: %1" @@ -980,7 +971,7 @@ #: kdiff3.cpp:488 msgid "Show White Space" -msgstr "Vis hvide tegn" +msgstr "Vis blanke tegn" #: kdiff3.cpp:490 msgid "Show Line Numbers" @@ -1012,15 +1003,15 @@ #: kdiff3.cpp:497 msgid "Choose A for All Unsolved Whitespace Conflicts" -msgstr "Vælg A for alle uløste konflikter med hvide tegn" +msgstr "Vælg A for alle uløste konflikter med blanke tegn" #: kdiff3.cpp:498 msgid "Choose B for All Unsolved Whitespace Conflicts" -msgstr "Vælg B for alle uløste konflikter med hvide tegn" +msgstr "Vælg B for alle uløste konflikter med blanke tegn" #: kdiff3.cpp:499 msgid "Choose C for All Unsolved Whitespace Conflicts" -msgstr "Vælg C for alle uløste konflikter med hvide tegn" +msgstr "Vælg C for alle uløste konflikter med blanke tegn" #: kdiff3.cpp:500 msgid "Automatically Solve Simple Conflicts" @@ -1164,11 +1155,11 @@ msgid "Toggle the statusbar..." msgstr "SlÃ¥ statuslinje til/fra..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Kunne ikke finde filer til sammenligning." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1270,14 +1261,14 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "+ Mange tak til dem der rapporterede fejl og bidrog med ideer." -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Antal tilbageværende uløste konflikter: %1 (af hvilke %2 er blanke tegn)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1285,55 +1276,55 @@ "Uddata er blevet ændret.\n" "Hvis du fortsætter vil dine ændringer gÃ¥ tabt." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Alle inddata-filer er binært ens." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Alle inddata-filer indeholder den samme tekst." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Filerne A og B er binært ens.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Filerne A og B har samme tekst.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Filerne A og C er binært ens.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Filerne A og C har samme tekst.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Filerne B og C er binært ens.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Filerne B og C har samme tekst.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Totalt antal konflikter: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1341,7 +1332,7 @@ "\n" "Antal automatisk løste konflikter: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1349,31 +1340,31 @@ "\n" "Antal uløste konflikter: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Konflikter" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Uddata" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Ændret]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1381,11 +1372,11 @@ "Ikke alle konflikter er løst endnu.\n" "Filen er ikke gemt.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Konflikter tilovers" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1395,11 +1386,11 @@ "\n" "Mislykkedes at oprette sikkerhedskopi. Filen blev ikke gemt." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Fejl ved at gemme fil" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Fejl ved skrivning." @@ -1602,7 +1593,7 @@ "space.)\n" "Might help to compare files with numeric data." msgstr "" -"Ignorér nummer-tegn i den fase hvor du matcher linjer. (Ligner Ignorér hvide " +"Ignorér nummer-tegn i den fase hvor du matcher linjer. (Ligner Ignorér blanke " "tegn.)\n" "Kan muligvis hjælpe med at sammenligne numeriske data." @@ -1612,7 +1603,7 @@ #: optiondialog.cpp:758 msgid "Treat C/C++ comments like white space." -msgstr "Behandl C/C++ kommentarersom hvide tegn." +msgstr "Behandl C/C++ kommentarer ligesom blanke tegn." #: optiondialog.cpp:762 msgid "Ignore case" @@ -1671,7 +1662,7 @@ #: optiondialog.cpp:801 msgid "White space 2-file merge default:" -msgstr "Standard for 2-fils indfletning af hvide tegn:" +msgstr "Standard for 2-fils indfletning af blanke tegn:" #: optiondialog.cpp:805 optiondialog.cpp:818 msgid "Manual Choice" @@ -1683,7 +1674,7 @@ "changes." msgstr "" "Tillad indfletningsalgoritmen automatisk at vælge et input for ændringer kun af " -"hvide tegn." +"blanke tegn." #: optiondialog.cpp:814 msgid "White space 3-file merge default:" @@ -2043,11 +2034,11 @@ msgid "Regional Settings" msgstr "Regional opsætning" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Sprog (genstart krævet)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2055,11 +2046,11 @@ "Vælg sproget for GUI-strengene eller \"Auto\".\n" "For at en ændring af sprog skal ske, afslut og start KDiff3 igen." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Brug samme tegnsæt til alt:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2067,35 +2058,35 @@ "At aktivere dette lader dig ændre alle tegnsæt ved at kun ændre den første.\n" "Deaktivér det hvis forskellige individuelle indstillinger behøves." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Bemærk: Lokalt tegnsæt er " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Filtegnsæt for A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Filtegnsæt for B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Filtegnsæt for C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Filtegnsæt for sammenflettede uddata og nÃ¥r der gemmes:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Filtegnsæt for forbehandlingsfiler:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Sprog som læses fra højre til venstre" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2103,19 +2094,19 @@ "Nogle sprog læses fra højre til venstre.\n" "Indstillingen ændrer visningen og editoren pÃ¥ tilsvarende mÃ¥de." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Integrering" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Integreringsindstillinger" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Kommandolinjeflag at ignorere:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2127,7 +2118,7 @@ "Flere værdier kan angives hvis de adskilles af ';'\n" "Dette undertrykker fejlmeddelelsen \"Ukendt flag\"." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2143,19 +2134,19 @@ "\n" "Ønsker du at fortsætte eller at vælge en anden skrifttype." -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Inkompatibel skrifttype" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Fortsæt pÃ¥ eget ansvar." -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Vælg en anden skrifttype" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Dette nulstiller alle tilvalg. Ikke kun dem der angÃ¥r dette emne." @@ -2295,11 +2286,11 @@ msgid "Search Complete" msgstr "Søgning færdig" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "Ingenting er markeret i inddatavindue med sammenligning." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Fejl ved tilføjelse manuelt sammenligningsomrÃ¥de" @@ -2490,6 +2481,12 @@ msgid "Opening and closing parentheses don't match in regular expression." msgstr "Indledende og afsluttende parenteser matcher ikke i regulært udtryk." +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Gem tilstand for mappesammenfletning..." + +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Indlæs tilstand for mappesammenfletning..." + #~ msgid "Synchronize Directories" #~ msgstr "Synkronisér mapper" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/de.po --- a/kdiff3/po/de.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/de.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,4 +1,4 @@ -# translation of de.po to Deutsch +# translation of kdiff3.po to German # Übersetzung von kdiff3.po ins Deutsche # Copyright (C) # @@ -6,14 +6,14 @@ # Thomas Diehl , 2003, 2004. # Joachim Eibl , 2004. # Joachim Eibl , 2004, 2005, 2006. -# Thomas Reitelbach , 2004. +# Thomas Reitelbach , 2004, 2006. msgid "" msgstr "" -"Project-Id-Version: de\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" -"PO-Revision-Date: 2006-05-14 17:09+0200\n" -"Last-Translator: Joachim Eibl \n" -"Language-Team: Deutsch \n" +"Project-Id-Version: kdiff3\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-07-09 10:25+0200\n" +"Last-Translator: Thomas Reitelbach \n" +"Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -71,7 +71,7 @@ "\n" "Der Vorverarbeitungsbefehl für Zeilenabgleich wird nun deaktiviert." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -80,7 +80,7 @@ "Falls das Problem reproduzierbar ist, nehmen Sie bitte Kontakt mit dem Autor " "auf.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Schwerwiegender interner Fehler" @@ -118,7 +118,7 @@ #: directorymergewindow.cpp:208 msgid "Comparing file..." -msgstr "Datei wird verglichen..." +msgstr "Datei wird verglichen ..." #: directorymergewindow.cpp:218 directorymergewindow.cpp:224 #, c-format @@ -174,16 +174,22 @@ msgstr "Öffnen der Verzeichnisse fehlgeschlagen:" #: directorymergewindow.cpp:465 -msgid "Dir A \"%1\" does not exist or is not a directory.\n" -msgstr "Verzeichnis A \"%1\" existiert nicht oder ist kein Verzeichnis.\n" +msgid "" +"Dir A \"%1\" does not exist or is not a directory.\n" +msgstr "" +"Verzeichnis A \"%1\" existiert nicht oder ist kein Verzeichnis.\n" #: directorymergewindow.cpp:468 -msgid "Dir B \"%1\" does not exist or is not a directory.\n" -msgstr "Verzeichnis B \"%1\" existiert nicht oder ist kein Verzeichnis.\n" +msgid "" +"Dir B \"%1\" does not exist or is not a directory.\n" +msgstr "" +"Verzeichnis B \"%1\" existiert nicht oder ist kein Verzeichnis.\n" #: directorymergewindow.cpp:471 -msgid "Dir C \"%1\" does not exist or is not a directory.\n" -msgstr "Verzeichnis C \"%1\" existiert nicht oder ist kein Verzeichnis.\n" +msgid "" +"Dir C \"%1\" does not exist or is not a directory.\n" +msgstr "" +"Verzeichnis C \"%1\" existiert nicht oder ist kein Verzeichnis.\n" #: directorymergewindow.cpp:473 msgid "Directory Open Error" @@ -261,7 +267,7 @@ msgid "Changing All Merge Operations" msgstr "Änderung aller Zusammenführungsaktionen" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Fortsetzen" @@ -356,8 +362,10 @@ msgstr "Programm Fehler" #: directorymergewindow.cpp:1895 -msgid "An error occurred while copying.\n" -msgstr "Ein Fehler ist während des Kopierens aufgetreten.\n" +msgid "" +"An error occurred while copying.\n" +msgstr "" +"Ein Fehler ist während des Kopierens aufgetreten.\n" #: directorymergewindow.cpp:1896 directorymergewindow.cpp:2302 msgid "Merge Error" @@ -468,7 +476,7 @@ #: directorymergewindow.cpp:2205 directorymergewindow.cpp:2431 msgid "In progress..." -msgstr "In Bearbeitung..." +msgstr "In Bearbeitung ..." #: directorymergewindow.cpp:2253 msgid "Merge operation complete." @@ -479,18 +487,22 @@ msgstr "Zusammenführung abgeschlossen." #: directorymergewindow.cpp:2265 -msgid "Simulated merge complete: Check if you agree with the proposed operations." +msgid "" +"Simulated merge complete: Check if you agree with the proposed operations." msgstr "" "Die simulierte Zusammenführung ist abgeschlossen. Überprüfen Sie, ob Sie mit " "den vorgeschlagenen Aktionen einverstanden sind." #: directorymergewindow.cpp:2301 -msgid "An error occurred. Press OK to see detailed information.\n" -msgstr "Ein Fehler ist aufgetreten. Wählen Sie OK um Details zu sehen.\n" +msgid "" +"An error occurred. Press OK to see detailed information.\n" +msgstr "" +"Ein Fehler ist aufgetreten. Wählen Sie OK um Details zu sehen.\n" #: directorymergewindow.cpp:2344 msgid "Error: While deleting %1: Creating backup failed." -msgstr "Fehler: Beim Löschen von %1: Die Erstellung einer Sicherungskopie schlug fehl." +msgstr "" +"Fehler: Beim Löschen von %1: Die Erstellung einer Sicherungskopie schlug fehl." #: directorymergewindow.cpp:2351 msgid "delete directory recursively( %1 )" @@ -519,7 +531,8 @@ msgstr "Manuelles Zusammenführen( %1, %2, %3 -> %4)" #: directorymergewindow.cpp:2426 -msgid " Note: After a manual merge the user should continue by pressing F7." +msgid "" +" Note: After a manual merge the user should continue by pressing F7." msgstr " Hinweis: Nach manuellem Zusammenführen mit F7 fortsetzen." #: directorymergewindow.cpp:2449 @@ -654,14 +667,6 @@ msgid "Unfold All Subdirs" msgstr "Alle Unterverzeichnisse ausklappen" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Verzeichnis-Zusammenführungs-Status speichern" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "Verzeichniszusammenführungsstatus laden ..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Für alle Elemente A wählen" @@ -734,7 +739,7 @@ msgid "Merge to A && B" msgstr "Zusammenführen nach A && B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -743,7 +748,7 @@ "vorhandene Sicherungskopie nicht gelöscht werden.\n" "Datei: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -752,77 +757,80 @@ "fehlgeschlagen:\n" "Dateinamen: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Hole Datei Status: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Einlesen von Datei: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Schreibe Datei: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Nicht genügend Speicher" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Erstelle Verzeichnis: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Lösche Verzeichnis: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Lösche Datei: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Erstelle Verknüpfung: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Datei umbenennen: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Datei kopieren: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format -msgid "Error during file copy operation: Opening file for reading failed. Filename: %1" +msgid "" +"Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "Fehler beim Kopieren: Datei konnte nicht zum Lesen geöffnet werden: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format -msgid "Error during file copy operation: Opening file for writing failed. Filename: %1" -msgstr "Fehler beim Kopieren: Datei konnte nicht zum Schreiben geöffnet werden: %1" - -#: fileaccess.cpp:882 +msgid "" +"Error during file copy operation: Opening file for writing failed. Filename: %1" +msgstr "" +"Fehler beim Kopieren: Datei konnte nicht zum Schreiben geöffnet werden: %1" + +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Fehler beim Kopieren: Lesen fehlgeschlagen: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Fehler beim Kopieren: Schreiben fehlgeschlagen: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Verzeichnis wird eingelesen:" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Einlesen von Verzeichnis: %1" @@ -857,15 +865,16 @@ #: kdiff3.cpp:413 msgid "Opens documents for comparison..." -msgstr "Dateien für Vergleich öffnen..." +msgstr "Dateien für Vergleich öffnen ..." #: kdiff3.cpp:418 msgid "Saves the merge result. All conflicts must be solved!" -msgstr "Sichern des Zusammenführergebnisses. Alle Konflikte müssen gelöst sein." +msgstr "" +"Sichern des Zusammenführergebnisses. Alle Konflikte müssen gelöst sein." #: kdiff3.cpp:420 msgid "Saves the current document as..." -msgstr "Speichert das aktuelle Dokument als..." +msgstr "Speichert das aktuelle Dokument als ..." #: kdiff3.cpp:422 msgid "Print the differences" @@ -893,7 +902,7 @@ #: kdiff3.cpp:434 msgid "Search for a string" -msgstr "Suche nach Text..." +msgstr "Suche nach Text ..." #: kdiff3.cpp:436 msgid "Search again for the string" @@ -909,7 +918,7 @@ #: kdiff3.cpp:444 msgid "Configure KDiff3..." -msgstr "KDiff3 einrichten..." +msgstr "KDiff3 einrichten ..." #: kdiff3.cpp:465 msgid "Go to Current Delta" @@ -1126,18 +1135,19 @@ msgstr "Speichern des Zusammenführungsergebnisses schlug fehl." #: kdiff3.cpp:593 pdiff.cpp:964 -msgid "You are currently doing a directory merge. Are you sure, you want to abort?" +msgid "" +"You are currently doing a directory merge. Are you sure, you want to abort?" msgstr "" "Sie führen eine Verzeichniszusammenführung durch. Sind sie sicher, dass sie " "diese beenden möchten?" #: kdiff3.cpp:616 msgid "Saving file..." -msgstr "Datei wird gespeichert..." +msgstr "Datei wird gespeichert ..." #: kdiff3.cpp:633 msgid "Saving file with a new filename..." -msgstr "Datei wird unter neuem Namen gespeichert..." +msgstr "Datei wird unter neuem Namen gespeichert ..." #: kdiff3.cpp:722 msgid "Printing..." @@ -1157,21 +1167,21 @@ #: kdiff3.cpp:896 msgid "Exiting..." -msgstr "Wird beendet..." +msgstr "Wird beendet ..." #: kdiff3.cpp:908 msgid "Toggling toolbar..." -msgstr "Werkzeugleiste (de)aktivieren..." +msgstr "Werkzeugleiste (de)aktivieren ..." #: kdiff3.cpp:929 msgid "Toggle the statusbar..." -msgstr "Statusleiste an/aus..." - -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +msgstr "Statusleiste an/aus ..." + +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Konnte Dateien für Vergleich nicht finden." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3-Komponente" @@ -1187,7 +1197,8 @@ #: main.cpp:35 msgid "Tool for Comparison and Merge of Files and Directories" -msgstr "Programm zum Vergleichen und Zusammenführen von Dateien und Verzeichnissen" +msgstr "" +"Programm zum Vergleichen und Zusammenführen von Dateien und Verzeichnissen" #: main.cpp:40 msgid "Merge the input." @@ -1213,7 +1224,7 @@ #: main.cpp:47 msgid "Don't solve conflicts automatically. (For compatibility...)" -msgstr "Keine Konflikte automatisch lösen. (Für Kompatibilität...)" +msgstr "Keine Konflikte automatisch lösen. (Für Kompatibilität ...)" #: main.cpp:48 msgid "Visible name replacement for input file 1 (base)." @@ -1229,7 +1240,8 @@ #: main.cpp:52 msgid "Alternative visible name replacement. Supply this once for every input." -msgstr "Anderer angezeigter Dateiname: Kann für jede Quelle spezifiziert werden." +msgstr "" +"Anderer angezeigter Dateiname: Kann für jede Quelle spezifiziert werden." #: main.cpp:53 msgid "" @@ -1271,17 +1283,18 @@ #: main.cpp:184 msgid "+ Many thanks to those who reported bugs and contributed ideas!" -msgstr "+ Vielen Dank an alle, die Fehler gemeldet und Ideen beigesteuert haben!" - -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +msgstr "" +"+ Vielen Dank an alle, die Fehler gemeldet und Ideen beigesteuert haben!" + +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Anzahl der verbleibenden ungelösten Konflikte: %1 (wobei %2 davon weisse " "Konflikte sind)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1289,43 +1302,55 @@ "Das Ergebnis wurde verändert.\n" "Wenn sie fortsetzen gehen die Änderungen verloren." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Alle Quelldateien sind binär identisch." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Alle Quelldateien enthalten den gleichen Text." -#: mergeresultwindow.cpp:798 -msgid "Files A and B are binary equal.\n" -msgstr "Die Dateien A und B sind binär identisch.\n" - #: mergeresultwindow.cpp:799 -msgid "Files A and B have equal text. \n" -msgstr "Die Dateien A und B enthalten den gleichen Text. \n" +msgid "" +"Files A and B are binary equal.\n" +msgstr "" +"Die Dateien A und B sind binär identisch.\n" #: mergeresultwindow.cpp:800 -msgid "Files A and C are binary equal.\n" -msgstr "Die Dateien A und C sind binär identisch.\n" +msgid "" +"Files A and B have equal text. \n" +msgstr "" +"Die Dateien A und B enthalten den gleichen Text. \n" #: mergeresultwindow.cpp:801 -msgid "Files A and C have equal text. \n" -msgstr "Die Dateien A und C enthalten den gleichen Text. \n" +msgid "" +"Files A and C are binary equal.\n" +msgstr "" +"Die Dateien A und C sind binär identisch.\n" #: mergeresultwindow.cpp:802 -msgid "Files B and C are binary equal.\n" -msgstr "Die Dateien B und C sind binär identisch.\n" +msgid "" +"Files A and C have equal text. \n" +msgstr "" +"Die Dateien A und C enthalten den gleichen Text. \n" #: mergeresultwindow.cpp:803 -msgid "Files B and C have equal text. \n" -msgstr "Die Dateien B und C enthalten den gleichen Text. \n" - -#: mergeresultwindow.cpp:809 +msgid "" +"Files B and C are binary equal.\n" +msgstr "" +"Die Dateien B und C sind binär identisch.\n" + +#: mergeresultwindow.cpp:804 +msgid "" +"Files B and C have equal text. \n" +msgstr "" +"Die Dateien B und C enthalten den gleichen Text. \n" + +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Gesamte Anzahl der Konflikte: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1333,7 +1358,7 @@ "\n" "Anzahl der automatisch gelösten Konflikte: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1341,31 +1366,31 @@ "\n" "Anzahl der ungelösten Konflikte: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Konflikte" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Ausgabe" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Geändert]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1373,11 +1398,11 @@ "Noch sind nicht alle Konflikt gelöst.\n" "Die Datei wurde nicht gespeichert.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Es sind noch ungelöste Konflikte übrig" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1387,11 +1412,11 @@ "\n" "Die Sicherungskopie anzulegen schlug fehl. Die Datei wurde nicht gespeichert." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Fehler beim Speichern der Datei" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Fehler beim Schreiben." @@ -1539,7 +1564,8 @@ msgstr "Automatisch einrücken" #: optiondialog.cpp:694 -msgid "On: The indentation of the previous line is used for a new line.\n" +msgid "" +"On: The indentation of the previous line is used for a new line.\n" msgstr "" "Wenn aktiv, dann wird die Einrückung der vorigen Zeile bei neuen Zeilen " "übernommen.\n" @@ -1626,7 +1652,8 @@ #: optiondialog.cpp:773 msgid "User defined pre-processing. (See the docs for details.)" -msgstr "Benutzerdefinierbare Vorverarbeitung: (Siehe Beschreibung für Details.)" +msgstr "" +"Benutzerdefinierbare Vorverarbeitung: (Siehe Beschreibung für Details.)" #: optiondialog.cpp:776 msgid "Line-matching preprocessor command:" @@ -1789,7 +1816,8 @@ #: optiondialog.cpp:920 msgid "Merge version control history on merge start" -msgstr "Versionsverwaltungs-History beim Start einer Zusammenführung zusammenführen" +msgstr "" +"Versionsverwaltungs-History beim Start einer Zusammenführung zusammenführen" #: optiondialog.cpp:922 msgid "Run version control history automerge on merge start." @@ -2047,11 +2075,11 @@ msgid "Regional Settings" msgstr "Regionale Einstellungen" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Sprache (Neustart erforderlich)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2059,11 +2087,11 @@ "Sprache für das Benutzerinterface wählen oder \"Auto\".\n" "Diese Änderung wird erst nach Beendigung und Neustart von KDiff3 wirksam." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Die gleiche Kodierung für alles benützen:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2072,35 +2100,35 @@ "eingestellt werden. Dies auszuschalten erlaubt unterschiedliche individuelle " "Einstellungen." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Hinweis: Die lokale Kodierung ist " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Dateikodierung für A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Dateikodierung für B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Dateikodierung für C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Dateikodierung für Zusammenführung und Speichern:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Dateikodierung für Präprozessor Dateien:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Rechts-Nach-Links Sprache" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2108,19 +2136,19 @@ "Einige Sprachen werden von rechts nach links gelesen.\n" "Diese Einstellung ändert die Anzeige und den Editor entsprechend." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Integration" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Einstellungen für Integration" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Ignorierbare Kommandozeilenoptionen:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2132,7 +2160,7 @@ "Mehrere Werte können mit Trennzeichen ';' angegeben werden.\n" "Dies wird die Fehlermeldung \"Unbekannte Option\" beim Start unterdrücken." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2148,19 +2176,19 @@ "\n" "Wollen Sie mit dieser Schrift fortfahren oder doch eine andere Schrift wählen?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Inkompatible Schriftart" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Weiter auf eigenes Risiko" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Andere Schrift wählen" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "Dies führt zum zurücksetzen aller Einstellungen, nicht nur des aktuellen " @@ -2171,8 +2199,10 @@ msgstr "Vorverarbeitungsbefehl: " #: pdiff.cpp:263 -msgid "The following option(s) you selected might change data:\n" -msgstr "Die folgende(n) aktive(n) Einstellung(en) könnten Daten verändern.\n" +msgid "" +"The following option(s) you selected might change data:\n" +msgstr "" +"Die folgende(n) aktive(n) Einstellung(en) könnten Daten verändern.\n" #: pdiff.cpp:264 msgid "" @@ -2234,15 +2264,21 @@ #: pdiff.cpp:509 msgid "All input files contain the same text, but are not binary equal." -msgstr "Alle Quelldateien enthalten den gleichen Text, sind aber nicht binär identisch." +msgstr "" +"Alle Quelldateien enthalten den gleichen Text, sind aber nicht binär identisch." #: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 -msgid "Files %1 and %2 are binary equal.\n" -msgstr "Die Dateien %1 und %2 sind binär identisch.\n" +msgid "" +"Files %1 and %2 are binary equal.\n" +msgstr "" +"Die Dateien %1 und %2 sind binär identisch.\n" #: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 -msgid "Files %1 and %2 have equal text, but are not binary equal. \n" -msgstr "Die Dateien %1 und %2 haben den gleichen Text, sind aber nicht binär identisch.\n" +msgid "" +"Files %1 and %2 have equal text, but are not binary equal. \n" +msgstr "" +"Die Dateien %1 und %2 haben den gleichen Text, sind aber nicht binär " +"identisch.\n" #: pdiff.cpp:526 msgid "" @@ -2260,7 +2296,7 @@ #: pdiff.cpp:971 pdiff.cpp:1059 msgid "Opening files..." -msgstr "Dateien öffnen..." +msgstr "Dateien öffnen ..." #: pdiff.cpp:1036 pdiff.cpp:1107 msgid "File open error" @@ -2268,15 +2304,15 @@ #: pdiff.cpp:1139 msgid "Cutting selection..." -msgstr "Auswahl wird ausgeschnitten..." +msgstr "Auswahl wird ausgeschnitten ..." #: pdiff.cpp:1160 msgid "Copying selection to clipboard..." -msgstr "Auswahl wird in Zwischenablage kopiert..." +msgstr "Auswahl wird in Zwischenablage kopiert ..." #: pdiff.cpp:1176 msgid "Inserting clipboard contents..." -msgstr "Inhalt der Zwischenablage wird eingefügt..." +msgstr "Inhalt der Zwischenablage wird eingefügt ..." #: pdiff.cpp:1699 msgid "Save && Continue" @@ -2294,11 +2330,11 @@ msgid "Search Complete" msgstr "Suche abgeschlossen" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "In keinem der Unterschiedsfenster ist eine Auswahl markiert." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Fehler beim Hinzufügen einer manuellen Ausrichtung." @@ -2363,12 +2399,12 @@ #: smalldialogs.cpp:59 smalldialogs.cpp:75 smalldialogs.cpp:91 #: smalldialogs.cpp:134 msgid "File..." -msgstr "Datei..." +msgstr "Datei ..." #: smalldialogs.cpp:61 smalldialogs.cpp:77 smalldialogs.cpp:93 #: smalldialogs.cpp:136 msgid "Dir..." -msgstr "Verzeichnis..." +msgstr "Verzeichnis ..." #: smalldialogs.cpp:86 msgid "C (Optional):" @@ -2396,7 +2432,7 @@ #: smalldialogs.cpp:158 msgid "Configure..." -msgstr "Einrichten..." +msgstr "Einrichten ..." #: smalldialogs.cpp:329 msgid "Search text:" @@ -2487,4 +2523,3 @@ msgstr "" "Öffnende und schließende runde Klammern in regulärem Ausdruck passen nicht " "zusammen." - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/el.po --- a/kdiff3/po/el.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/el.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-12 20:37+0300\n" "Last-Translator: Spiros Georgaras \n" "Language-Team: Greek \n" @@ -63,7 +63,7 @@ "\n" "Η δυνατότητα Ï€ÏοεπεξεÏγασίας αντιστοίχησης γÏαμμών θα απενεÏγοποιηθεί τώÏα." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -71,7 +71,7 @@ "Σφάλμα απώλειας δεδομένων:\n" "Αν αναπαÏάγεται το σφάλμα, παÏακαλώ επικοινωνήστε με το συγγÏαφέα.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "ΣοβαÏÏŒ εσωτεÏικό σφάλμα" @@ -258,7 +258,7 @@ msgid "Changing All Merge Operations" msgstr "Αλλαγή όλων των λειτουÏγιών συγχώνευσης" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "Συνέ&χεια" @@ -661,14 +661,6 @@ msgid "Unfold All Subdirs" msgstr "Ανάπτυξη όλων των υποκαταλόγων" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Αποθήκευση κατάστασης συγχώνευσης καταλόγου..." - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "ΦόÏτωμα κατάστασης συγχώνευσης καταλόγου..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Επιλογή του Α για όλα τα αντικείμενα" @@ -741,7 +733,7 @@ msgid "Merge to A && B" msgstr "Συγχώνευση σε A && B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -750,7 +742,7 @@ "αντιγÏάφου ασφαλείας. \n" "Όνομα αÏχείου: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -758,53 +750,53 @@ "Αποτυχία μετονομασίας, κατά τη δημιουÏγία αντιγÏάφου ασφαλείας. \n" "Ονόματα αÏχείων: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Ανάκτηση κατάστασης αÏχείου: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Ανάγνωση αÏχείου: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "ΕγγÏαφή αÏχείου: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Τέλος μνήμης" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "ΔημιουÏγία καταλόγου: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "ΑφαίÏεση καταλόγου: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "ΑφαίÏεση αÏχείου: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "ΔημιουÏγία ÏƒÏ…Î¼Î²Î¿Î»Î¹ÎºÎ¿Ï Î´ÎµÏƒÎ¼Î¿Ï: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Μετονομασία αÏχείου: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "ΑντιγÏαφή αÏχείου: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -812,7 +804,7 @@ "Σφάλμα κατά την αντιγÏαφή: Το άνοιγμα του αÏχείου για ανάγνωση απέτυχε. Όνομα " "αÏχείου: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -820,21 +812,21 @@ "Σφάλμα κατά την αντιγÏαφή: Το άνοιγμα του αÏχείου για εγγÏαφή απέτυχε. Όνομα " "αÏχείου: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Σφάλμα κατά την αντιγÏαφή: Η ανάγνωση απέτυχε. Όνομα αÏχείου: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Σφάλμα κατά την αντιγÏαφή: Η εγγÏαφή απέτυχε. Όνομα αÏχείου: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Ανάγνωση καταλόγου: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Εμφάνιση καταλόγου: %1" @@ -927,7 +919,7 @@ #: kdiff3.cpp:465 msgid "Go to Current Delta" -msgstr "Μετάβαση στη Ï„Ïέχουσα διαφοÏά" +msgstr "Μετάβαση στην Ï„Ïέχουσα διαφοÏά" #: kdiff3.cpp:466 msgid "Go to First Delta" @@ -1183,11 +1175,11 @@ msgid "Toggle the statusbar..." msgstr "Εναλλαγή της γÏαμμής κατάστασης..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Δε βÏέθηκαν αÏχεία για σÏγκÏιση." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1291,15 +1283,15 @@ msgstr "" "+ Πολλές ευχαÏιστίες σε όσους ανέφεÏαν σφάλματα και συνεισέφεÏαν ιδέες!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "ΑÏιθμός εναπομείναντων μη λυμένων συγκÏοÏσεων: %1 ( %2 από τις οποίες αφοÏοÏν " "κενά)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1307,55 +1299,55 @@ "Η έξοδος έχει Ï„Ïοποποιηθεί.\n" "Αν συνεχίσετε οι αλλαγές σας θα χαθοÏν." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Όλα τα αÏχεία εισόδου είναι δυαδικά ίσα." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Όλα τα αÏχεία εισόδου πεÏιέχουν το ίδιο κείμενο." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Τα αÏχεία Α και Î’ είναι δυαδικά ίσα.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Τα αÏχεία Α και Î’ πεÏιέχουν το ίδιο κείμενο. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Τα αÏχεία Α και Γ είναι δυαδικά ίσα.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Τα αÏχεία Α και Γ πεÏιέχουν το ίδιο κείμενο. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Τα αÏχεία Î’ και Γ είναι δυαδικά ίσα.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Τα αÏχεία Î’ και Γ πεÏιέχουν το ίδιο κείμενο. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Συνολικός αÏιθμός συγκÏοÏσεων: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1363,7 +1355,7 @@ "\n" "ΑÏιθμός αυτόματα λυμένων συγκÏοÏσεων: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1371,31 +1363,31 @@ "\n" "ΑÏιθμός μη λυμένων συγκÏοÏσεων: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "ΣυγκÏοÏσεις" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "<ΧωÏίς γÏαμμή πηγής>" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "<ΣÏγκÏουση συγχώνευσης (μόνο κενών)>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<ΣÏγκÏουση συγχώνευσης>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Έξοδος" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[ΤÏοποποιημένο]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1403,11 +1395,11 @@ "Δεν έχουν επιλυθεί ακόμη όλες οι συγκÏοÏσεις.\n" "Το αÏχείο δεν αποθηκεÏτηκε.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "ΣυγκÏοÏσεις που απομένουν" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1417,11 +1409,11 @@ "\n" "Η δημιουÏγία αντιγÏάφου ασφαλείας απέτυχε. Το αÏχείο δεν αποθηκεÏτηκε." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Σφάλμα εγγÏαφής αÏχείου" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Σφάλμα κατά την εγγÏαφή." @@ -2074,11 +2066,11 @@ msgid "Regional Settings" msgstr "Ρυθμίσεις πεÏιοχής" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Γλώσσα (απαιτείται επανεκκίνηση)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2087,11 +2079,11 @@ "\"Αυτόματη\".\n" "Για να γίνει η αλλαγή της γλώσσας, επανεκκινήστε το KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "ΧÏήση της ίδιας κωδικοποίησης παντοÏ:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2101,35 +2093,35 @@ "ΑπενεÏγοποιήστε αυτήν την επιλογή αν χÏειάζεστε διαφοÏετικές επί μέÏους " "επιλογές." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Σημείωση: Η τοπική κωδικοποίηση είναι " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Κωδικοποίηση αÏχείου για το Α:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Κωδικοποίηση αÏχείου για το Î’:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Κωδικοποίηση αÏχείου για το Γ:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Κωδικοποίηση αÏχείου για την έξοδο συγχώνευσης και την αποθήκευση:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Κωδικοποίηση για τα αÏχεία του Ï€ÏοεπεξεÏγαστή:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Γλώσσας αναγνώσιμη από δεξιά στα αÏιστεÏά" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2137,19 +2129,19 @@ "ΜεÏικές γλώσσες διαβάζονται από δεξιά στα αÏιστεÏά.\n" "Αυτή η ÏÏθμιση θα Ï„Ïοποποίηση τον Ï€Ïοβολέα και τον επεξεÏγαστή κατάλληλα." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Ενσωμάτωση" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Ρυθμίσεις ενσωμάτωσης" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Επιλογές γÏαμμής εντολών για αγνόηση:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2161,7 +2153,7 @@ "ΜποÏοÏν να οÏισθοÏν πολλές τιμές διαχωÏισμένες με το ';'\n" "Αυτό καταστέλλει το σφάλμα \"Άγνωστης επιλογής\"." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2176,19 +2168,19 @@ "μήκους ίσως έχετε Ï€Ïοβλήματα κατά την επεξεÏγασία.\n" "Επιθυμείτε τη συνέχεια ή την επιλογή μιας άλλης γÏαμματοσειÏάς;" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Μη συμβατή γÏαμματοσειÏά" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Συνέχεια με δικιά σας ευθÏνη" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Επιλέξτε μία άλλη γÏαμματοσειÏά" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "Αυτό επαναφέÏει όλες τις επιλογές. Όχι μόνο αυτές του Ï„Ïέχοντος θέματος." @@ -2328,11 +2320,11 @@ msgid "Search Complete" msgstr "Η αναζήτηση ολοκληÏώθηκε" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "Δεν έχει επιλεγεί τίποτα σε κανένα παÏάθυÏο εισαγωγής διαφοÏών." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Σφάλμα κατά την Ï€Ïοσθήκη χειÏοκίνητου εÏÏους διαφοÏών" @@ -2527,3 +2519,9 @@ msgstr "" "Αδυναμία ταιÏιάσματος παÏενθέσεων ανοίγματος και κλεισίματος στην κανονική " "έκφÏαση." + +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Αποθήκευση κατάστασης συγχώνευσης καταλόγου..." + +#~ msgid "Load Directory Merge State ..." +#~ msgstr "ΦόÏτωμα κατάστασης συγχώνευσης καταλόγου..." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/en_GB.po --- a/kdiff3/po/en_GB.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/en_GB.po Sat Nov 04 00:05:00 2006 +0000 @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-02-02 11:52+0000\n" "Last-Translator: Andrew Coles \n" "Language-Team: British English \n" @@ -64,7 +64,7 @@ "\n" "The line-matching-preprocessing command will be disabled now." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -72,7 +72,7 @@ "Data loss error:\n" "If it is reproducable please contact the author.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Severe Internal Error" @@ -260,7 +260,7 @@ msgid "Changing All Merge Operations" msgstr "Changing All Merge Operations" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "C&ontinue" @@ -649,16 +649,6 @@ msgid "Unfold All Subdirs" msgstr "Unfold All Subdirs" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Directory Merge" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Directory Merge" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Choose A for All Items" @@ -734,7 +724,7 @@ msgid "Merge to A && B" msgstr "Merge to A && B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -742,7 +732,7 @@ "While trying to make a backup, deleting an older backup failed. \n" "Filename: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -750,81 +740,81 @@ "While trying to make a backup, renaming failed. \n" "Filenames: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Getting file status: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Reading file: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Writing file: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Out of memory" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Making directory: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Removing directory: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Removing file: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Creating symbolic link: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Renaming file: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Copying file: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" "Error during file copy operation: Opening file for reading failed. Filename: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" "Error during file copy operation: Opening file for writing failed. Filename: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Error during file copy operation: Reading failed. Filename: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Error during file copy operation: Writing failed. Filename: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Reading directory: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Listing directory: %1" @@ -1173,11 +1163,11 @@ msgid "Toggle the statusbar..." msgstr "Toggle the statusbar..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Couldn't find files for comparison." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1277,14 +1267,14 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "+ Many thanks to those who reported bugs and contributed ideas!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1292,55 +1282,55 @@ "The output has been modified.\n" "If you continue your changes will be lost." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "All input files are binary equal." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "All input files contain the same text." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Files A and B are binary equal.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Files A and B have equal text. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Files A and C are binary equal.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Files A and C have equal text. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Files B and C are binary equal.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Files B and C have equal text. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Total number of conflicts: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1348,7 +1338,7 @@ "\n" "Nr of automatically solved conflicts: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1356,31 +1346,31 @@ "\n" "Nr of unsolved conflicts: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Conflicts" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Output" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Modified]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1388,11 +1378,11 @@ "Not all conflicts are solved yet.\n" "File not saved.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Conflicts Left" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1402,11 +1392,11 @@ "\n" "Creating backup failed. File not saved." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "File Save Error" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Error while writing." @@ -2018,11 +2008,11 @@ msgid "Regional Settings" msgstr "Regional Settings" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Language (restart required)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2030,11 +2020,11 @@ "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Use the same encoding for everything:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2042,35 +2032,35 @@ "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Note: Local Encoding is " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "File Encoding for A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "File Encoding for B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "File Encoding for C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "File Encoding for Merge Output and Saving:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "File Encoding for Preprocessor Files:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Right To Left Language" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2078,21 +2068,21 @@ "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Operation" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Regional Settings" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2100,7 +2090,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2116,19 +2106,19 @@ "\n" "Do you want to continue or do you want to select another font." -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Incompatible Font" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Continue at Own Risk" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Select Another Font" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "This resets all options. Not only those of the current topic." @@ -2269,11 +2259,11 @@ msgid "Search Complete" msgstr "Search Complete" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Error while creating directory." @@ -2460,6 +2450,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Directory Merge" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Directory Merge" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Synchronise directories" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/es.po --- a/kdiff3/po/es.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/es.po Sat Nov 04 00:05:00 2006 +0000 @@ -4,14 +4,14 @@ # # Miguel Revilla Rodríguez , 2003. # Carlos Mayo Hernández , 2003,2004, 2005. -# santi , 2005, 2006. -# Santiago Fernandez Sancho , 2006. +# santi , 2005, 2006. +# Santiago Fernandez Sancho , 2006. msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-12 22:44+0200\n" -"Last-Translator: santi \n" +"Last-Translator: santi \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -67,7 +67,7 @@ "\n" "La orden de preprocesamiento de combinación de linea se desactivará." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -75,7 +75,7 @@ "Error de pérdida de datos:\n" "Si se puede reproducir contacte con el autor.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Error interno grave" @@ -262,7 +262,7 @@ msgid "Changing All Merge Operations" msgstr "Cambiando todas las operaciones de fusión" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "C&ontinuar" @@ -657,14 +657,6 @@ msgid "Unfold All Subdirs" msgstr "Desplegar todos los subdirectorios" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Guardar estado del directorio de fusión..." - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "Cargar estado del directorio de fusión..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Elegir A para todos los elementos" @@ -737,7 +729,7 @@ msgid "Merge to A && B" msgstr "Fusionar a A y B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -746,7 +738,7 @@ "eliminar una copia de seguridad anterior.\n" "Nombre de archivo: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -755,53 +747,53 @@ "renombrar.\n" "Nombres de archivos: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Obteniendo estado de archivo: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Leyendo archivo: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Escribiendo archivo: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Fuera de memoria" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Creando directorio: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Eliminando directorio: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Eliminando archivo: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Creando enlace simbólico: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Renombrando archivo: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Copiando archivo: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -809,7 +801,7 @@ "Error durante la operación de copia de archivo. Falló al abrir archivo para " "lectura. Nombre de archivo: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -817,25 +809,25 @@ "Error durante la operación de copia de archivo. Falló al abrir archivo para " "escritura. Nombre de archivo: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Error durante la operación de copia de archivo. Falló al leer. Nombre de " "archivo: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Error durante la operación de copia de archivo. Falló al escribir. Nombre de " "archivo: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Leyendo directorio: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Listando directorio: %1" @@ -1184,11 +1176,11 @@ msgid "Toggle the statusbar..." msgstr "Cambiar la barra de estado..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "No se pudo encontrar archivos para comparar." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1295,14 +1287,14 @@ "+ ¡Muchas gracias a aquellos que han informado de errores y han contribuido con " "ideas!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Número de conflictos sin resolver: %1 (%2 de los cuales son espacios en blanco)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1310,55 +1302,55 @@ "La salida ha sido modificada.\n" "Si continua, sus cambios se perderán." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Todos los archivos de entrada son binariamente iguales." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Todos los archivos de entrada contienen el mismo texto." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Los archivos A y B son binariamente iguales.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Los archivos A y B tiene el mismo texto. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Los archivos A y C son binariamente iguales.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Los archivos A y C tiene el mismo texto. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Los archivos B y C son binariamente iguales.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Los archivos B y C tiene el mismo texto. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Número total de conflictos: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1366,7 +1358,7 @@ "\n" "Nº de conflictos resueltos automáticamente: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1374,31 +1366,31 @@ "\n" "Nº de conflictos sin resolver: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Conflictos" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Salida" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Modificado]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1406,11 +1398,11 @@ "No todos los conflictos se han resuelto ya.\n" "Archivo sin guardar.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Conflictos que faltan" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1420,11 +1412,11 @@ "\n" "Fallo al crear copia de seguridad. Archivo sin guardar." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Error al guardar archivo" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Error al escribir." @@ -2077,11 +2069,11 @@ msgid "Regional Settings" msgstr "Configuraciones regionales" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Idioma (requiere reiniciar)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2089,11 +2081,11 @@ "Elija el idioma para las cadenas de la interfaz o «Auto».\n" "Para que ocurra el cambio de lenguaje, salga y reinicie KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Usar la misma codificación para todo:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2102,35 +2094,35 @@ "primera.\n" "Desactivar esto si se necesitan configuración individuales diferentes." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Nota: Codificación local es" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Codificación de archivo para A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Codificación de archivo para B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Codificación de archivo para C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Codificación de archivo para la salida de la fusión y guardar:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Codificación de archivo para los archivos del preprocesador:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Lenguaje de derecha a izquierda" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2138,19 +2130,19 @@ "Algunos lenguajes se leen de derecha a izquierda.\n" "Esta configuración cambiará el visor y el editor adaptándolo." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Integración" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Preferencias de integración" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Opciones de la línea de órdenes que se ignorarán:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2162,7 +2154,7 @@ "Se pueden especificar varios valores separados por «;»\n" "Eliminará el error «Error desconocido»." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2178,19 +2170,19 @@ "\n" "¿Desea continuar o desea seleccionar otra fuente?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Fuente incompatible" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Continuar bajo nuestro riesgo" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Seleccionar otra fuente" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Esto reestablece todas las opciones. No sólo las de tema actual." @@ -2330,12 +2322,12 @@ msgid "Search Complete" msgstr "Búsqueda completada" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" "No hay nada seleccionado en ninguna de las ventanas de entradas de diferencias." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Error al añadir un rango de diferencia manual" @@ -2529,3 +2521,9 @@ msgid "Opening and closing parentheses don't match in regular expression." msgstr "" "Apertura y cierre de paréntesis que no coinciden en la expresión regular." + +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Guardar estado del directorio de fusión..." + +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Cargar estado del directorio de fusión..." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/et.po --- a/kdiff3/po/et.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/et.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,13 +1,13 @@ # translation of kdiff3.po to Estonian # Copyright (C) 2003 Free Software Foundation, Inc. -# Marek Laane , 2003-2005. +# Marek Laane , 2003-2006. # msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" -"PO-Revision-Date: 2005-02-07 13:24+0300\n" -"Last-Translator: Marek Laane \n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-07-15 19:10+0300\n" +"Last-Translator: Marek Laane \n" "Language-Team: Estonian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -24,7 +24,7 @@ msgid "" "_: EMAIL OF TRANSLATORS\n" "Your emails" -msgstr "bald@online.ee" +msgstr "bald@starman.ee" #: diff.cpp:245 msgid "Writing clipboard data to temp file failed." @@ -62,7 +62,7 @@ "\n" "Praegu lülitatakse reasobivuse eeltöötluse käsu rakendamine välja." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -70,14 +70,13 @@ "Andmekaotuse viga:\n" "Kui see on korratav, võta palun ühendust autoriga.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Tõsine seesmine viga" #: difftextwindow.cpp:1637 kdiff3.cpp:743 -#, fuzzy msgid "Top line" -msgstr "Ülarida %1" +msgstr "Ülarida" #: difftextwindow.cpp:1647 msgid "End" @@ -257,7 +256,7 @@ msgid "Changing All Merge Operations" msgstr "Kõigi ühendamisoperatsioonide muutmine" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Jätka" @@ -621,9 +620,8 @@ msgstr "Sihtkoht: " #: directorymergewindow.cpp:2771 -#, fuzzy msgid "Save Directory Merge State As..." -msgstr "Kataloogi ühendamine" +msgstr "Kataloogi ühendamisoleku salvestamine..." #: directorymergewindow.cpp:2858 msgid "Start/Continue Directory Merge" @@ -649,16 +647,6 @@ msgid "Unfold All Subdirs" msgstr "Sule kõik alamkataloogid" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Kataloogi ühendamine" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Kataloogi ühendamine" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Vali A kõigile elementidele" @@ -681,34 +669,31 @@ #: directorymergewindow.cpp:2876 msgid "Show Identical Files" -msgstr "" +msgstr "Näita identseid faile" #: directorymergewindow.cpp:2877 -#, fuzzy msgid "Show Different Files" -msgstr "Erinevate failide arv:" +msgstr "Näita erinevaid faile" #: directorymergewindow.cpp:2878 msgid "Show Files only in A" -msgstr "" +msgstr "Näita ainult A faile" #: directorymergewindow.cpp:2879 msgid "Show Files only in B" -msgstr "" +msgstr "Näita ainult B faile" #: directorymergewindow.cpp:2880 msgid "Show Files only in C" -msgstr "" +msgstr "Näita ainult C faile" #: directorymergewindow.cpp:2884 -#, fuzzy msgid "Compare Explicitly Selected Files" -msgstr "Võrdle valitud faili" +msgstr "Võrdle valitud faile" #: directorymergewindow.cpp:2885 -#, fuzzy msgid "Merge Explicitly Selected Files" -msgstr "Võrdle valitud faili" +msgstr "Ühenda valitud failid" #: directorymergewindow.cpp:2887 directorymergewindow.cpp:2894 msgid "Do Nothing" @@ -734,7 +719,7 @@ msgid "Merge to A && B" msgstr "Ühenda A-sse ja B-sse" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -742,7 +727,7 @@ "Varukoopia tegemisel ebaõnnestus vanema varukoopia kustutamine. \n" "Faili nimi: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -750,53 +735,53 @@ "Varukoopia tegemisel ebaõnnestus ümbernimetamine. \n" "Failide nimed: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Faili staatuse hankimine: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Faili lugemine: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Faili kirjutamine: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Mälu napib" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Kataloogi loomine: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Kataloogi eemaldamine: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Faili eemaldamine: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Nimeviida loomine: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Faili ümbernimetamine: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Faili kopeerimine: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -804,7 +789,7 @@ "Viga faili kopeerimise operatsioonil: faili avamine lugemiseks ebaõnnestus. " "Failinimi: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -812,36 +797,34 @@ "Viga faili kopeerimise operatsioonil: faili avamine kirjutamiseks ebaõnnestus. " "Failinimi: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Viga faili kopeerimise operatsioonil: lugemine ebaõnnestus. Failinimi: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Viga faili kopeerimise operatsioonil: kirjutamine ebaõnnestus. Failinimi: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Kataloogi lugemine: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Kataloogi uurimine: %1" #: kdiff3.cpp:142 -#, fuzzy msgid "Current Configuration:" -msgstr "Käesoleva elemendi sünkroniseerimisoperatsioon" +msgstr "Aktiivne seadistus:" #: kdiff3.cpp:147 -#, fuzzy msgid "Config Option Error:" -msgstr "Viga faili avamisel" +msgstr "Seadistusvõtme viga:" #: kdiff3.cpp:187 msgid "Option --auto used, but no output file specified." @@ -878,7 +861,7 @@ #: kdiff3.cpp:422 msgid "Print the differences" -msgstr "" +msgstr "Trükib erinevused" #: kdiff3.cpp:424 msgid "Quits the application" @@ -898,7 +881,7 @@ #: kdiff3.cpp:432 msgid "Select everything in current window" -msgstr "" +msgstr "Kogu aktiivse akna sisu valimine" #: kdiff3.cpp:434 msgid "Search for a string" @@ -1045,21 +1028,19 @@ #: kdiff3.cpp:502 msgid "Run Regular Expression Auto Merge" -msgstr "" +msgstr "Käivita regulaaravaldis automaatühendamisel" #: kdiff3.cpp:503 -#, fuzzy msgid "Automatically Solve History Conflicts" -msgstr "Lahenda automaatselt lihtsad konfliktid" +msgstr "Lahenda automaatselt ajalookonfliktid" #: kdiff3.cpp:504 msgid "Split Diff At Selection" -msgstr "" +msgstr "Jaga erinevused valiku juures" #: kdiff3.cpp:505 -#, fuzzy msgid "Join Selected Diffs" -msgstr "Võrdle valitud faili" +msgstr "Ühenda valitud erinevused" #: kdiff3.cpp:507 msgid "Show Window A" @@ -1099,11 +1080,11 @@ #: kdiff3.cpp:517 msgid "Add Manual Diff Alignment" -msgstr "" +msgstr "Lisa käsitsi samasus" #: kdiff3.cpp:518 msgid "Clear All Manual Diff Alignments" -msgstr "" +msgstr "Eemalda kõik käsitsi määratud samasused" #: kdiff3.cpp:523 msgid "Focus Prev Window" @@ -1151,22 +1132,20 @@ msgstr "Faili salvestamine uue nimega..." #: kdiff3.cpp:722 -#, fuzzy msgid "Printing..." -msgstr "Väljumine..." +msgstr "Trükkimine..." #: kdiff3.cpp:728 kdiff3.cpp:890 msgid "Printing aborted." -msgstr "" +msgstr "Trükkimine katkestati" #: kdiff3.cpp:860 msgid "Selection" -msgstr "" +msgstr "Valik" #: kdiff3.cpp:886 -#, fuzzy msgid "Printing completed." -msgstr "Ühendamisoperatsioon lõpetatud." +msgstr "Trükkimine lõpetatud." #: kdiff3.cpp:896 msgid "Exiting..." @@ -1180,11 +1159,11 @@ msgid "Toggle the statusbar..." msgstr "Olekuriba lülitamine..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Faile võrdlemiseks ei leitud." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3 komponent" @@ -1247,15 +1226,16 @@ "Override a config setting. Use once for every setting. E.g.: --cs " "\"AutoAdvance=1\"" msgstr "" +"Seadistusvõtme tühistamine. Tuleb kasutada iga võtme jaoks eraldi, nt. --cs " +"\"AutoAdvance=1\"" #: main.cpp:54 msgid "Show list of config settings and current values." -msgstr "" +msgstr "Seadistuste nimekirja ja võtmete kehtivate väärtuste näitamine." #: main.cpp:55 -#, fuzzy msgid "Use a different config file." -msgstr "Erinevate failide arv:" +msgstr "Muu seadistustefaili kasutamine." #: main.cpp:59 msgid "file1 to open (base, if not specified via --base)" @@ -1271,7 +1251,7 @@ #: main.cpp:93 msgid "Ignored. (User defined.)" -msgstr "" +msgstr "Ignoreeritakse (kasutaja määratud)" #. i18n: file kdiff3_part.rc line 16 #: main.cpp:171 rc.cpp:9 @@ -1284,13 +1264,13 @@ msgstr "" "+ palju tänu kõigile, kes andsid teada vigadest ja pakkusid välja uusi mõtteid!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "Lahendamata konfliktide arv: %1 (neist %2 on tühimärgierinevused)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1298,55 +1278,55 @@ "Väljundit on muudetud.\n" "Kui jätkad, lähevad sinu muudatused kaotsi." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Kõik sisendfailid on binaarselt võrdsed." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Kõik sisendfailid sisaldavad ühesugust teksti." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Failid A ja B on binaarselt võrdsed.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Failid A ja B on ühesuguse tekstiga. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Failid A ja C on binaarselt võrdsed.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Failid A ja C on ühesuguse tekstiga. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Failid B ja C on binaarselt võrdsed.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Failid B ja C on ühesuguse tekstiga. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Konfliktide koguarv: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1354,7 +1334,7 @@ "\n" "Automaatselt lahendatud konfliktide arv: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1362,31 +1342,31 @@ "\n" "Lahendamata konfliktide arv: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Konfliktid" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "<Ühendamise konflikt (ainult tühimärgid)>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<Ühendamise konflikt>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Väljund" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Muudetud]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1394,11 +1374,11 @@ "Kõik konfliktid pole veel lahendatud.\n" "Faili ei salvestatud.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Järelejäänud konfliktid" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1408,11 +1388,11 @@ "\n" "Varukoopia loomine ebaõnnestus. Faili ei salvestatud." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Faili salvestamise viga" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Kirjutamise viga." @@ -1453,13 +1433,12 @@ msgstr "Värv" #: optiondialog.cpp:539 -#, fuzzy msgid "Colors Settings" -msgstr "Lokaale seadistused" +msgstr "Värviseadistused" #: optiondialog.cpp:553 msgid "Editor and Diff Views:" -msgstr "" +msgstr "Redaktori ja erinevuse vaated:" #: optiondialog.cpp:561 msgid "Foreground color:" @@ -1499,34 +1478,34 @@ #: optiondialog.cpp:622 msgid "Color for manually aligned difference ranges:" -msgstr "" +msgstr "Käsitsi määratud samasuse vahemiku värv:" #: optiondialog.cpp:627 -#, fuzzy msgid "Directory Comparison View:" -msgstr "Kataloogi võrdlemise olek" +msgstr "Kataloogi võrdlemise vaade:" #: optiondialog.cpp:633 msgid "Newest file color:" -msgstr "" +msgstr "Uusima faili värv:" #: optiondialog.cpp:636 msgid "" "Changing this color will only be effective when starting the next directory " "comparison." msgstr "" +"Seda värvi muudetakse alles siis, kui alustad järgmist kataloogide võrdlemist." #: optiondialog.cpp:641 msgid "Oldest file color:" -msgstr "" +msgstr "Vanima faili värv:" #: optiondialog.cpp:648 msgid "Middle age file color:" -msgstr "" +msgstr "Keskmise vanusega faili värv:" #: optiondialog.cpp:655 msgid "Color for missing files:" -msgstr "" +msgstr "Puuduvate failide värv:" #: optiondialog.cpp:667 msgid "Editor" @@ -1587,12 +1566,10 @@ "DOS/Windows: CR+LF; Unix: LF; sealjuures CR=0D, LF=0A" #: optiondialog.cpp:729 -#, fuzzy msgid "Diff and Merge" msgstr "Erinevus ja ühendamine" #: optiondialog.cpp:729 -#, fuzzy msgid "Diff and Merge Settings" msgstr "Erinevuse ja ühendamise seadistused" @@ -1704,11 +1681,11 @@ #: optiondialog.cpp:828 msgid "Automatic Merge Regular Expression" -msgstr "" +msgstr "Automaatühendamise regulaaravaldis" #: optiondialog.cpp:837 smalldialogs.cpp:379 msgid "Auto merge regular expression:" -msgstr "" +msgstr "Automaatühendamise regulaaravaldis:" #: optiondialog.cpp:841 msgid "" @@ -1717,24 +1694,30 @@ "When a line with a conflict matches the regular expression then\n" "- if available - C, otherwise B will be chosen." msgstr "" +"Regulaaravaldis ridadele, kus KDiff3 peab automaatselt valima ühe allika.\n" +"Kui konflikti sisaldav rida sobib regulaaravaldisega, siis\n" +"valitakse - kui võimalik - C, vastasel juhul B." #: optiondialog.cpp:847 msgid "Run regular expression auto merge on merge start" msgstr "" +"Regulaarühendusega automaatühendamise käivitamine ühendamise alustamisel" #: optiondialog.cpp:849 msgid "" "Run the merge for auto merge regular expressions\n" "immediately when a merge starts.\n" msgstr "" +"Regulaarühendusega automaatühendamine käivitatakse\n" +"kohe ühendamise alustamisel.\n" #: optiondialog.cpp:854 msgid "Version Control History Merging" -msgstr "" +msgstr "Versioonikonrolli ajaloo ühendamine" #: optiondialog.cpp:863 smalldialogs.cpp:406 msgid "History start regular expression:" -msgstr "" +msgstr "Ajaloo alguse regulaaravaldis:" #: optiondialog.cpp:867 msgid "" @@ -1742,10 +1725,13 @@ "Usually this line contains the \"$Log$\"-keyword.\n" "Default value: \".*\\$Log.*\\$.*\"" msgstr "" +"Regulaaravaldis versioonikontrolli ajaloo kirje alguse jaoks.\n" +"Tavaliselt leidub seal real võtmesõna \"$Log$\".\n" +"Vaikimisi: \".*\\$Log.*\\$.*\"" #: optiondialog.cpp:873 smalldialogs.cpp:435 msgid "History entry start regular expression:" -msgstr "" +msgstr "Ajaloo kirje alguse regulaaravaldis:" #: optiondialog.cpp:885 msgid "" @@ -1756,18 +1742,24 @@ "If left empty, then KDiff3 assumes that empty lines separate history entries.\n" "See the documentation for details." msgstr "" +"Versioonikontrolli ajaloo kirje koosneb mitmest reast.\n" +"Siin saab määrata esimese rea (ilma alustava kommentaarita) tuvastamiseks " +"mõeldud regulaaravaldise.\n" +"Sulgudega saab rühmitada võtmeid, mida tahad kasutada sortimiseks.\n" +"Kui see tühjaks jätta, eeldab KDiff3, et ajaloo kirjeid eraldavad tühjad read.\n" +"Täpsemalt räägib sellest käsiraamat." #: optiondialog.cpp:893 msgid "History merge sorting" -msgstr "" +msgstr "Ajaloo ühendamise sortimine" #: optiondialog.cpp:895 msgid "Sort version control history by a key." -msgstr "" +msgstr "Versioonikontrolli ajaloo sortimine võtmete järgi." #: optiondialog.cpp:905 msgid "History entry start sort key order:" -msgstr "" +msgstr "Ajaloo sortimisvõtmete järjekord:" #: optiondialog.cpp:909 msgid "" @@ -1778,22 +1770,30 @@ "If left empty, then no sorting will be done.\n" "See the documentation for details." msgstr "" +"Kõik ajalookirjete alguse määramiseks mõeldud regulaaravaldistes\n" +"kasutatud sulud rühmitavad võtmed, mida saab tarvitada sortimiseks.\n" +"Määra siin võtmete järjekord (need on siin järjekorras alates 1),\n" +"kasutades eraldajana koma ',' (nt. \"4,5,6,1,2,3,7\").\n" +"Kui see tühjaks jätta, siis midagi ei sordita.\n" +"Täpsemalt räägib sellest käsiraamat." #: optiondialog.cpp:920 msgid "Merge version control history on merge start" -msgstr "" +msgstr "Versioonikontrolli ajaloo ühendamine ühendamise alustamisel" #: optiondialog.cpp:922 msgid "Run version control history automerge on merge start." msgstr "" +"Versioonikontrolli ajaloo automaatühendamise käivitamine kohe ühendamise " +"alustamisel." #: optiondialog.cpp:926 msgid "Test your regular expressions" -msgstr "" +msgstr "Regulaaravaldiste test" #: optiondialog.cpp:931 msgid "Irrelevant merge command:" -msgstr "" +msgstr "Ebaolulise ühendamise käsk:" #: optiondialog.cpp:935 msgid "" @@ -1801,6 +1801,9 @@ "when no other relevant changes were detected.\n" "Called with the parameters: filename1 filename2 filename3" msgstr "" +"Määramise korral käivitatakse see skript\n" +"pärast automaatühendamist, kui muid muudatusi ei avastada.\n" +"See kutsutakse välja parameetritega: failinimi1 failinimi2 failinimi3" #: optiondialog.cpp:945 msgid "Directory Merge" @@ -1906,7 +1909,7 @@ #: optiondialog.cpp:1035 msgid "Case sensitive filename comparison" -msgstr "" +msgstr "Tõstutundlik failinimede võrdlemine" #: optiondialog.cpp:1038 msgid "" @@ -1915,6 +1918,9 @@ "Set this option if the case of the names must match. (Default for Windows is " "off, otherwise on.)" msgstr "" +"Kataloogide võrdlemisel võrreldakse failide või kataloogide nimesid.\n" +"Selle valiku sisselülitamisel peab sobima ka nimede tähesuurus (Windowsis on " +"see vaikimisi välja lülitatud, muidu sees)." #: optiondialog.cpp:1042 msgid "File Comparison Mode" @@ -2024,11 +2030,11 @@ msgid "Regional Settings" msgstr "Lokaale seadistused" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Keel (vajalik taaskäivitus)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2036,11 +2042,11 @@ "Vali GUI stringide keel või \"Auto\".\n" "Keele tegelikuks muutmiseks tuleb KDiff3 sulgeda ja uuesti käivitada." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Kõikjal kasutatakse kodeeringut:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2048,35 +2054,35 @@ "Lubab muuta kõiki kodeeringuid ainult esimest kodeeringut muutes.\n" "Kui vaja on erinevaid määratlusi, lülita välja." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Märkus: kohalik kodeering on " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "A kodeering:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "B kodeering:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "C kodeering" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Kodeering ühendamisväljundil ja salvestamisel:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Eelprotsessori failide kodeering:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Paremalt-vasakule keeled" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2084,29 +2090,31 @@ "Mõningaid keeli loetakse ja kirjutatakse paremalt vasakule.\n" "Selle valikuga saab vastavalt muuta näitajat ja redaktorit." -#: optiondialog.cpp:1315 -#, fuzzy +#: optiondialog.cpp:1318 msgid "Integration" -msgstr "Operatsioon" - -#: optiondialog.cpp:1315 -#, fuzzy +msgstr "Integreerimine" + +#: optiondialog.cpp:1318 msgid "Integration Settings" -msgstr "Lokaale seadistused" - -#: optiondialog.cpp:1325 +msgstr "Integreerimisseadistused" + +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" -msgstr "" - -#: optiondialog.cpp:1330 +msgstr "Ignoreeritavad käsurea võtmed:" + +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" "Several values can be specified if separated via ';'\n" "This will suppress the \"Unknown option\"-error." msgstr "" - -#: optiondialog.cpp:1383 +"Käsurea võtmete nimekiri, mida ignoreeritakse, kui KDiff3 kasutavad teised " +"tööriistad.\n" +"Mitme väärtuse andmisel tuleb need eraldada semikooloniga (;).\n" +"See väldib vigu \"Tundmatu võti\"." + +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2122,19 +2130,19 @@ "\n" "Kas soovid jätkata või valid uue fondi?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Sobimatu font" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Jätkan oma riskil" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Valin uue fondi" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "See lähtestab kõik valikud, mitte ainult praeguse teema omad." @@ -2207,23 +2215,21 @@ msgstr "Reaerinevus: A <-> C" #: pdiff.cpp:509 -#, fuzzy msgid "All input files contain the same text, but are not binary equal." -msgstr "Kõik sisendfailid sisaldavad ühesugust teksti." +msgstr "" +"Kõik sisendfailid sisaldavad ühesugust teksti, aga pole binaarselt võrdsed." #: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 -#, fuzzy msgid "" "Files %1 and %2 are binary equal.\n" msgstr "" -"Failid B ja C on binaarselt võrdsed.\n" +"Failid %1 ja %2 on binaarselt võrdsed.\n" #: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 -#, fuzzy msgid "" "Files %1 and %2 have equal text, but are not binary equal. \n" msgstr "" -"Failid A ja B on binaarselt võrdsed.\n" +"Failid %1 ja %2 sisaldavad ühesugust teksti, aga pole binaarselt võrdsed. \n" #: pdiff.cpp:526 msgid "" @@ -2275,14 +2281,13 @@ msgid "Search Complete" msgstr "Otsing lõpetatud" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." -msgstr "" - -#: pdiff.cpp:2129 -#, fuzzy +msgstr "Erinevuste sisendakendes pole midagi valitud." + +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" -msgstr "Viga kataloogi loomisel." +msgstr "Viga käsitsi määratud samasuse vahemiku lisamisel" #. i18n: file kdiff3_part.rc line 4 #: rc.cpp:3 @@ -2358,19 +2363,19 @@ #: smalldialogs.cpp:108 msgid "Swap/Copy Names ..." -msgstr "" +msgstr "Vaheta/kopeeri nimed..." #: smalldialogs.cpp:114 smalldialogs.cpp:115 smalldialogs.cpp:116 msgid "Swap %1<->%2" -msgstr "" +msgstr "Vaheta %1<->%2" #: smalldialogs.cpp:117 smalldialogs.cpp:118 smalldialogs.cpp:119 msgid "Copy %1->Output" -msgstr "" +msgstr "Kopeeri %1->väljund" #: smalldialogs.cpp:120 smalldialogs.cpp:121 smalldialogs.cpp:122 msgid "Swap %1<->Output" -msgstr "" +msgstr "Vaheta %1<->väljund" #: smalldialogs.cpp:129 msgid "Output (optional):" @@ -2410,88 +2415,60 @@ #: smalldialogs.cpp:376 msgid "Regular Expression Tester" -msgstr "" +msgstr "Regulaaravaldise test" #: smalldialogs.cpp:387 msgid "Example auto merge line:" -msgstr "" +msgstr "Automaatühendamise näidisrida:" #: smalldialogs.cpp:389 msgid "For auto merge test copy a line as used in your files." -msgstr "" +msgstr "Kopeeri automaatühendamise testimiseks rida oma failist." #: smalldialogs.cpp:395 smalldialogs.cpp:424 smalldialogs.cpp:461 msgid "Match result:" -msgstr "" +msgstr "Sobivuse tulemus:" #: smalldialogs.cpp:414 msgid "Example history start line (with leading comment):" -msgstr "" +msgstr "Ajaloo alguse näidisrida (alustava kommentaariga):" #: smalldialogs.cpp:417 msgid "" "Copy a history start line as used in your files,\n" "including the leading comment." msgstr "" +"Kopeeri oma failist ajaloo alguse rida,\n" +"kaasa arvatud alustav kommentaar." #: smalldialogs.cpp:443 msgid "History sort key order:" -msgstr "" +msgstr "Ajaloo sortimisvõtme järjekord:" #: smalldialogs.cpp:451 msgid "Example history entry start line (without leading comment):" -msgstr "" +msgstr "Ajalookirje alguse näidisrida (alustava kommentaarita):" #: smalldialogs.cpp:453 msgid "" "Copy a history entry start line as used in your files,\n" "but omit the leading comment." msgstr "" +"Kopeeri oma failist ajalookirje alguse rida,\n" +"kuid ilma alustava kommentaarita." #: smalldialogs.cpp:468 msgid "Sort key result:" -msgstr "" +msgstr "Sorteerimisvõtme tulemus:" #: smalldialogs.cpp:519 smalldialogs.cpp:529 smalldialogs.cpp:550 msgid "Match success." -msgstr "" +msgstr "Leiti sobivus." #: smalldialogs.cpp:523 smalldialogs.cpp:533 smalldialogs.cpp:556 -#, fuzzy msgid "Match failed." -msgstr "Salvestamine ebaõnnestus." +msgstr "Sobivust ei leitud." #: smalldialogs.cpp:541 msgid "Opening and closing parentheses don't match in regular expression." -msgstr "" - -#, fuzzy -#~ msgid "Synchronize Directories" -#~ msgstr "Kataloogide sünkroniseerimine" - -#, fuzzy -#~ msgid "Copy Newer Files Instead of Merging" -#~ msgstr "Ühendamise asemel kopeeritakse uuem (ebaturvaline)" - -#~ msgid "List only deltas" -#~ msgstr "Ainult erinevuste näitamine" - -#~ msgid "Files and directories without change will not appear in the list." -#~ msgstr "Nimekirjas ei näidata muutusteta faile ja katalooge." - -#, fuzzy -#~ msgid "no selection" -#~ msgstr "Valiku automaatne kopeerimine" - -#, fuzzy -#~ msgid "Manually match lines" -#~ msgstr "Käsitsivalik" - -#~ msgid "Has no effect. For compatibility with certain tools." -#~ msgstr "Toimeta. Ühilduvuseks teatud tööriistadega." - -#~ msgid "For compatibility with certain tools." -#~ msgstr "Ühilduvuseks teatud tööriistadega." - -#~ msgid "Colors in Editor & Diff Output" -#~ msgstr "Redaktori ja erinevuse väljundi värvid" +msgstr "Regulaaravaldises ei sobi alustavad ja lõpetavad sulud." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/fr.po --- a/kdiff3/po/fr.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/fr.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-02-03 21:34+0100\n" "Last-Translator: Simon Depiets <2df@tuxfamily.org>\n" "Language-Team: Français \n" @@ -63,7 +63,7 @@ "\n" "Le préprocessus de comparaison de lignes sera désormais désactivé." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -71,7 +71,7 @@ "Données perdues :\n" "Si cela se reproduit, contactez l'auteur.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Erreur interne sévère" @@ -259,7 +259,7 @@ msgid "Changing All Merge Operations" msgstr "Changement de toutes les opérations de fusion" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "C&ontinuer" @@ -660,16 +660,6 @@ msgid "Unfold All Subdirs" msgstr "Ne pas suivre les sous-dossiers" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Fusion de dossiers" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Fusion de dossiers" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Choisir A pour tous les éléments" @@ -745,7 +735,7 @@ msgid "Merge to A && B" msgstr "Fusionner vers A && B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -754,7 +744,7 @@ "précédent a échoué.\n" "Nom du fichier :" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -762,53 +752,53 @@ "Pendant le tentative d'enregistrement, le changement de nom a échoué.\n" "Noms des fichiers :" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Recherche de l'état du fichier : %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Lecture du fichier : %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Écriture du fichier : %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Plus de mémoire" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Création du dossier : %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Suppression du dossier  %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Suppression du fichier : %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Création d'un lien symbolique : %1 vers %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Changement de nom du fichier : %1 vers %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Copie du fichier : %1 vers %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -816,7 +806,7 @@ "Erreur durant la copie : l'ouverture du fichier pour la lecture a échoué. Nom " "du Fichier : %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -824,23 +814,23 @@ "Erreur durant la copie : l'ouverture du fichier pour l'écriture a échoué. Nom " "du Fichier : %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Erreur durant la copie d'un fichier : échec de la lecture. Nom du fichier : %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Erreur durant la copie d'un fichier : échec de l'écriture. Nom du fichier : %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Lecture du dossier : " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Listage du dossier : %1" @@ -1192,11 +1182,11 @@ msgid "Toggle the statusbar..." msgstr "Cadrage de la barre de état..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Impossible de trouver les fichiers pour la comparaison" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1303,15 +1293,15 @@ "+ Beaucoup de remerciements à ceux qui ont rapporté des bogues et contriibué a " "des idées !" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Nombre de conflits non résolus restants : %1 (dont %2 sont des conflits " "d'espaces)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1319,55 +1309,55 @@ "Le résultat a été modifié.\n" "Si vous continuez, vos changement seront perdus." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Tous les fichiers d'entrées sont égaux binairement." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Tous les fichiers d'entrées contiennent le même texte." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Les fichiers A et B sont égaux binairement.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Les fichiers A et B ont le même texte.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Les fichiers A et C sont égaux binairement.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Les fichiers A et C ont le même texte.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Les fichiers B et C sont égaux binairement.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Les fichiers B et C ont le même texte.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Nombre total de conflits : " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1375,7 +1365,7 @@ "\n" "Nombre de conflits résolus automatiquement : " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1383,31 +1373,31 @@ "\n" "Nombre de conflits non résolus : " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Conflits" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Sortie" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Modifié]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1415,11 +1405,11 @@ "Tous les conflits ne sont pas encore résolus.\n" "Fichier non enregistré.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Il reste des conflits" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1429,11 +1419,11 @@ "\n" "La création de la sauvegarde a échoué. Fichier non enregistré." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Erreur d'enregistrement du fichier" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Erreur durant l'écriture." @@ -2058,11 +2048,11 @@ msgid "Regional Settings" msgstr "Options régionales" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Langue (redémarrage nécessaire)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2070,11 +2060,11 @@ "Choisissez la langue de l'interface graphique ou \"Auto\".\n" "Pour que le changement de langue prenne effet, quittez puis redémarrez KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Utiliser le même encodage pour tout :" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2084,36 +2074,36 @@ "Désactivez ceci si des configurations individuelles différentes sont " "nécessaires." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Note : L'encodage local est" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Encodage du fichier pour A :" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Encodage du fichier pour B :" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Encodage du fichier pour C :" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" "Encodage du fichier pour le résultat de la fusion et l'enregistrement :" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Encodage du fichier pour les fichiers préprocesseurs :" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Encodage de droite à gauche" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2121,21 +2111,21 @@ "Certains langages sont lus de droite à gauche.\n" "Cette option changera le visionneur et l'éditeur." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Opération" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Options régionales" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2143,7 +2133,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2159,19 +2149,19 @@ "\n" "Voulez-vous continuer ou voulez-vous sélectionner une autre police." -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Police incompatible" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Continuez à vos risques et périls" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Sélectionnez une autre police" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "Cela remet à zéro toutes les options. Pas seulement celles de la rubrique " @@ -2314,11 +2304,11 @@ msgid "Search Complete" msgstr "Recherche terminée." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Erreur durant la création du dossier" @@ -2505,6 +2495,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Fusion de dossiers" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Fusion de dossiers" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Synchroniser les dossiers" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/ga.po --- a/kdiff3/po/ga.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/ga.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: kdeextragear-1/kdiff3.po\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2004-12-03 14:52-0500\n" "Last-Translator: Kevin Patrick Scannell \n" "Language-Team: ga \n" @@ -47,13 +47,13 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Earráid Throm Inmheánach" @@ -232,7 +232,7 @@ msgid "Changing All Merge Operations" msgstr "" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Lean ar aghaidh" @@ -369,7 +369,7 @@ #: directorymergewindow.cpp:2016 msgid "Do It" -msgstr "" +msgstr "Déan" #: directorymergewindow.cpp:2016 msgid "Simulate It" @@ -595,14 +595,6 @@ msgid "Unfold All Subdirs" msgstr "" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "" @@ -675,91 +667,91 @@ msgid "Merge to A && B" msgstr "" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Comhad á léamh: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Comhad á scríobh: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Cuimhne ídithe" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Comhadlann á déanamh: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Comhadlann á baint: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Comhad á bhaint: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Nasc siombalach á chruthú: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Comhad á athainmniú: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Comhad á chóipeáil: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Comhadlann á léamh: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "" @@ -1099,11 +1091,11 @@ msgid "Toggle the statusbar..." msgstr "Scoránaigh an barra stádais..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1198,118 +1190,118 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Coinbhleachtaí" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Aschur" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Athraithe]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "" @@ -1679,7 +1671,7 @@ #: optiondialog.cpp:954 msgid "Recursive directories" -msgstr "" +msgstr "Comhadlanna athchúrsacha" #: optiondialog.cpp:956 msgid "Whether to analyze subdirectories or not." @@ -1730,7 +1722,7 @@ #: optiondialog.cpp:999 msgid "Find hidden files and directories" -msgstr "" +msgstr "Aimsigh comhaid agus comhadlanna folaithe" #: optiondialog.cpp:1002 msgid "Finds files and directories with the hidden attribute." @@ -1782,7 +1774,7 @@ #: optiondialog.cpp:1047 msgid "Binary comparison of each file. (Default)" -msgstr "" +msgstr "Comparáid dénártha de gach comhad. (Réamhshocrú)" #: optiondialog.cpp:1049 msgid "Full analysis" @@ -1862,73 +1854,73 @@ msgid "Regional Settings" msgstr "Socruithe Réigiúnda" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Teanga (atosú de dhíth)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Comhtháthú" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Socruithe Comhtháthaithe" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -1936,7 +1928,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -1946,19 +1938,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Cló Neamh-chomhoiriúnach" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Lean ort ar do phriacal féin" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Roghnaigh Cló Eile" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" @@ -2087,11 +2079,11 @@ msgid "Search Complete" msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/gl.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/po/gl.po Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2271 @@ +# translation of kdiff3.po to Galician +# mvillarino , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: kdiff3\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-06-03 21:54+0200\n" +"Last-Translator: mvillarino \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.10\n" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "mvillarino" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "mvillarino@users.sourceforge.net" + +#: diff.cpp:245 +msgid "Writing clipboard data to temp file failed." +msgstr "" + +#: diff.cpp:249 +msgid "From Clipboard" +msgstr "" + +#: diff.cpp:451 +msgid "" +"Preprocessing possibly failed. Check this command:\n" +"\n" +" %1\n" +"\n" +"The preprocessing command will be disabled now." +msgstr "" + +#: diff.cpp:486 +msgid "" +"The line-matching-preprocessing possibly failed. Check this command:\n" +"\n" +" %1\n" +"\n" +"The line-matching-preprocessing command will be disabled now." +msgstr "" + +#: diff.cpp:1587 diff.cpp:1601 +msgid "" +"Data loss error:\n" +"If it is reproducable please contact the author.\n" +msgstr "" + +#: diff.cpp:1589 diff.cpp:1603 +msgid "Severe Internal Error" +msgstr "" + +#: difftextwindow.cpp:1637 kdiff3.cpp:743 +msgid "Top line" +msgstr "" + +#: difftextwindow.cpp:1647 +msgid "End" +msgstr "Fin" + +#: directorymergewindow.cpp:142 +msgid "Mix of links and normal files." +msgstr "" + +#: directorymergewindow.cpp:149 +msgid "Link: " +msgstr "" + +#: directorymergewindow.cpp:157 +msgid "Size. " +msgstr "" + +#: directorymergewindow.cpp:170 +msgid "Date & Size: " +msgstr "" + +#: directorymergewindow.cpp:179 directorymergewindow.cpp:185 +msgid "Creating temp copy of %1 failed." +msgstr "" + +#: directorymergewindow.cpp:196 directorymergewindow.cpp:204 +msgid "Opening %1 failed." +msgstr "" + +#: directorymergewindow.cpp:208 +msgid "Comparing file..." +msgstr "" + +#: directorymergewindow.cpp:218 directorymergewindow.cpp:224 +#, c-format +msgid "Error reading from %1" +msgstr "" + +#: directorymergewindow.cpp:282 +msgid "Name" +msgstr "Nome" + +#: directorymergewindow.cpp:286 +msgid "Operation" +msgstr "" + +#: directorymergewindow.cpp:287 +msgid "Status" +msgstr "Estado" + +#: directorymergewindow.cpp:288 +msgid "Unsolved" +msgstr "" + +#: directorymergewindow.cpp:289 +msgid "Solved" +msgstr "" + +#: directorymergewindow.cpp:290 +msgid "Nonwhite" +msgstr "" + +#: directorymergewindow.cpp:291 +msgid "White" +msgstr "" + +#: directorymergewindow.cpp:319 +msgid "" +"You are currently doing a directory merge. Are you sure, you want to abort the " +"merge and rescan the directory?" +msgstr "" + +#: directorymergewindow.cpp:320 directorymergewindow.cpp:2864 +msgid "Rescan" +msgstr "Analisar de Novo" + +#: directorymergewindow.cpp:320 kdiff3.cpp:594 pdiff.cpp:965 +msgid "Continue Merging" +msgstr "" + +#: directorymergewindow.cpp:462 +msgid "Opening of directories failed:" +msgstr "" + +#: directorymergewindow.cpp:465 +msgid "" +"Dir A \"%1\" does not exist or is not a directory.\n" +msgstr "" + +#: directorymergewindow.cpp:468 +msgid "" +"Dir B \"%1\" does not exist or is not a directory.\n" +msgstr "" + +#: directorymergewindow.cpp:471 +msgid "" +"Dir C \"%1\" does not exist or is not a directory.\n" +msgstr "" + +#: directorymergewindow.cpp:473 +msgid "Directory Open Error" +msgstr "" + +#: directorymergewindow.cpp:481 +msgid "" +"The destination directory must not be the same as A or B when three directories " +"are merged.\n" +"Check again before continuing." +msgstr "" + +#: directorymergewindow.cpp:483 +msgid "Parameter Warning" +msgstr "" + +#: directorymergewindow.cpp:488 +msgid "Scanning directories..." +msgstr "" + +#: directorymergewindow.cpp:537 +msgid "Reading Directory A" +msgstr "" + +#: directorymergewindow.cpp:559 +msgid "Reading Directory B" +msgstr "" + +#: directorymergewindow.cpp:581 +msgid "Reading Directory C" +msgstr "" + +#: directorymergewindow.cpp:607 +msgid "Some subdirectories were not readable in" +msgstr "" + +#: directorymergewindow.cpp:612 +msgid "Check the permissions of the subdirectories." +msgstr "" + +#: directorymergewindow.cpp:646 kdiff3.cpp:547 kdiff3.cpp:627 kdiff3.cpp:651 +#: kdiff3.cpp:924 kdiff3.cpp:945 pdiff.cpp:1045 pdiff.cpp:1117 pdiff.cpp:1155 +#: pdiff.cpp:1171 pdiff.cpp:1201 pdiff.cpp:1212 +msgid "Ready." +msgstr "Listo." + +#: directorymergewindow.cpp:660 +msgid "Directory Comparison Status" +msgstr "" + +#: directorymergewindow.cpp:661 +msgid "Number of subdirectories:" +msgstr "" + +#: directorymergewindow.cpp:662 +msgid "Number of equal files:" +msgstr "" + +#: directorymergewindow.cpp:663 +msgid "Number of different files:" +msgstr "" + +#: directorymergewindow.cpp:666 +msgid "Number of manual merges:" +msgstr "" + +#: directorymergewindow.cpp:802 +msgid "This affects all merge operations." +msgstr "" + +#: directorymergewindow.cpp:803 +msgid "Changing All Merge Operations" +msgstr "" + +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 +msgid "C&ontinue" +msgstr "" + +#: directorymergewindow.cpp:1169 +msgid "Processing " +msgstr "" + +#: directorymergewindow.cpp:1644 directorymergewindow.cpp:1650 +msgid "To do." +msgstr "" + +#: directorymergewindow.cpp:1752 directorymergewindow.cpp:2895 +msgid "Copy A to B" +msgstr "" + +#: directorymergewindow.cpp:1753 directorymergewindow.cpp:2896 +msgid "Copy B to A" +msgstr "" + +#: directorymergewindow.cpp:1754 directorymergewindow.cpp:2897 +msgid "Delete A" +msgstr "" + +#: directorymergewindow.cpp:1755 directorymergewindow.cpp:2898 +msgid "Delete B" +msgstr "" + +#: directorymergewindow.cpp:1756 +msgid "Delete A & B" +msgstr "" + +#: directorymergewindow.cpp:1757 directorymergewindow.cpp:2900 +msgid "Merge to A" +msgstr "" + +#: directorymergewindow.cpp:1758 directorymergewindow.cpp:2901 +msgid "Merge to B" +msgstr "" + +#: directorymergewindow.cpp:1759 +msgid "Merge to A & B" +msgstr "" + +#: directorymergewindow.cpp:1763 directorymergewindow.cpp:2892 +msgid "Delete (if exists)" +msgstr "" + +#: directorymergewindow.cpp:1764 directorymergewindow.cpp:1765 +#: directorymergewindow.cpp:2891 smalldialogs.cpp:102 +msgid "Merge" +msgstr "" + +#: directorymergewindow.cpp:1764 directorymergewindow.cpp:1765 +msgid "Merge (manual)" +msgstr "" + +#: directorymergewindow.cpp:1766 +msgid "Error: Conflicting File Types" +msgstr "" + +#: directorymergewindow.cpp:1767 +msgid "Error: Dates are equal but files are not." +msgstr "" + +#: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 +#: directorymergewindow.cpp:1845 +msgid "This operation is currently not possible." +msgstr "" + +#: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 +#: directorymergewindow.cpp:1845 directorymergewindow.cpp:2102 +msgid "Operation Not Possible" +msgstr "" + +#: directorymergewindow.cpp:1884 +msgid "" +"This should never happen: \n" +"\n" +"mergeResultSaved: m_pMFI=0\n" +"\n" +"If you know how to reproduce this, please contact the program author." +msgstr "" + +#: directorymergewindow.cpp:1884 +msgid "Program Error" +msgstr "" + +#: directorymergewindow.cpp:1895 +msgid "" +"An error occurred while copying.\n" +msgstr "" + +#: directorymergewindow.cpp:1896 directorymergewindow.cpp:2302 +msgid "Merge Error" +msgstr "" + +#: directorymergewindow.cpp:1901 directorymergewindow.cpp:2307 +msgid "Error." +msgstr "" + +#: directorymergewindow.cpp:1906 directorymergewindow.cpp:2198 +#: directorymergewindow.cpp:2238 +msgid "Done." +msgstr "" + +#: directorymergewindow.cpp:1929 +msgid "Not saved." +msgstr "" + +#: directorymergewindow.cpp:1964 +msgid "Unknown merge operation. (This must never happen!)" +msgstr "" + +#: directorymergewindow.cpp:1996 +msgid "Unknown merge operation." +msgstr "" + +#: directorymergewindow.cpp:2011 +msgid "" +"The merge is about to begin.\n" +"\n" +"Choose \"Do it\" if you have read the instructions and know what you are " +"doing.\n" +"Choosing \"Simulate it\" will tell you what would happen.\n" +"\n" +"Be aware that this program still has beta status and there is NO WARRANTY " +"whatsoever! Make backups of your vital data!" +msgstr "" + +#: directorymergewindow.cpp:2016 +msgid "Starting Merge" +msgstr "" + +#: directorymergewindow.cpp:2016 +msgid "Do It" +msgstr "" + +#: directorymergewindow.cpp:2016 +msgid "Simulate It" +msgstr "" + +#: directorymergewindow.cpp:2042 +msgid "" +"The highlighted item has a different type in the different directories. Select " +"what to do." +msgstr "" + +#: directorymergewindow.cpp:2051 +msgid "" +"The modification dates of the file are equal but the files are not. Select what " +"to do." +msgstr "" + +#: directorymergewindow.cpp:2102 +msgid "" +"This operation is currently not possible because directory merge is currently " +"running." +msgstr "" + +#: directorymergewindow.cpp:2162 +msgid "" +"There was an error in the last step.\n" +"Do you want to continue with the item that caused the error or do you want to " +"skip this item?" +msgstr "" + +#: directorymergewindow.cpp:2164 +msgid "Continue merge after an error" +msgstr "" + +#: directorymergewindow.cpp:2164 +msgid "Continue With Last Item" +msgstr "" + +#: directorymergewindow.cpp:2164 +msgid "Skip Item" +msgstr "" + +#: directorymergewindow.cpp:2198 +msgid "Skipped." +msgstr "" + +#: directorymergewindow.cpp:2205 directorymergewindow.cpp:2431 +msgid "In progress..." +msgstr "" + +#: directorymergewindow.cpp:2253 +msgid "Merge operation complete." +msgstr "" + +#: directorymergewindow.cpp:2253 directorymergewindow.cpp:2256 +msgid "Merge Complete" +msgstr "" + +#: directorymergewindow.cpp:2265 +msgid "" +"Simulated merge complete: Check if you agree with the proposed operations." +msgstr "" + +#: directorymergewindow.cpp:2301 +msgid "" +"An error occurred. Press OK to see detailed information.\n" +msgstr "" + +#: directorymergewindow.cpp:2344 +msgid "Error: While deleting %1: Creating backup failed." +msgstr "" + +#: directorymergewindow.cpp:2351 +msgid "delete directory recursively( %1 )" +msgstr "" + +#: directorymergewindow.cpp:2353 +msgid "delete( %1 )" +msgstr "" + +#: directorymergewindow.cpp:2368 +msgid "Error: delete dir operation failed while trying to read the directory." +msgstr "" + +#: directorymergewindow.cpp:2387 +msgid "Error: rmdir( %1 ) operation failed." +msgstr "" + +#: directorymergewindow.cpp:2397 +msgid "Error: delete operation failed." +msgstr "" + +#: directorymergewindow.cpp:2423 +msgid "manual merge( %1, %2, %3 -> %4)" +msgstr "" + +#: directorymergewindow.cpp:2426 +msgid "" +" Note: After a manual merge the user should continue by pressing F7." +msgstr "" + +#: directorymergewindow.cpp:2449 +msgid "Error: copy( %1 -> %2 ) failed.Deleting existing destination failed." +msgstr "" + +#: directorymergewindow.cpp:2459 +msgid "copyLink( %1 -> %2 )" +msgstr "" + +#: directorymergewindow.cpp:2470 +msgid "Error: copyLink failed: Remote links are not yet supported." +msgstr "" + +#: directorymergewindow.cpp:2476 +msgid "Error: copyLink failed." +msgstr "" + +#: directorymergewindow.cpp:2496 +msgid "copy( %1 -> %2 )" +msgstr "" + +#: directorymergewindow.cpp:2522 +msgid "Error during rename( %1 -> %2 ): Cannot delete existing destination." +msgstr "" + +#: directorymergewindow.cpp:2528 +msgid "rename( %1 -> %2 )" +msgstr "" + +#: directorymergewindow.cpp:2537 +msgid "Error: Rename failed." +msgstr "" + +#: directorymergewindow.cpp:2555 +msgid "Error during makeDir of %1. Cannot delete existing file." +msgstr "" + +#: directorymergewindow.cpp:2571 +msgid "makeDir( %1 )" +msgstr "" + +#: directorymergewindow.cpp:2581 +msgid "Error while creating directory." +msgstr "" + +#: directorymergewindow.cpp:2604 directorymergewindow.cpp:2721 +msgid "Dest" +msgstr "" + +#: directorymergewindow.cpp:2608 directorymergewindow.cpp:2646 +msgid "Dir" +msgstr "" + +#: directorymergewindow.cpp:2609 +msgid "Type" +msgstr "Tipo" + +#: directorymergewindow.cpp:2610 +msgid "Size" +msgstr "Tamaño" + +#: directorymergewindow.cpp:2611 +msgid "Attr" +msgstr "" + +#: directorymergewindow.cpp:2612 +msgid "Last Modification" +msgstr "" + +#: directorymergewindow.cpp:2613 +msgid "Link-Destination" +msgstr "" + +#: directorymergewindow.cpp:2663 +msgid "not available" +msgstr "non disponíbel" + +#: directorymergewindow.cpp:2683 +msgid "A (Dest): " +msgstr "" + +#: directorymergewindow.cpp:2686 +msgid "A (Base): " +msgstr "" + +#: directorymergewindow.cpp:2692 +msgid "B (Dest): " +msgstr "" + +#: directorymergewindow.cpp:2700 +msgid "C (Dest): " +msgstr "" + +#: directorymergewindow.cpp:2706 +msgid "Dest: " +msgstr "" + +#: directorymergewindow.cpp:2771 +msgid "Save Directory Merge State As..." +msgstr "" + +#: directorymergewindow.cpp:2858 +msgid "Start/Continue Directory Merge" +msgstr "" + +#: directorymergewindow.cpp:2859 +msgid "Run Operation for Current Item" +msgstr "" + +#: directorymergewindow.cpp:2860 +msgid "Compare Selected File" +msgstr "" + +#: directorymergewindow.cpp:2861 +msgid "Merge Current File" +msgstr "" + +#: directorymergewindow.cpp:2862 +msgid "Fold All Subdirs" +msgstr "" + +#: directorymergewindow.cpp:2863 +msgid "Unfold All Subdirs" +msgstr "" + +#: directorymergewindow.cpp:2867 +msgid "Choose A for All Items" +msgstr "" + +#: directorymergewindow.cpp:2868 +msgid "Choose B for All Items" +msgstr "" + +#: directorymergewindow.cpp:2869 +msgid "Choose C for All Items" +msgstr "" + +#: directorymergewindow.cpp:2870 +msgid "Auto-Choose Operation for All Items" +msgstr "" + +#: directorymergewindow.cpp:2871 +msgid "No Operation for All Items" +msgstr "" + +#: directorymergewindow.cpp:2876 +msgid "Show Identical Files" +msgstr "" + +#: directorymergewindow.cpp:2877 +msgid "Show Different Files" +msgstr "" + +#: directorymergewindow.cpp:2878 +msgid "Show Files only in A" +msgstr "" + +#: directorymergewindow.cpp:2879 +msgid "Show Files only in B" +msgstr "" + +#: directorymergewindow.cpp:2880 +msgid "Show Files only in C" +msgstr "" + +#: directorymergewindow.cpp:2884 +msgid "Compare Explicitly Selected Files" +msgstr "" + +#: directorymergewindow.cpp:2885 +msgid "Merge Explicitly Selected Files" +msgstr "" + +#: directorymergewindow.cpp:2887 directorymergewindow.cpp:2894 +msgid "Do Nothing" +msgstr "Non facer Nada" + +#: directorymergewindow.cpp:2888 +msgid "A" +msgstr "" + +#: directorymergewindow.cpp:2889 +msgid "B" +msgstr "" + +#: directorymergewindow.cpp:2890 +msgid "C" +msgstr "C" + +#: directorymergewindow.cpp:2899 +msgid "Delete A && B" +msgstr "" + +#: directorymergewindow.cpp:2902 +msgid "Merge to A && B" +msgstr "" + +#: fileaccess.cpp:581 +msgid "" +"While trying to make a backup, deleting an older backup failed. \n" +"Filename: " +msgstr "" + +#: fileaccess.cpp:588 +msgid "" +"While trying to make a backup, renaming failed. \n" +"Filenames: " +msgstr "" + +#: fileaccess.cpp:610 +#, c-format +msgid "Getting file status: %1" +msgstr "" + +#: fileaccess.cpp:653 +#, c-format +msgid "Reading file: %1" +msgstr "" + +#: fileaccess.cpp:689 +#, c-format +msgid "Writing file: %1" +msgstr "" + +#: fileaccess.cpp:717 +msgid "Out of memory" +msgstr "" + +#: fileaccess.cpp:752 +#, c-format +msgid "Making directory: %1" +msgstr "" + +#: fileaccess.cpp:772 +#, c-format +msgid "Removing directory: %1" +msgstr "" + +#: fileaccess.cpp:787 +#, c-format +msgid "Removing file: %1" +msgstr "" + +#: fileaccess.cpp:803 +msgid "Creating symbolic link: %1 -> %2" +msgstr "" + +#: fileaccess.cpp:829 +msgid "Renaming file: %1 -> %2" +msgstr "" + +#: fileaccess.cpp:865 +msgid "Copying file: %1 -> %2" +msgstr "" + +#: fileaccess.cpp:879 +#, c-format +msgid "" +"Error during file copy operation: Opening file for reading failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:885 +#, c-format +msgid "" +"Error during file copy operation: Opening file for writing failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:900 +#, c-format +msgid "Error during file copy operation: Reading failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:909 +#, c-format +msgid "Error during file copy operation: Writing failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:1205 +msgid "Reading directory: " +msgstr "" + +#: fileaccess.cpp:1334 +#, c-format +msgid "Listing directory: %1" +msgstr "" + +#: kdiff3.cpp:142 +msgid "Current Configuration:" +msgstr "" + +#: kdiff3.cpp:147 +msgid "Config Option Error:" +msgstr "" + +#: kdiff3.cpp:187 +msgid "Option --auto used, but no output file specified." +msgstr "" + +#: kdiff3.cpp:318 +msgid "Option --auto ignored for directory comparison." +msgstr "" + +#: kdiff3.cpp:354 +msgid "Saving failed." +msgstr "" + +#: kdiff3.cpp:381 pdiff.cpp:1027 pdiff.cpp:1098 +msgid "Opening of these files failed:" +msgstr "" + +#: kdiff3.cpp:390 +msgid "File Open Error" +msgstr "" + +#: kdiff3.cpp:413 +msgid "Opens documents for comparison..." +msgstr "" + +#: kdiff3.cpp:418 +msgid "Saves the merge result. All conflicts must be solved!" +msgstr "" + +#: kdiff3.cpp:420 +msgid "Saves the current document as..." +msgstr "" + +#: kdiff3.cpp:422 +msgid "Print the differences" +msgstr "" + +#: kdiff3.cpp:424 +msgid "Quits the application" +msgstr "Sai da aplicazón" + +#: kdiff3.cpp:426 +msgid "Cuts the selected section and puts it to the clipboard" +msgstr "Corta a seczón seleccionada e coloca-a no porta-retallos" + +#: kdiff3.cpp:428 +msgid "Copies the selected section to the clipboard" +msgstr "Copia a seczón seleccionada no porta-retallos" + +#: kdiff3.cpp:430 +msgid "Pastes the clipboard contents to actual position" +msgstr "Apega o contido do porta-retallos na posizón actual" + +#: kdiff3.cpp:432 +msgid "Select everything in current window" +msgstr "" + +#: kdiff3.cpp:434 +msgid "Search for a string" +msgstr "" + +#: kdiff3.cpp:436 +msgid "Search again for the string" +msgstr "" + +#: kdiff3.cpp:438 +msgid "Enables/disables the toolbar" +msgstr "Activa/desactiva a barra de ferramentas" + +#: kdiff3.cpp:440 +msgid "Enables/disables the statusbar" +msgstr "Activa/desactiva a barra de estado" + +#: kdiff3.cpp:444 +msgid "Configure KDiff3..." +msgstr "" + +#: kdiff3.cpp:465 +msgid "Go to Current Delta" +msgstr "" + +#: kdiff3.cpp:466 +msgid "Go to First Delta" +msgstr "" + +#: kdiff3.cpp:467 +msgid "Go to Last Delta" +msgstr "" + +#: kdiff3.cpp:468 +msgid "(Skips white space differences when \"Show White Space\" is disabled.)" +msgstr "" + +#: kdiff3.cpp:469 +msgid "" +"(Does not skip white space differences even when \"Show White Space\" is " +"disabled.)" +msgstr "" + +#: kdiff3.cpp:470 +msgid "Go to Previous Delta" +msgstr "" + +#: kdiff3.cpp:472 +msgid "Go to Next Delta" +msgstr "" + +#: kdiff3.cpp:474 +msgid "Go to Previous Conflict" +msgstr "" + +#: kdiff3.cpp:476 +msgid "Go to Next Conflict" +msgstr "" + +#: kdiff3.cpp:478 +msgid "Go to Previous Unsolved Conflict" +msgstr "" + +#: kdiff3.cpp:480 +msgid "Go to Next Unsolved Conflict" +msgstr "" + +#: kdiff3.cpp:482 +msgid "Select Line(s) From A" +msgstr "" + +#: kdiff3.cpp:483 +msgid "Select Line(s) From B" +msgstr "" + +#: kdiff3.cpp:484 +msgid "Select Line(s) From C" +msgstr "" + +#: kdiff3.cpp:485 +msgid "Automatically Go to Next Unsolved Conflict After Source Selection" +msgstr "" + +#: kdiff3.cpp:487 +msgid "Show Space && Tabulator Characters for Differences" +msgstr "" + +#: kdiff3.cpp:488 +msgid "Show White Space" +msgstr "" + +#: kdiff3.cpp:490 +msgid "Show Line Numbers" +msgstr "" + +#: kdiff3.cpp:491 +msgid "Choose A Everywhere" +msgstr "" + +#: kdiff3.cpp:492 +msgid "Choose B Everywhere" +msgstr "" + +#: kdiff3.cpp:493 +msgid "Choose C Everywhere" +msgstr "" + +#: kdiff3.cpp:494 +msgid "Choose A for All Unsolved Conflicts" +msgstr "" + +#: kdiff3.cpp:495 +msgid "Choose B for All Unsolved Conflicts" +msgstr "" + +#: kdiff3.cpp:496 +msgid "Choose C for All Unsolved Conflicts" +msgstr "" + +#: kdiff3.cpp:497 +msgid "Choose A for All Unsolved Whitespace Conflicts" +msgstr "" + +#: kdiff3.cpp:498 +msgid "Choose B for All Unsolved Whitespace Conflicts" +msgstr "" + +#: kdiff3.cpp:499 +msgid "Choose C for All Unsolved Whitespace Conflicts" +msgstr "" + +#: kdiff3.cpp:500 +msgid "Automatically Solve Simple Conflicts" +msgstr "" + +#: kdiff3.cpp:501 +msgid "Set Deltas to Conflicts" +msgstr "" + +#: kdiff3.cpp:502 +msgid "Run Regular Expression Auto Merge" +msgstr "" + +#: kdiff3.cpp:503 +msgid "Automatically Solve History Conflicts" +msgstr "" + +#: kdiff3.cpp:504 +msgid "Split Diff At Selection" +msgstr "" + +#: kdiff3.cpp:505 +msgid "Join Selected Diffs" +msgstr "" + +#: kdiff3.cpp:507 +msgid "Show Window A" +msgstr "" + +#: kdiff3.cpp:508 +msgid "Show Window B" +msgstr "" + +#: kdiff3.cpp:509 +msgid "Show Window C" +msgstr "" + +#: kdiff3.cpp:510 kdiff3.cpp:521 +msgid "Focus Next Window" +msgstr "" + +#: kdiff3.cpp:512 +msgid "Normal Overview" +msgstr "" + +#: kdiff3.cpp:513 +msgid "A vs. B Overview" +msgstr "" + +#: kdiff3.cpp:514 +msgid "A vs. C Overview" +msgstr "" + +#: kdiff3.cpp:515 +msgid "B vs. C Overview" +msgstr "" + +#: kdiff3.cpp:516 +msgid "Word Wrap Diff Windows" +msgstr "" + +#: kdiff3.cpp:517 +msgid "Add Manual Diff Alignment" +msgstr "" + +#: kdiff3.cpp:518 +msgid "Clear All Manual Diff Alignments" +msgstr "" + +#: kdiff3.cpp:523 +msgid "Focus Prev Window" +msgstr "" + +#: kdiff3.cpp:524 +msgid "Toggle Split Orientation" +msgstr "" + +#: kdiff3.cpp:526 +msgid "Dir && Text Split Screen View" +msgstr "" + +#: kdiff3.cpp:528 +msgid "Toggle Between Dir && Text View" +msgstr "" + +#: kdiff3.cpp:573 pdiff.cpp:1698 +msgid "The merge result hasn't been saved." +msgstr "" + +#: kdiff3.cpp:574 +msgid "Save && Quit" +msgstr "" + +#: kdiff3.cpp:574 +msgid "Quit Without Saving" +msgstr "" + +#: kdiff3.cpp:582 pdiff.cpp:1707 +msgid "Saving the merge result failed." +msgstr "" + +#: kdiff3.cpp:593 pdiff.cpp:964 +msgid "" +"You are currently doing a directory merge. Are you sure, you want to abort?" +msgstr "" + +#: kdiff3.cpp:616 +msgid "Saving file..." +msgstr "" + +#: kdiff3.cpp:633 +msgid "Saving file with a new filename..." +msgstr "" + +#: kdiff3.cpp:722 +msgid "Printing..." +msgstr "A imprimir..." + +#: kdiff3.cpp:728 kdiff3.cpp:890 +msgid "Printing aborted." +msgstr "" + +#: kdiff3.cpp:860 +msgid "Selection" +msgstr "Seleczón" + +#: kdiff3.cpp:886 +msgid "Printing completed." +msgstr "" + +#: kdiff3.cpp:896 +msgid "Exiting..." +msgstr "A sair..." + +#: kdiff3.cpp:908 +msgid "Toggling toolbar..." +msgstr "A comutar a barra de ferramentas..." + +#: kdiff3.cpp:929 +msgid "Toggle the statusbar..." +msgstr "Comutar a barra de estado..." + +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 +msgid "Couldn't find files for comparison." +msgstr "" + +#: kdiff3_part.cpp:291 +msgid "KDiff3Part" +msgstr "" + +#: kdiff3_shell.cpp:78 +msgid "" +"Could not find our part!\n" +"This usually happens due to an installation problem. Please read the " +"README-file in the source package for details." +msgstr "" + +#: main.cpp:35 +msgid "Tool for Comparison and Merge of Files and Directories" +msgstr "" + +#: main.cpp:40 +msgid "Merge the input." +msgstr "" + +#: main.cpp:42 +msgid "Explicit base file. For compatibility with certain tools." +msgstr "" + +#: main.cpp:44 +msgid "Output file. Implies -m. E.g.: -o newfile.txt" +msgstr "" + +#: main.cpp:45 +msgid "Output file, again. (For compatibility with certain tools.)" +msgstr "" + +#: main.cpp:46 +msgid "No GUI if all conflicts are auto-solvable. (Needs -o file)" +msgstr "" + +#: main.cpp:47 +msgid "Don't solve conflicts automatically. (For compatibility...)" +msgstr "" + +#: main.cpp:48 +msgid "Visible name replacement for input file 1 (base)." +msgstr "" + +#: main.cpp:49 +msgid "Visible name replacement for input file 2." +msgstr "" + +#: main.cpp:50 +msgid "Visible name replacement for input file 3." +msgstr "" + +#: main.cpp:52 +msgid "Alternative visible name replacement. Supply this once for every input." +msgstr "" + +#: main.cpp:53 +msgid "" +"Override a config setting. Use once for every setting. E.g.: --cs " +"\"AutoAdvance=1\"" +msgstr "" + +#: main.cpp:54 +msgid "Show list of config settings and current values." +msgstr "" + +#: main.cpp:55 +msgid "Use a different config file." +msgstr "" + +#: main.cpp:59 +msgid "file1 to open (base, if not specified via --base)" +msgstr "" + +#: main.cpp:60 +msgid "file2 to open" +msgstr "" + +#: main.cpp:61 +msgid "file3 to open" +msgstr "" + +#: main.cpp:93 +msgid "Ignored. (User defined.)" +msgstr "" + +#. i18n: file kdiff3_part.rc line 16 +#: main.cpp:171 rc.cpp:9 +#, no-c-format +msgid "KDiff3" +msgstr "" + +#: main.cpp:184 +msgid "+ Many thanks to those who reported bugs and contributed ideas!" +msgstr "" + +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 +msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" +msgstr "" + +#: mergeresultwindow.cpp:283 +msgid "" +"The output has been modified.\n" +"If you continue your changes will be lost." +msgstr "" + +#: mergeresultwindow.cpp:795 pdiff.cpp:507 +msgid "All input files are binary equal." +msgstr "" + +#: mergeresultwindow.cpp:797 +msgid "All input files contain the same text." +msgstr "" + +#: mergeresultwindow.cpp:799 +msgid "" +"Files A and B are binary equal.\n" +msgstr "" + +#: mergeresultwindow.cpp:800 +msgid "" +"Files A and B have equal text. \n" +msgstr "" + +#: mergeresultwindow.cpp:801 +msgid "" +"Files A and C are binary equal.\n" +msgstr "" + +#: mergeresultwindow.cpp:802 +msgid "" +"Files A and C have equal text. \n" +msgstr "" + +#: mergeresultwindow.cpp:803 +msgid "" +"Files B and C are binary equal.\n" +msgstr "" + +#: mergeresultwindow.cpp:804 +msgid "" +"Files B and C have equal text. \n" +msgstr "" + +#: mergeresultwindow.cpp:810 +msgid "Total number of conflicts: " +msgstr "" + +#: mergeresultwindow.cpp:811 +msgid "" +"\n" +"Nr of automatically solved conflicts: " +msgstr "" + +#: mergeresultwindow.cpp:812 +msgid "" +"\n" +"Nr of unsolved conflicts: " +msgstr "" + +#: mergeresultwindow.cpp:814 +msgid "Conflicts" +msgstr "Conflitos" + +#: mergeresultwindow.cpp:1650 +msgid "" +msgstr "" + +#: mergeresultwindow.cpp:1658 +msgid "" +msgstr "" + +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 +msgid "" +msgstr "" + +#: mergeresultwindow.cpp:1730 +msgid "Output" +msgstr "Saída" + +#: mergeresultwindow.cpp:1732 +msgid "[Modified]" +msgstr "" + +#: mergeresultwindow.cpp:2656 +msgid "" +"Not all conflicts are solved yet.\n" +"File not saved.\n" +msgstr "" + +#: mergeresultwindow.cpp:2658 +msgid "Conflicts Left" +msgstr "" + +#: mergeresultwindow.cpp:2670 +msgid "" +"\n" +"\n" +"Creating backup failed. File not saved." +msgstr "" + +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 +msgid "File Save Error" +msgstr "" + +#: mergeresultwindow.cpp:2710 +msgid "Error while writing." +msgstr "" + +#: optiondialog.cpp:361 +msgid "Unicode, 8 bit" +msgstr "" + +#: optiondialog.cpp:362 +msgid "Unicode" +msgstr "Unicode" + +#: optiondialog.cpp:363 +msgid "Latin1" +msgstr "Latin1" + +#: optiondialog.cpp:382 +msgid "Change this if non-ASCII characters are not displayed correctly." +msgstr "" + +#: optiondialog.cpp:507 +msgid "Editor & Diff Output Font" +msgstr "" + +#: optiondialog.cpp:528 +msgid "Italic font for deltas" +msgstr "" + +#: optiondialog.cpp:531 +msgid "" +"Selects the italic version of the font for differences.\n" +"If the font doesn't support italic characters, then this does nothing." +msgstr "" + +#: optiondialog.cpp:539 +msgid "Color" +msgstr "Cor" + +#: optiondialog.cpp:539 +msgid "Colors Settings" +msgstr "" + +#: optiondialog.cpp:553 +msgid "Editor and Diff Views:" +msgstr "" + +#: optiondialog.cpp:561 +msgid "Foreground color:" +msgstr "Cor principal:" + +#: optiondialog.cpp:567 +msgid "Background color:" +msgstr "Cor de fondo:" + +#: optiondialog.cpp:575 +msgid "Diff background color:" +msgstr "" + +#: optiondialog.cpp:582 +msgid "Color A:" +msgstr "" + +#: optiondialog.cpp:589 +msgid "Color B:" +msgstr "" + +#: optiondialog.cpp:596 +msgid "Color C:" +msgstr "" + +#: optiondialog.cpp:602 +msgid "Conflict color:" +msgstr "" + +#: optiondialog.cpp:609 +msgid "Current range background color:" +msgstr "" + +#: optiondialog.cpp:616 +msgid "Current range diff background color:" +msgstr "" + +#: optiondialog.cpp:622 +msgid "Color for manually aligned difference ranges:" +msgstr "" + +#: optiondialog.cpp:627 +msgid "Directory Comparison View:" +msgstr "" + +#: optiondialog.cpp:633 +msgid "Newest file color:" +msgstr "" + +#: optiondialog.cpp:636 +msgid "" +"Changing this color will only be effective when starting the next directory " +"comparison." +msgstr "" + +#: optiondialog.cpp:641 +msgid "Oldest file color:" +msgstr "" + +#: optiondialog.cpp:648 +msgid "Middle age file color:" +msgstr "" + +#: optiondialog.cpp:655 +msgid "Color for missing files:" +msgstr "" + +#: optiondialog.cpp:667 +msgid "Editor" +msgstr "Editor" + +#: optiondialog.cpp:667 +msgid "Editor Behavior" +msgstr "" + +#: optiondialog.cpp:677 +msgid "Tab inserts spaces" +msgstr "" + +#: optiondialog.cpp:680 +msgid "" +"On: Pressing tab generates the appropriate number of spaces.\n" +"Off: A Tab-character will be inserted." +msgstr "" + +#: optiondialog.cpp:686 +msgid "Tab size:" +msgstr "Tamaño das tabulazóns:" + +#: optiondialog.cpp:691 +msgid "Auto indentation" +msgstr "" + +#: optiondialog.cpp:694 +msgid "" +"On: The indentation of the previous line is used for a new line.\n" +msgstr "" + +#: optiondialog.cpp:698 +msgid "Auto copy selection" +msgstr "" + +#: optiondialog.cpp:701 +msgid "" +"On: Any selection is immediately written to the clipboard.\n" +"Off: You must explicitely copy e.g. via Ctrl-C." +msgstr "" + +#: optiondialog.cpp:706 +msgid "Line end style:" +msgstr "" + +#: optiondialog.cpp:718 +msgid "" +"Sets the line endings for when an edited file is saved.\n" +"DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A" +msgstr "" + +#: optiondialog.cpp:729 +msgid "Diff and Merge" +msgstr "" + +#: optiondialog.cpp:729 +msgid "Diff and Merge Settings" +msgstr "" + +#: optiondialog.cpp:740 +msgid "Preserve carriage return" +msgstr "" + +#: optiondialog.cpp:743 +msgid "" +"Show carriage return characters '\\r' if they exist.\n" +"Helps to compare files that were modified under different operating systems." +msgstr "" + +#: optiondialog.cpp:748 +msgid "Ignore numbers" +msgstr "" + +#: optiondialog.cpp:751 +msgid "" +"Ignore number characters during line matching phase. (Similar to Ignore white " +"space.)\n" +"Might help to compare files with numeric data." +msgstr "" + +#: optiondialog.cpp:756 +msgid "Ignore C/C++ comments" +msgstr "" + +#: optiondialog.cpp:758 +msgid "Treat C/C++ comments like white space." +msgstr "" + +#: optiondialog.cpp:762 +msgid "Ignore case" +msgstr "" + +#: optiondialog.cpp:765 +msgid "Treat case differences like white space changes. ('a'<=>'A')" +msgstr "" + +#: optiondialog.cpp:769 +msgid "Preprocessor command:" +msgstr "" + +#: optiondialog.cpp:773 +msgid "User defined pre-processing. (See the docs for details.)" +msgstr "" + +#: optiondialog.cpp:776 +msgid "Line-matching preprocessor command:" +msgstr "" + +#: optiondialog.cpp:780 +msgid "" +"This pre-processor is only used during line matching.\n" +"(See the docs for details.)" +msgstr "" + +#: optiondialog.cpp:783 +msgid "Try hard (slower)" +msgstr "" + +#: optiondialog.cpp:786 +msgid "" +"Enables the --minimal option for the external diff.\n" +"The analysis of big files will be much slower." +msgstr "" + +#: optiondialog.cpp:791 +msgid "Auto advance delay (ms):" +msgstr "" + +#: optiondialog.cpp:796 +msgid "" +"When in Auto-Advance mode the result of the current selection is shown \n" +"for the specified time, before jumping to the next conflict. Range: 0-2000 ms" +msgstr "" + +#: optiondialog.cpp:801 +msgid "White space 2-file merge default:" +msgstr "" + +#: optiondialog.cpp:805 optiondialog.cpp:818 +msgid "Manual Choice" +msgstr "" + +#: optiondialog.cpp:809 optiondialog.cpp:823 +msgid "" +"Allow the merge algorithm to automatically select an input for white-space-only " +"changes." +msgstr "" + +#: optiondialog.cpp:814 +msgid "White space 3-file merge default:" +msgstr "" + +#: optiondialog.cpp:828 +msgid "Automatic Merge Regular Expression" +msgstr "" + +#: optiondialog.cpp:837 smalldialogs.cpp:379 +msgid "Auto merge regular expression:" +msgstr "" + +#: optiondialog.cpp:841 +msgid "" +"Regular expression for lines where KDiff3 should automatically choose one " +"source.\n" +"When a line with a conflict matches the regular expression then\n" +"- if available - C, otherwise B will be chosen." +msgstr "" + +#: optiondialog.cpp:847 +msgid "Run regular expression auto merge on merge start" +msgstr "" + +#: optiondialog.cpp:849 +msgid "" +"Run the merge for auto merge regular expressions\n" +"immediately when a merge starts.\n" +msgstr "" + +#: optiondialog.cpp:854 +msgid "Version Control History Merging" +msgstr "" + +#: optiondialog.cpp:863 smalldialogs.cpp:406 +msgid "History start regular expression:" +msgstr "" + +#: optiondialog.cpp:867 +msgid "" +"Regular expression for the start of the version control history entry.\n" +"Usually this line contains the \"$Log$\"-keyword.\n" +"Default value: \".*\\$Log.*\\$.*\"" +msgstr "" + +#: optiondialog.cpp:873 smalldialogs.cpp:435 +msgid "History entry start regular expression:" +msgstr "" + +#: optiondialog.cpp:885 +msgid "" +"A version control history entry consists of several lines.\n" +"Specify the regular expression to detect the first line (without the leading " +"comment).\n" +"Use parentheses to group the keys you want to use for sorting.\n" +"If left empty, then KDiff3 assumes that empty lines separate history entries.\n" +"See the documentation for details." +msgstr "" + +#: optiondialog.cpp:893 +msgid "History merge sorting" +msgstr "" + +#: optiondialog.cpp:895 +msgid "Sort version control history by a key." +msgstr "" + +#: optiondialog.cpp:905 +msgid "History entry start sort key order:" +msgstr "" + +#: optiondialog.cpp:909 +msgid "" +"Each parentheses used in the regular expression for the history start entry\n" +"groups a key that can be used for sorting.\n" +"Specify the list of keys (that are numbered in order of occurrence\n" +"starting with 1) using ',' as separator (e.g. \"4,5,6,1,2,3,7\").\n" +"If left empty, then no sorting will be done.\n" +"See the documentation for details." +msgstr "" + +#: optiondialog.cpp:920 +msgid "Merge version control history on merge start" +msgstr "" + +#: optiondialog.cpp:922 +msgid "Run version control history automerge on merge start." +msgstr "" + +#: optiondialog.cpp:926 +msgid "Test your regular expressions" +msgstr "" + +#: optiondialog.cpp:931 +msgid "Irrelevant merge command:" +msgstr "" + +#: optiondialog.cpp:935 +msgid "" +"If specified this script is run after automerge\n" +"when no other relevant changes were detected.\n" +"Called with the parameters: filename1 filename2 filename3" +msgstr "" + +#: optiondialog.cpp:945 +msgid "Directory Merge" +msgstr "" + +#: optiondialog.cpp:954 +msgid "Recursive directories" +msgstr "" + +#: optiondialog.cpp:956 +msgid "Whether to analyze subdirectories or not." +msgstr "" + +#: optiondialog.cpp:958 +msgid "File pattern(s):" +msgstr "" + +#: optiondialog.cpp:963 +msgid "" +"Pattern(s) of files to be analyzed. \n" +"Wildcards: '*' and '?'\n" +"Several Patterns can be specified by using the separator: ';'" +msgstr "" + +#: optiondialog.cpp:969 +msgid "File-anti-pattern(s):" +msgstr "" + +#: optiondialog.cpp:974 +msgid "" +"Pattern(s) of files to be excluded from analysis. \n" +"Wildcards: '*' and '?'\n" +"Several Patterns can be specified by using the separator: ';'" +msgstr "" + +#: optiondialog.cpp:980 +msgid "Dir-anti-pattern(s):" +msgstr "" + +#: optiondialog.cpp:985 +msgid "" +"Pattern(s) of directories to be excluded from analysis. \n" +"Wildcards: '*' and '?'\n" +"Several Patterns can be specified by using the separator: ';'" +msgstr "" + +#: optiondialog.cpp:991 +msgid "Use .cvsignore" +msgstr "" + +#: optiondialog.cpp:994 +msgid "" +"Extends the antipattern to anything that would be ignored by CVS.\n" +"Via local \".cvsignore\"-files this can be directory specific." +msgstr "" + +#: optiondialog.cpp:999 +msgid "Find hidden files and directories" +msgstr "" + +#: optiondialog.cpp:1002 +msgid "Finds files and directories with the hidden attribute." +msgstr "" + +#: optiondialog.cpp:1004 +msgid "Finds files and directories starting with '.'." +msgstr "" + +#: optiondialog.cpp:1008 +msgid "Follow file links" +msgstr "" + +#: optiondialog.cpp:1011 +msgid "" +"On: Compare the file the link points to.\n" +"Off: Compare the links." +msgstr "" + +#: optiondialog.cpp:1016 +msgid "Follow directory links" +msgstr "" + +#: optiondialog.cpp:1019 +msgid "" +"On: Compare the directory the link points to.\n" +"Off: Compare the links." +msgstr "" + +#: optiondialog.cpp:1035 +msgid "Case sensitive filename comparison" +msgstr "" + +#: optiondialog.cpp:1038 +msgid "" +"The directory comparison will compare files or directories when their names " +"match.\n" +"Set this option if the case of the names must match. (Default for Windows is " +"off, otherwise on.)" +msgstr "" + +#: optiondialog.cpp:1042 +msgid "File Comparison Mode" +msgstr "" + +#: optiondialog.cpp:1046 +msgid "Binary comparison" +msgstr "" + +#: optiondialog.cpp:1047 +msgid "Binary comparison of each file. (Default)" +msgstr "" + +#: optiondialog.cpp:1049 +msgid "Full analysis" +msgstr "" + +#: optiondialog.cpp:1050 +msgid "" +"Do a full analysis and show statistics information in extra columns.\n" +"(Slower than a binary comparison, much slower for binary files.)" +msgstr "" + +#: optiondialog.cpp:1053 +msgid "Trust the modification date (unsafe)" +msgstr "" + +#: optiondialog.cpp:1054 +msgid "" +"Assume that files are equal if the modification date and file length are " +"equal.\n" +"Useful for big directories or slow networks." +msgstr "" + +#: optiondialog.cpp:1057 +msgid "Trust the size (unsafe)" +msgstr "" + +#: optiondialog.cpp:1058 +msgid "" +"Assume that files are equal if their file lengths are equal.\n" +"Useful for big directories or slow networks when the date is modified during " +"download." +msgstr "" + +#: optiondialog.cpp:1062 +msgid "Synchronize directories" +msgstr "" + +#: optiondialog.cpp:1065 +msgid "" +"Offers to store files in both directories so that\n" +"both directories are the same afterwards.\n" +"Works only when comparing two directories without specifying a destination." +msgstr "" + +#: optiondialog.cpp:1071 +msgid "White space differences considered equal" +msgstr "" + +#: optiondialog.cpp:1074 +msgid "" +"If files differ only by white space consider them equal.\n" +"This is only active when full analysis is chosen." +msgstr "" + +#: optiondialog.cpp:1080 +msgid "Copy newer instead of merging (unsafe)" +msgstr "" + +#: optiondialog.cpp:1083 +msgid "" +"Don't look inside, just take the newer file.\n" +"(Use this only if you know what you are doing!)\n" +"Only effective when comparing two directories." +msgstr "" + +#: optiondialog.cpp:1088 +msgid "Backup files (.orig)" +msgstr "" + +#: optiondialog.cpp:1091 +msgid "" +"When a file would be saved over an old file, then the old file\n" +"will be renamed with a '.orig'-extension instead of being deleted." +msgstr "" + +#: optiondialog.cpp:1118 +msgid "Regional Settings" +msgstr "" + +#: optiondialog.cpp:1214 +msgid "Language (restart required)" +msgstr "" + +#: optiondialog.cpp:1246 +msgid "" +"Choose the language of the GUI-strings or \"Auto\".\n" +"For a change of language to take place, quit and restart KDiff3." +msgstr "" + +#: optiondialog.cpp:1264 +msgid "Use the same encoding for everything:" +msgstr "" + +#: optiondialog.cpp:1267 +msgid "" +"Enable this allows to change all encodings by changing the first only.\n" +"Disable this if different individual settings are needed." +msgstr "" + +#: optiondialog.cpp:1272 +msgid "Note: Local Encoding is " +msgstr "" + +#: optiondialog.cpp:1276 +msgid "File Encoding for A:" +msgstr "" + +#: optiondialog.cpp:1281 +msgid "File Encoding for B:" +msgstr "" + +#: optiondialog.cpp:1286 +msgid "File Encoding for C:" +msgstr "" + +#: optiondialog.cpp:1291 +msgid "File Encoding for Merge Output and Saving:" +msgstr "" + +#: optiondialog.cpp:1296 +msgid "File Encoding for Preprocessor Files:" +msgstr "" + +#: optiondialog.cpp:1305 +msgid "Right To Left Language" +msgstr "" + +#: optiondialog.cpp:1308 +msgid "" +"Some languages are read from right to left.\n" +"This setting will change the viewer and editor accordingly." +msgstr "" + +#: optiondialog.cpp:1318 +msgid "Integration" +msgstr "" + +#: optiondialog.cpp:1318 +msgid "Integration Settings" +msgstr "" + +#: optiondialog.cpp:1328 +msgid "Command line options to ignore:" +msgstr "" + +#: optiondialog.cpp:1333 +msgid "" +"List of command line options that should be ignored when KDiff3 is used by " +"other tools.\n" +"Several values can be specified if separated via ';'\n" +"This will suppress the \"Unknown option\"-error." +msgstr "" + +#: optiondialog.cpp:1386 +msgid "" +"You selected a variable width font.\n" +"\n" +"Because this program doesn't handle variable width fonts\n" +"correctly, you might experience problems while editing.\n" +"\n" +"Do you want to continue or do you want to select another font." +msgstr "" + +#: optiondialog.cpp:1390 +msgid "Incompatible Font" +msgstr "" + +#: optiondialog.cpp:1391 +msgid "Continue at Own Risk" +msgstr "" + +#: optiondialog.cpp:1391 +msgid "Select Another Font" +msgstr "" + +#: optiondialog.cpp:1416 +msgid "This resets all options. Not only those of the current topic." +msgstr "" + +#: pdiff.cpp:258 +msgid "PreprocessorCmd: " +msgstr "" + +#: pdiff.cpp:263 +msgid "" +"The following option(s) you selected might change data:\n" +msgstr "" + +#: pdiff.cpp:264 +msgid "" +"\n" +"Most likely this is not wanted during a merge.\n" +"Do you want to disable these settings or continue with these settings active?" +msgstr "" + +#: pdiff.cpp:266 +msgid "Option Unsafe for Merging" +msgstr "" + +#: pdiff.cpp:267 +msgid "Use These Options During Merge" +msgstr "" + +#: pdiff.cpp:267 +msgid "Disable Unsafe Options" +msgstr "" + +#: pdiff.cpp:297 +msgid "Loading A" +msgstr "" + +#: pdiff.cpp:301 +msgid "Loading B" +msgstr "" + +#: pdiff.cpp:318 pdiff.cpp:344 +msgid "Diff: A <-> B" +msgstr "" + +#: pdiff.cpp:324 pdiff.cpp:366 +msgid "Linediff: A <-> B" +msgstr "" + +#: pdiff.cpp:335 +msgid "Loading C" +msgstr "" + +#: pdiff.cpp:347 +msgid "Diff: B <-> C" +msgstr "" + +#: pdiff.cpp:350 +msgid "Diff: A <-> C" +msgstr "" + +#: pdiff.cpp:369 +msgid "Linediff: B <-> C" +msgstr "" + +#: pdiff.cpp:372 +msgid "Linediff: A <-> C" +msgstr "" + +#: pdiff.cpp:509 +msgid "All input files contain the same text, but are not binary equal." +msgstr "" + +#: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 +msgid "" +"Files %1 and %2 are binary equal.\n" +msgstr "" + +#: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 +msgid "" +"Files %1 and %2 have equal text, but are not binary equal. \n" +msgstr "" + +#: pdiff.cpp:526 +msgid "" +"Some inputfiles don't seem to be pure textfiles.\n" +"Note that the KDiff3-merge was not meant for binary data.\n" +"Continue at your own risk." +msgstr "" + +#: pdiff.cpp:965 +msgid "Abort" +msgstr "Interromper" + +#: pdiff.cpp:971 pdiff.cpp:1059 +msgid "Opening files..." +msgstr "" + +#: pdiff.cpp:1036 pdiff.cpp:1107 +msgid "File open error" +msgstr "" + +#: pdiff.cpp:1139 +msgid "Cutting selection..." +msgstr "" + +#: pdiff.cpp:1160 +msgid "Copying selection to clipboard..." +msgstr "" + +#: pdiff.cpp:1176 +msgid "Inserting clipboard contents..." +msgstr "" + +#: pdiff.cpp:1699 +msgid "Save && Continue" +msgstr "" + +#: pdiff.cpp:1699 +msgid "Continue Without Saving" +msgstr "" + +#: pdiff.cpp:1906 +msgid "Search complete." +msgstr "" + +#: pdiff.cpp:1906 +msgid "Search Complete" +msgstr "" + +#: pdiff.cpp:2130 +msgid "Nothing is selected in either diff input window." +msgstr "" + +#: pdiff.cpp:2130 +msgid "Error while adding manual diff range" +msgstr "" + +#. i18n: file kdiff3_part.rc line 4 +#: rc.cpp:3 +#, no-c-format +msgid "&KDiff3" +msgstr "" + +#. i18n: file kdiff3_part.rc line 13 +#: rc.cpp:6 +#, no-c-format +msgid "Configure KDiff3" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 7 +#: rc.cpp:15 +#, no-c-format +msgid "&Directory" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 30 +#: rc.cpp:18 +#, no-c-format +msgid "Current Item Merge Operation" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 38 +#: rc.cpp:21 +#, no-c-format +msgid "Current Item Sync Operation" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 50 +#: rc.cpp:24 +#, no-c-format +msgid "&Movement" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 61 +#: rc.cpp:27 +#, no-c-format +msgid "D&iffview" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 73 +#: rc.cpp:30 +#, no-c-format +msgid "&Merge" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 95 +#: rc.cpp:33 +#, no-c-format +msgid "&Window" +msgstr "&Fiestra" + +#: smalldialogs.cpp:53 +msgid "A (Base):" +msgstr "" + +#: smalldialogs.cpp:59 smalldialogs.cpp:75 smalldialogs.cpp:91 +#: smalldialogs.cpp:134 +msgid "File..." +msgstr "" + +#: smalldialogs.cpp:61 smalldialogs.cpp:77 smalldialogs.cpp:93 +#: smalldialogs.cpp:136 +msgid "Dir..." +msgstr "" + +#: smalldialogs.cpp:86 +msgid "C (Optional):" +msgstr "" + +#: smalldialogs.cpp:108 +msgid "Swap/Copy Names ..." +msgstr "" + +#: smalldialogs.cpp:114 smalldialogs.cpp:115 smalldialogs.cpp:116 +msgid "Swap %1<->%2" +msgstr "" + +#: smalldialogs.cpp:117 smalldialogs.cpp:118 smalldialogs.cpp:119 +msgid "Copy %1->Output" +msgstr "" + +#: smalldialogs.cpp:120 smalldialogs.cpp:121 smalldialogs.cpp:122 +msgid "Swap %1<->Output" +msgstr "" + +#: smalldialogs.cpp:129 +msgid "Output (optional):" +msgstr "" + +#: smalldialogs.cpp:158 +msgid "Configure..." +msgstr "Configurar..." + +#: smalldialogs.cpp:329 +msgid "Search text:" +msgstr "" + +#: smalldialogs.cpp:336 +msgid "Case sensitive" +msgstr "" + +#: smalldialogs.cpp:339 +msgid "Search A" +msgstr "" + +#: smalldialogs.cpp:344 +msgid "Search B" +msgstr "" + +#: smalldialogs.cpp:349 +msgid "Search C" +msgstr "" + +#: smalldialogs.cpp:354 +msgid "Search output" +msgstr "" + +#: smalldialogs.cpp:359 +msgid "&Search" +msgstr "&Procurar" + +#: smalldialogs.cpp:376 +msgid "Regular Expression Tester" +msgstr "" + +#: smalldialogs.cpp:387 +msgid "Example auto merge line:" +msgstr "" + +#: smalldialogs.cpp:389 +msgid "For auto merge test copy a line as used in your files." +msgstr "" + +#: smalldialogs.cpp:395 smalldialogs.cpp:424 smalldialogs.cpp:461 +msgid "Match result:" +msgstr "" + +#: smalldialogs.cpp:414 +msgid "Example history start line (with leading comment):" +msgstr "" + +#: smalldialogs.cpp:417 +msgid "" +"Copy a history start line as used in your files,\n" +"including the leading comment." +msgstr "" + +#: smalldialogs.cpp:443 +msgid "History sort key order:" +msgstr "" + +#: smalldialogs.cpp:451 +msgid "Example history entry start line (without leading comment):" +msgstr "" + +#: smalldialogs.cpp:453 +msgid "" +"Copy a history entry start line as used in your files,\n" +"but omit the leading comment." +msgstr "" + +#: smalldialogs.cpp:468 +msgid "Sort key result:" +msgstr "" + +#: smalldialogs.cpp:519 smalldialogs.cpp:529 smalldialogs.cpp:550 +msgid "Match success." +msgstr "" + +#: smalldialogs.cpp:523 smalldialogs.cpp:533 smalldialogs.cpp:556 +msgid "Match failed." +msgstr "" + +#: smalldialogs.cpp:541 +msgid "Opening and closing parentheses don't match in regular expression." +msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/hi.po --- a/kdiff3/po/hi.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/hi.po Sat Nov 04 00:05:00 2006 +0000 @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-01-22 16:10+0530\n" "Last-Translator: Ravishankar Shrivastava \n" "Language-Team: indlinux-hindi \n" @@ -51,13 +51,13 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "गंभीर आंतरिक तà¥à¤°à¥à¤Ÿà¤¿" @@ -240,7 +240,7 @@ msgid "Changing All Merge Operations" msgstr "सभी समà¥à¤®à¤¿à¤²à¤¿à¤¤ करने के ऑपरेशन को बदला जा रहा है" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "जारी रखें (&o)" @@ -607,16 +607,6 @@ msgid "Unfold All Subdirs" msgstr "सभी सबडिरेकà¥à¤Ÿà¥à¤°à¥€à¤œ अनफ़ोलà¥à¤¡ करें" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ समà¥à¤®à¤¿à¤²à¤¿à¤¤ करें" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ समà¥à¤®à¤¿à¤²à¤¿à¤¤ करें" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "सभी वसà¥à¤¤à¥à¤“ं के लिठअ का चयन करें" @@ -692,65 +682,65 @@ msgid "Merge to A && B" msgstr "अ तथा ब में समà¥à¤®à¤¿à¤²à¤¿à¤¤ करें" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "फ़ाइल सà¥à¤¥à¤¿à¤¤à¤¿ पà¥à¤°à¤¾à¤ªà¥à¤¤ की जा रही है: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "फ़ाइल पढ़ा जा रहा है: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "फ़ाइल: %1 लिखा जा रहा है" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "मेमोरी कम पड़ गई" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ बनाया जा रहा है: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ मिटाया जा रहा है: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "फ़ाइल मिटाया जा रहा है: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "सिंबालिक कड़ी बनाई जा रही है: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "फ़ाइलनाम बदला जा रहा है: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "फ़ाइल नक़ल की जा रही है: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -758,7 +748,7 @@ "फ़ाइल की नक़ल करने की कà¥à¤°à¤¿à¤¯à¤¾ के दौरान तà¥à¤°à¥à¤Ÿà¤¿: फ़ाइल को पढ़ने के लिठखोलने में " "असफल. फ़ाइल-नाम: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -766,23 +756,23 @@ "फ़ाइल की नक़ल करने की कà¥à¤°à¤¿à¤¯à¤¾ के दौरान तà¥à¤°à¥à¤Ÿà¤¿: फ़ाइल को लिखने के लिठखोलने में " "असफल. फ़ाइल-नाम: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "फ़ाइल की नक़ल करने की कà¥à¤°à¤¿à¤¯à¤¾ के दौरान तà¥à¤°à¥à¤Ÿà¤¿: पढ़ने में असफल. फ़ाइल-नाम: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "फ़ाइल की नक़ल करने की कà¥à¤°à¤¿à¤¯à¤¾ के दौरान तà¥à¤°à¥à¤Ÿà¤¿: लिखने में असफल. फ़ाइल-नाम: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ को पढ़ा जा रहा है:" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ सूचीबदà¥à¤§ की जा रही है: %1" @@ -1129,11 +1119,11 @@ msgid "Toggle the statusbar..." msgstr "सà¥à¤¥à¤¿à¤¤à¤¿ पटà¥à¤Ÿà¥€ टॉगल करें..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "तà¥à¤²à¤¨à¤¾ के लिठफ़ाइलों को नहीं ढूंढ सका" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "के-डिफ3पारà¥à¤Ÿ" @@ -1229,14 +1219,14 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 #, fuzzy msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "बचे हà¥à¤ समाधान-रहित विरोधाभासों की संखà¥à¤¯à¤¾: %1" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1244,55 +1234,55 @@ "आउटपà¥à¤Ÿ परिवरà¥à¤§à¤¿à¤¤ किया जा चà¥à¤•ा है.\n" "यदि आप जारी रखते हैं तो आपके परिवरà¥à¤¤à¤¨ खो जाà¤à¤à¤—े." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "सभी इनपà¥à¤Ÿ फ़ाइलें बाइनरी समान हैं." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "सभी इनपà¥à¤Ÿ फ़ाइलें à¤à¤• ही पाठ रखे हैं." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "फ़ाइलें अ तथा ब बाइनरी समान हैं.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "फ़ाइलें अ तथा ब में पाठ समान हैं.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "फ़ाइलें अ तथा स बाइनरी समान हैं.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "फ़ाइलें अ तथा स में पाठ समान हैं.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "फ़ाइलें ब तथा स बाइनरी समान हैं.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "फ़ाइलें ब तथा स में पाठ समान हैं.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "परसà¥à¤ªà¤° विरोधों की कà¥à¤² संखà¥à¤¯à¤¾:" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1300,7 +1290,7 @@ "\n" "सà¥à¤µà¤šà¤¾à¤²à¤¿à¤¤ समाधान किठविरोधाभासों की संखà¥à¤¯à¤¾: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1308,32 +1298,32 @@ "\n" "समाधान-रहित विरोधाभासों की संखà¥à¤¯à¤¾: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "परसà¥à¤ªà¤° विरोध" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "<कोई सà¥à¤°à¥‹à¤¤ पंकà¥à¤¤à¤¿ नहीं>" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 #, fuzzy msgid "" msgstr "<विरोधाभास समà¥à¤®à¤¿à¤²à¤¿à¤¤ करें>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<विरोधाभास समà¥à¤®à¤¿à¤²à¤¿à¤¤ करें>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "आउटपà¥à¤Ÿ" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[परिवरà¥à¤§à¤¿à¤¤]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1341,22 +1331,22 @@ "अब तक सभी विरोधाभासों का समाधान नहीं किया गया है.\n" "फ़ाइल सहेजा नहीं गया.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "विरोधाभास बायाठ" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "फ़ाइल सहेजने में तà¥à¤°à¥à¤Ÿà¤¿" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "लिखने के दौरान तà¥à¤°à¥à¤Ÿà¤¿." @@ -1914,76 +1904,76 @@ msgid "Regional Settings" msgstr "कà¥à¤·à¥‡à¤¤à¥à¤°à¥€à¤¯ विनà¥à¤¯à¤¾à¤¸" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "भाषा (फिर से पà¥à¤°à¤¾à¤°à¤‚भ करना आवशà¥à¤¯à¤• है)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 #, fuzzy msgid "Note: Local Encoding is " msgstr "सà¥à¤¥à¤¾à¤¨à¥€à¤¯ à¤à¤¨à¤•ोडिंग इसà¥à¤¤à¥‡à¤®à¤¾à¤² करें" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "ऑपरेशन" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "कà¥à¤·à¥‡à¤¤à¥à¤°à¥€à¤¯ विनà¥à¤¯à¤¾à¤¸" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -1991,7 +1981,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2001,19 +1991,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "फ़ॉनà¥à¤Ÿ असंगत है" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "अपने सà¥à¤µà¤¯à¤‚ के जोखिम पर जारी रखें" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "अनà¥à¤¯ फ़ॉनà¥à¤Ÿ चà¥à¤¨à¥‡à¤‚" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "यह सभी विकलà¥à¤ªà¥‹à¤‚ को रीसेट करता है. सिरà¥à¤« उनको ही नहीं जो मौजूदा विषय में हैं. " @@ -2149,11 +2139,11 @@ msgid "Search Complete" msgstr "ढूंढना समà¥à¤ªà¤¨à¥à¤¨" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ बनाने के दौरान तà¥à¤°à¥à¤Ÿà¤¿." @@ -2340,6 +2330,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ समà¥à¤®à¤¿à¤²à¤¿à¤¤ करें" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€ समà¥à¤®à¤¿à¤²à¤¿à¤¤ करें" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "डिरेकà¥à¤Ÿà¥à¤°à¥€à¤œà¤¼ सिंकà¥à¤°à¥‹à¤¨à¤¾à¤‡à¤œà¤¼ करें" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/hu.po --- a/kdiff3/po/hu.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/hu.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: KDE 3.2\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2004-01-09 11:11+0100\n" "Last-Translator: Tamas Szanto \n" "Language-Team: Hungarian \n" @@ -51,7 +51,7 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -59,7 +59,7 @@ "Adatvesztési hiba:\n" "ha a jelenség többször is elÅ‘fordul, kérjük jelentse be a hibát.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Súlyos belsÅ‘ hiba történt" @@ -249,7 +249,7 @@ msgid "Changing All Merge Operations" msgstr "Az összes összeolvasztási művelet megváltoztatása" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "F&olytatás" @@ -651,16 +651,6 @@ msgid "Unfold All Subdirs" msgstr "Az alkönyvtárak kibontása" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Könyvtárösszeolvasztás" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Könyvtárösszeolvasztás" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Az 'A' kiválasztása az összes elemhez" @@ -738,7 +728,7 @@ msgid "Merge to A && B" msgstr "Beolvasztás A és B-be" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -747,7 +737,7 @@ "törölni. \n" "Fájlnév: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -755,53 +745,53 @@ "Biztonsági mentés készítése közben egy átnevezés nem sikerült. \n" "A fájlok nevei: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "A fájlállapot lekérdezése: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Fájl beolvasása: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Fájl írása: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Elfogyott a memória" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Könyvtár létrehozása: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Könyvtár törlése: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Fájl törlése: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Szimbolikus link létrehozása: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Fájl átnevezése: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Fájl másolása: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -809,7 +799,7 @@ "Hiba történt fájlmásolás közben: nem sikerült olvasásra megnyitni egy fájlt. A " "fájl neve: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -817,25 +807,25 @@ "Hiba történt fájlmásolás közben: nem sikerült írásra megnyitni egy fájlt. A " "fájl neve: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Hiba történt fájlmásolás közben: egy olvasási művelet nem sikerült. A fájl " "neve: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Hiba történt fájlmásolás közben: egy írási művelet nem sikerült. A fájl neve: " "%1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Könyvtár beolvasása: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Könyvtár kilistázása: %1" @@ -1193,11 +1183,11 @@ msgid "Toggle the statusbar..." msgstr "Az állapotsor átkapcsolása..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Nem található összehasonlítható fájlpár." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1310,16 +1300,16 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 #, fuzzy msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "\n" "A fel nem oldott ütközések száma: " -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1327,55 +1317,55 @@ "A kimenet megváltozott.\n" "Ha továbblép, a módosítások elvesznek." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Az összes bemeneti fájl megegyezik (bináris módban)." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Az összes bemeneti fájl megegyezik (szöveges módban)." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "A és B fájl binárisan megegyezik.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "A és B szövege megegyezik.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "A és C fájl binárisan megegyezik.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "A és C szövege megegyezik. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "B és C binárisan megegyezik.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "B és C szövege megegyezik.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Az ütközések száma: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1383,7 +1373,7 @@ "\n" "Az automatikusan feloldott ütközések száma: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1391,32 +1381,32 @@ "\n" "A fel nem oldott ütközések száma: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Ütközések" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 #, fuzzy msgid "" msgstr "<Összeolvasztási ütközés>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<Összeolvasztási ütközés>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Módosítva]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1424,22 +1414,22 @@ "Még nincs feloldva az összes ütközés.\n" "A fájl nem lesz elmentve.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Megmaradt ütközések" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Fájlmentési hiba" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Hiba történt írás közben." @@ -2065,75 +2055,75 @@ msgid "Regional Settings" msgstr "" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 #, fuzzy msgid "Note: Local Encoding is " msgstr "A helyi kódolás használata" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Művelet" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2141,7 +2131,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2157,19 +2147,19 @@ "\n" "Tovább szeretne lépni vagy inkább más betűtípust választ?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Nem kompatibilis betűtípus" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Folytatás (kockázatos)" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Válasszon egy másik betűtípust" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "Ezzel alapállapotba hozható az összes beállítás (nem csak az aktuális témáé)." @@ -2308,11 +2298,11 @@ msgid "Search Complete" msgstr "A keresés befejezÅ‘dött" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Hiba történt egy könyvtár létrehozása közben." @@ -2500,6 +2490,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Könyvtárösszeolvasztás" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Könyvtárösszeolvasztás" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "A könyvtárak szinkronizálása" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/it.po --- a/kdiff3/po/it.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/it.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,34 +1,37 @@ # translation of kdiff3.po to Italian -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# # Andrea Celli , 2003, 2004, 2005. -# +# Marcello Anni , 2006. +# Giovanni Venturi , 2006. msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" -"PO-Revision-Date: 2005-02-11 22:15+0100\n" -"Last-Translator: Andrea Celli \n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-07-09 23:07+0200\n" +"Last-Translator: Giovanni Venturi \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.3.1\n" +"X-Generator: KBabel 1.11.2\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: _translatorinfo.cpp:1 msgid "" "_: NAME OF TRANSLATORS\n" "Your names" -msgstr "Andrea Celli" +msgstr "Andrea Celli,Marcello Anni" #: _translatorinfo.cpp:3 msgid "" "_: EMAIL OF TRANSLATORS\n" "Your emails" -msgstr "a.celli@caltanet.it" +msgstr "a.celli@caltanet.it,marcello.anni@alice.it" #: diff.cpp:245 msgid "Writing clipboard data to temp file failed." -msgstr "Non è riuscita la copia da appunti a file temporaneo." +msgstr "È fallita la copia da appunti a file temporaneo." #: diff.cpp:249 msgid "From Clipboard" @@ -62,7 +65,7 @@ "\n" "Ora il comando di pre-ricerca di righe simili verrà disabilitato." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -70,14 +73,13 @@ "Errore: perdita dati\n" "Se è riproducibile, ti prego di segnalarlo all'autore.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Grave errore interno" #: difftextwindow.cpp:1637 kdiff3.cpp:743 -#, fuzzy msgid "Top line" -msgstr "Da riga %1" +msgstr "Riga superiore" #: difftextwindow.cpp:1647 msgid "End" @@ -89,15 +91,15 @@ #: directorymergewindow.cpp:149 msgid "Link: " -msgstr " Collegamento:" +msgstr "Collegamento: " #: directorymergewindow.cpp:157 msgid "Size. " -msgstr " Dimensione. " +msgstr "Dimensione. " #: directorymergewindow.cpp:170 msgid "Date & Size: " -msgstr "Data e dimensione " +msgstr "Data e dimensione: " #: directorymergewindow.cpp:179 directorymergewindow.cpp:185 msgid "Creating temp copy of %1 failed." @@ -154,11 +156,11 @@ #: directorymergewindow.cpp:320 directorymergewindow.cpp:2864 msgid "Rescan" -msgstr "Riesaminare" +msgstr "Riesamina" #: directorymergewindow.cpp:320 kdiff3.cpp:594 pdiff.cpp:965 msgid "Continue Merging" -msgstr "Continuare la fusione" +msgstr "Continua la fusione" #: directorymergewindow.cpp:462 msgid "Opening of directories failed:" @@ -184,7 +186,7 @@ #: directorymergewindow.cpp:473 msgid "Directory Open Error" -msgstr "Errore nell'aprire la cartella" +msgstr "Errore apertura cartella" #: directorymergewindow.cpp:481 msgid "" @@ -202,7 +204,7 @@ #: directorymergewindow.cpp:488 msgid "Scanning directories..." -msgstr "Esame directory in corso..." +msgstr "Esame cartelle in corso..." #: directorymergewindow.cpp:537 msgid "Reading Directory A" @@ -232,7 +234,7 @@ #: directorymergewindow.cpp:660 msgid "Directory Comparison Status" -msgstr "Situazione del confronto di cartelle" +msgstr "Stato di confronto di cartelle" #: directorymergewindow.cpp:661 msgid "Number of subdirectories:" @@ -256,9 +258,9 @@ #: directorymergewindow.cpp:803 msgid "Changing All Merge Operations" -msgstr "Modifica di tutte le operazioni di fusione" - -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +msgstr "Modifica tutte le operazioni di fusione" + +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "C&ontinua" @@ -313,7 +315,7 @@ #: directorymergewindow.cpp:1764 directorymergewindow.cpp:1765 msgid "Merge (manual)" -msgstr "Unisci(manualmente)" +msgstr "Fondi (manuale)" #: directorymergewindow.cpp:1766 msgid "Error: Conflicting File Types" @@ -331,7 +333,7 @@ #: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 #: directorymergewindow.cpp:1845 directorymergewindow.cpp:2102 msgid "Operation Not Possible" -msgstr "Operazione non effettuabile" +msgstr "Operazione non possibile" #: directorymergewindow.cpp:1884 msgid "" @@ -376,7 +378,7 @@ #: directorymergewindow.cpp:1964 msgid "Unknown merge operation. (This must never happen!)" -msgstr "Operazione di fusione sconosciuta. (Non deve mai succedere!) " +msgstr "Operazione di fusione sconosciuta. (Non deve mai succedere!)" #: directorymergewindow.cpp:1996 msgid "Unknown merge operation." @@ -399,12 +401,12 @@ "\n" "Scegli \"Simulazione\" per vedere cosa succederebbe.\n" "\n" -"Stai attento che questo programma è ancora una \"beta\" e non c'è NESSUNA " -"GARANZIA che funzioni! Fai una copia di riserva dei dati importanti!" +"Stai attento perché questo programma è ancora una \"beta\" e non c'è NESSUNA " +"GARANZIA che funzioni! Fai una copia di riserva dei tuoi dati importanti!" #: directorymergewindow.cpp:2016 msgid "Starting Merge" -msgstr "Inizio della fusione" +msgstr "Inizio fusione" #: directorymergewindow.cpp:2016 msgid "Do It" @@ -436,7 +438,7 @@ "running." msgstr "" "Non si può effettuare questa operazione poiché è in corso la fusione di due " -"directory." +"cartelle." #: directorymergewindow.cpp:2162 msgid "" @@ -478,81 +480,81 @@ #: directorymergewindow.cpp:2265 msgid "" "Simulated merge complete: Check if you agree with the proposed operations." -msgstr "Terminata fusione simulata: Ti soddisfano le operazioni proposte?" +msgstr "" +"Terminata simulazione fusione: controlla se le operazioni proposte vanno bene." #: directorymergewindow.cpp:2301 msgid "" "An error occurred. Press OK to see detailed information.\n" msgstr "" -"Si è verificato un errore. Premi OK per informazioni dettagliate.\n" +"Si è verificato un errore. Premi OK per maggiori informazioni.\n" #: directorymergewindow.cpp:2344 msgid "Error: While deleting %1: Creating backup failed." -msgstr "Errore: nell'eliminare %1: non ho potuto creare un backup." +msgstr "Errore: nell'eliminare %1: non ho potuto creare una copia di riserva." #: directorymergewindow.cpp:2351 msgid "delete directory recursively( %1 )" -msgstr "eliminare directory ricorsivamente ( %1 )" +msgstr "elimina cartella ricorsivamente (%1)" #: directorymergewindow.cpp:2353 msgid "delete( %1 )" -msgstr "Elimina ( %1 )" +msgstr "elimina (%1)" #: directorymergewindow.cpp:2368 msgid "Error: delete dir operation failed while trying to read the directory." -msgstr "" -"Errore: non potendo leggere la directory la sua eliminazione non è riuscita." +msgstr "Errore: fallita l'eleminazione della cartella durante la sua lettura." #: directorymergewindow.cpp:2387 msgid "Error: rmdir( %1 ) operation failed." -msgstr "Errore: no è riuscita l'operazione rmdir( %1 )." +msgstr "Errore: non è riuscita l'operazione rmdir (%1)." #: directorymergewindow.cpp:2397 msgid "Error: delete operation failed." -msgstr "Errore: operazione di eliminazione non riuscita." +msgstr "Errore: eliminazione fallita." #: directorymergewindow.cpp:2423 msgid "manual merge( %1, %2, %3 -> %4)" -msgstr "fusione manuale ( %1, %2,%3 -> %4)" +msgstr "fusione manuale (%1, %2,%3 -> %4)" #: directorymergewindow.cpp:2426 msgid "" " Note: After a manual merge the user should continue by pressing F7." msgstr "" -" Nota: Dopo una fusione manuale l'utente deve dare F7 per continuare." +" Nota: Dopo una fusione manuale l'utente deve premere F7 per continuare." #: directorymergewindow.cpp:2449 msgid "Error: copy( %1 -> %2 ) failed.Deleting existing destination failed." msgstr "" -"Errore: copia da %1 a %2 non riuscita. Non ho potuto eliminare la destinazione " -"(esistente)." +"Errore: copia da %1 a %2 non riuscita. Eliminazione destinazione esistente " +"fallita." #: directorymergewindow.cpp:2459 msgid "copyLink( %1 -> %2 )" -msgstr "copyLink( %1 -> %2 )" +msgstr "copiaLink(%1 -> %2)" #: directorymergewindow.cpp:2470 msgid "Error: copyLink failed: Remote links are not yet supported." msgstr "" -"Errore: copyLink impossibile: i link remoti non sono ancora supportati." +"Errore: copiaLink impossibile: i link remoti non sono ancora supportati." #: directorymergewindow.cpp:2476 msgid "Error: copyLink failed." -msgstr "Errore: copyLink non riuscito." +msgstr "Errore: copiaLink non riuscito." #: directorymergewindow.cpp:2496 msgid "copy( %1 -> %2 )" -msgstr "copia( %1 -> %2 )" +msgstr "copia(%1 -> %2)" #: directorymergewindow.cpp:2522 msgid "Error during rename( %1 -> %2 ): Cannot delete existing destination." msgstr "" -"Errore nel cambio nome ( %1 -> %2): Impossibile eliminare la destinazione già " +"Errore nel cambio nome (%1 -> %2): Impossibile eliminare la destinazione " "esistente." #: directorymergewindow.cpp:2528 msgid "rename( %1 -> %2 )" -msgstr "cambio nome( %1 -> %2 )" +msgstr "cambio nome(%1 -> %2)" #: directorymergewindow.cpp:2537 msgid "Error: Rename failed." @@ -564,11 +566,11 @@ #: directorymergewindow.cpp:2571 msgid "makeDir( %1 )" -msgstr "makeDir( %1 )" +msgstr "makeDir(%1)" #: directorymergewindow.cpp:2581 msgid "Error while creating directory." -msgstr "Errore nel creare una directory." +msgstr "Errore nel creare una cartella." #: directorymergewindow.cpp:2604 directorymergewindow.cpp:2721 msgid "Dest" @@ -623,13 +625,12 @@ msgstr "Dest: " #: directorymergewindow.cpp:2771 -#, fuzzy msgid "Save Directory Merge State As..." -msgstr "Fusione di directory" +msgstr "Salva lo stato di fusione cartelle come..." #: directorymergewindow.cpp:2858 msgid "Start/Continue Directory Merge" -msgstr "Avvia/continua fusione directory" +msgstr "Avvia/continua fusione cartelle" #: directorymergewindow.cpp:2859 msgid "Run Operation for Current Item" @@ -637,7 +638,7 @@ #: directorymergewindow.cpp:2860 msgid "Compare Selected File" -msgstr "Confronta file selezionati" +msgstr "Confronta file selezionato" #: directorymergewindow.cpp:2861 msgid "Merge Current File" @@ -645,21 +646,11 @@ #: directorymergewindow.cpp:2862 msgid "Fold All Subdirs" -msgstr "Chiudi tutte le sottodirectory" +msgstr "Chiudi tutte le sottocartelle" #: directorymergewindow.cpp:2863 msgid "Unfold All Subdirs" -msgstr "Apri tutte le sottodirectory" - -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Fusione di directory" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Fusione di directory" +msgstr "Apri tutte le sottocartelle" #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" @@ -683,34 +674,31 @@ #: directorymergewindow.cpp:2876 msgid "Show Identical Files" -msgstr "" +msgstr "Mostra file uguali" #: directorymergewindow.cpp:2877 -#, fuzzy msgid "Show Different Files" -msgstr "Numero di file differenti:" +msgstr "Mostra file diversi" #: directorymergewindow.cpp:2878 msgid "Show Files only in A" -msgstr "" +msgstr "Mostra file solo in A" #: directorymergewindow.cpp:2879 msgid "Show Files only in B" -msgstr "" +msgstr "Mostra file solo in B" #: directorymergewindow.cpp:2880 msgid "Show Files only in C" -msgstr "" +msgstr "Mostra file solo in C" #: directorymergewindow.cpp:2884 -#, fuzzy msgid "Compare Explicitly Selected Files" msgstr "Confronta file selezionati" #: directorymergewindow.cpp:2885 -#, fuzzy msgid "Merge Explicitly Selected Files" -msgstr "Confronta file selezionati" +msgstr "Fondi file selezionati" #: directorymergewindow.cpp:2887 directorymergewindow.cpp:2894 msgid "Do Nothing" @@ -736,110 +724,110 @@ msgid "Merge to A && B" msgstr "Fondi A e B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -"Nel creare un nuovo backup, non è riuscita l'eliminazione di uno precedente.\n" +"Nel creare una nuova copia, è fallita l'eliminazione di una precedente.\n" "Nome del file: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -"Nel creare un backup, non è riuscito un cambio di nome.\n" -"Nome del file: " - -#: fileaccess.cpp:592 +"Nel creare una copia di riserva, non è riuscito un cambio di nome.\n" +"Nome dei file: " + +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" -msgstr "Cerco informazioni su stato file: %1" - -#: fileaccess.cpp:635 +msgstr "Recupero informazioni su stato file: %1" + +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Lettura file: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Scrittura file: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Memoria esaurita" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" -msgstr "Creazione directory: %1" - -#: fileaccess.cpp:754 +msgstr "Creazione cartella: %1" + +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" -msgstr "Rimozione directory: %1" - -#: fileaccess.cpp:769 +msgstr "Rimozione cartella: %1" + +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Rimozione file: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Creazione link simbolico: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Cambiamento nome file: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Copia del file: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -"Errore nel copiare un file: Non riuscita l'apertura del file %1 in lettura." - -#: fileaccess.cpp:867 +"Errore durante la copia di un file: fallita l'apertura del file in lettura. " +"Nome file: %1" + +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" -"Errore nel copiare un file: Non riuscita l'apertura del file %1 in scrittura." - -#: fileaccess.cpp:882 +"Errore durante la copia di un file: fallita l'apertura del file in scrittura. " +"Nome file: %1" + +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" -msgstr "Errore nel copiare un file: Lettura non riuscita. Nome del file %1" - -#: fileaccess.cpp:891 +msgstr "Errore durante la copia di un file: lettura fallita. Nome file: %1" + +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" -msgstr "Errore nel copiare un file: Scrittura non riuscita. Nome del file %1" - -#: fileaccess.cpp:1187 +msgstr "Errore durante la copia di un file: Scrittura fallita. Nome file: %1" + +#: fileaccess.cpp:1205 msgid "Reading directory: " -msgstr "Lettura directory:" - -#: fileaccess.cpp:1316 +msgstr "Lettura cartella: " + +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" -msgstr "Elencazione directory: %1" +msgstr "Elencazione cartella: %1" #: kdiff3.cpp:142 -#, fuzzy msgid "Current Configuration:" -msgstr "Operazione di sincronizzazione su questo file/dir." +msgstr "Configurazione attuale:" #: kdiff3.cpp:147 -#, fuzzy msgid "Config Option Error:" -msgstr "Errore nell'aprire file" +msgstr "Errore opzioni di configurazione:" #: kdiff3.cpp:187 msgid "Option --auto used, but no output file specified." @@ -847,7 +835,7 @@ #: kdiff3.cpp:318 msgid "Option --auto ignored for directory comparison." -msgstr "Opzione --auto ignorata nel confronto di directory." +msgstr "Opzione --auto ignorata nel confronto di cartelle." #: kdiff3.cpp:354 msgid "Saving failed." @@ -877,7 +865,7 @@ #: kdiff3.cpp:422 msgid "Print the differences" -msgstr "" +msgstr "Stampa le differenze" #: kdiff3.cpp:424 msgid "Quits the application" @@ -897,7 +885,7 @@ #: kdiff3.cpp:432 msgid "Select everything in current window" -msgstr "" +msgstr "Seleziona tutto nella finestra corrente" #: kdiff3.cpp:434 msgid "Search for a string" @@ -963,11 +951,11 @@ #: kdiff3.cpp:478 msgid "Go to Previous Unsolved Conflict" -msgstr "Vai al precedente conflitto non risolto." +msgstr "Vai al precedente conflitto non risolto" #: kdiff3.cpp:480 msgid "Go to Next Unsolved Conflict" -msgstr "Vai al successivo conflitto non risolto." +msgstr "Vai al successivo conflitto non risolto" #: kdiff3.cpp:482 msgid "Select Line(s) From A" @@ -993,7 +981,7 @@ #: kdiff3.cpp:488 msgid "Show White Space" -msgstr "Mostra spazi bianchi" +msgstr "Mostra spazi vuoti" #: kdiff3.cpp:490 msgid "Show Line Numbers" @@ -1025,15 +1013,15 @@ #: kdiff3.cpp:497 msgid "Choose A for All Unsolved Whitespace Conflicts" -msgstr "Scegli A per risolvere tutti i conflitti di \"spazi bianchi\"" +msgstr "Scegli A per tutti i conflitti di \"spazi bianchi\" non risolti" #: kdiff3.cpp:498 msgid "Choose B for All Unsolved Whitespace Conflicts" -msgstr "Scegli B per risolvere tutti i conflitti di \"spazi bianchi\"" +msgstr "Scegli B per tutti i conflitti di \"spazi bianchi\" non risolti" #: kdiff3.cpp:499 msgid "Choose C for All Unsolved Whitespace Conflicts" -msgstr "Scegli C per risolvere tutti i conflitti di \"spazi bianchi\"" +msgstr "Scegli C per tutti i conflitti di \"spazi bianchi\" non risolti" #: kdiff3.cpp:500 msgid "Automatically Solve Simple Conflicts" @@ -1045,21 +1033,19 @@ #: kdiff3.cpp:502 msgid "Run Regular Expression Auto Merge" -msgstr "" +msgstr "Avvia la fusione automatica espressioni regolari" #: kdiff3.cpp:503 -#, fuzzy msgid "Automatically Solve History Conflicts" msgstr "Risolvi automaticamente i conflitti semplici" #: kdiff3.cpp:504 msgid "Split Diff At Selection" -msgstr "" +msgstr "Dividi differenze a selezione" #: kdiff3.cpp:505 -#, fuzzy msgid "Join Selected Diffs" -msgstr "Confronta file selezionati" +msgstr "Unisci i file selezionati" #: kdiff3.cpp:507 msgid "Show Window A" @@ -1075,7 +1061,7 @@ #: kdiff3.cpp:510 kdiff3.cpp:521 msgid "Focus Next Window" -msgstr "Attiva finestra succ." +msgstr "Focus prossima finestra" #: kdiff3.cpp:512 msgid "Normal Overview" @@ -1099,15 +1085,15 @@ #: kdiff3.cpp:517 msgid "Add Manual Diff Alignment" -msgstr "" +msgstr "Aggiungi allineamento manuale delle differenze" #: kdiff3.cpp:518 msgid "Clear All Manual Diff Alignments" -msgstr "" +msgstr "Cancella tutti gli allineamenti manuali delle differenze" #: kdiff3.cpp:523 msgid "Focus Prev Window" -msgstr "Attiva finestra prec." +msgstr "Focus finestra prec" #: kdiff3.cpp:524 msgid "Toggle Split Orientation" @@ -1115,11 +1101,11 @@ #: kdiff3.cpp:526 msgid "Dir && Text Split Screen View" -msgstr "Separa visione di testi e directory" +msgstr "Separa visione di testi e cartelle" #: kdiff3.cpp:528 msgid "Toggle Between Dir && Text View" -msgstr "Commuta tra visualizzazione di testi e di directory" +msgstr "Commuta tra visualizzazione di testi e di cartelle" #: kdiff3.cpp:573 pdiff.cpp:1698 msgid "The merge result hasn't been saved." @@ -1127,7 +1113,7 @@ #: kdiff3.cpp:574 msgid "Save && Quit" -msgstr "Salva e esci" +msgstr "Salva ed esci" #: kdiff3.cpp:574 msgid "Quit Without Saving" @@ -1140,7 +1126,7 @@ #: kdiff3.cpp:593 pdiff.cpp:964 msgid "" "You are currently doing a directory merge. Are you sure, you want to abort?" -msgstr "È in corso la fusione di directory. Sei sicuro di voler interrompere?" +msgstr "È in corso la fusione di cartelle. Sei sicuro di voler interrompere?" #: kdiff3.cpp:616 msgid "Saving file..." @@ -1151,22 +1137,20 @@ msgstr "Salvataggio file con nuovo nome..." #: kdiff3.cpp:722 -#, fuzzy msgid "Printing..." -msgstr "Uscita..." +msgstr "Stampa..." #: kdiff3.cpp:728 kdiff3.cpp:890 msgid "Printing aborted." -msgstr "" +msgstr "Stampa interrotta." #: kdiff3.cpp:860 msgid "Selection" -msgstr "" +msgstr "Selezione" #: kdiff3.cpp:886 -#, fuzzy msgid "Printing completed." -msgstr "Operazione di fusione completata." +msgstr "Stampa completata." #: kdiff3.cpp:896 msgid "Exiting..." @@ -1180,11 +1164,11 @@ msgid "Toggle the statusbar..." msgstr "(dis)attiva la barra di stato..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Non trovo i file da confrontare." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1200,7 +1184,7 @@ #: main.cpp:35 msgid "Tool for Comparison and Merge of Files and Directories" -msgstr "Strumento per confrontare e fondere più file o directory" +msgstr "Strumento per confrontare e fondere più file o cartelle" #: main.cpp:40 msgid "Merge the input." @@ -1221,7 +1205,7 @@ #: main.cpp:46 msgid "No GUI if all conflicts are auto-solvable. (Needs -o file)" msgstr "" -"Senza GUI se ogni conflitto è risolubile in automatico. (Serve -o file)" +"Senza GUI se ogni conflitto è risolvibile in automatico. (Serve -o file)" #: main.cpp:47 msgid "Don't solve conflicts automatically. (For compatibility...)" @@ -1249,15 +1233,17 @@ "Override a config setting. Use once for every setting. E.g.: --cs " "\"AutoAdvance=1\"" msgstr "" +"Ignora un'impostazione di configurazione. Usa una volta per ogni impostazione. " +"P. e.: --cs \"AutoAdvance=1\"" #: main.cpp:54 msgid "Show list of config settings and current values." msgstr "" +"Mostra la lista delle impostazioni di configurazione e i valori correnti." #: main.cpp:55 -#, fuzzy msgid "Use a different config file." -msgstr "Numero di file differenti:" +msgstr "Usa un file di configurazione diverso." #: main.cpp:59 msgid "file1 to open (base, if not specified via --base)" @@ -1273,7 +1259,7 @@ #: main.cpp:93 msgid "Ignored. (User defined.)" -msgstr "" +msgstr "Ignorato. (definito dall'utente)" #. i18n: file kdiff3_part.rc line 16 #: main.cpp:171 rc.cpp:9 @@ -1285,14 +1271,14 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "+ Mille grazie a coloro che hanno segnalato errori o fornito idee!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Numero di conflitti non ancora risolti: %1 (di cui %2 relativi a spazi bianchi)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1300,55 +1286,55 @@ "L'ouput è stato modificato.\n" "Se continui le modifiche andranno perse." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Tutti i file in input sono uguali a livello binario." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Tutti i file in input contengono lo stesso testo." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "I file A e B sono uguali a livello binario.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "I file A e B contengono lo stesso testo.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "I file A e C sono uguali a livello binario.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "I file A e C contengono lo stesso testo.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "I file B e C sono uguali a livello binario.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "I file B e C contengono lo stesso testo.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Numero totale di conflitti: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1356,7 +1342,7 @@ "\n" "N. di conflitti risolti automaticamente: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1364,31 +1350,31 @@ "\n" "N. di conflitti non risolti: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Conflitti" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Output" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Modificato]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1396,11 +1382,11 @@ "Permangono dei conflitti non risolti.\n" "Il file non verrà salvato.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Conflitti restanti" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1408,15 +1394,15 @@ msgstr "" "\n" "\n" -"Impossibile fare un backup. File non salvato." - -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +"Impossibile fare una copia di riserva. File non salvato." + +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Errore nel salvare il file" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." -msgstr "Errore di scrittura" +msgstr "Errore di scrittura." #: optiondialog.cpp:361 msgid "Unicode, 8 bit" @@ -1436,7 +1422,7 @@ #: optiondialog.cpp:507 msgid "Editor & Diff Output Font" -msgstr "Font per l'editor e per l'output di diff" +msgstr "Set di caratteri per l'editor e per l'output di diff" #: optiondialog.cpp:528 msgid "Italic font for deltas" @@ -1447,21 +1433,20 @@ "Selects the italic version of the font for differences.\n" "If the font doesn't support italic characters, then this does nothing." msgstr "" -"Imposta per le differenze la versione corsiva del font in uso.\n" -"Se il font non supporta il corsivo, l'opzione non avrà alcun effetto." +"Imposta per le differenze la versione corsiva del carattere in uso.\n" +"Se il carattere non supporta il corsivo, l'opzione non avrà alcun effetto." #: optiondialog.cpp:539 msgid "Color" msgstr "Colore" #: optiondialog.cpp:539 -#, fuzzy msgid "Colors Settings" -msgstr "Impostazioni locali" +msgstr "Impostazioni colori" #: optiondialog.cpp:553 msgid "Editor and Diff Views:" -msgstr "" +msgstr "Editor e visualizzatore differenze:" #: optiondialog.cpp:561 msgid "Foreground color:" @@ -1501,34 +1486,35 @@ #: optiondialog.cpp:622 msgid "Color for manually aligned difference ranges:" -msgstr "" +msgstr "Colore per intervalli di differenze allineate manualmente:" #: optiondialog.cpp:627 -#, fuzzy msgid "Directory Comparison View:" -msgstr "Situazione del confronto di cartelle" +msgstr "Vista di confronto cartelle:" #: optiondialog.cpp:633 msgid "Newest file color:" -msgstr "" +msgstr "colore del file più recente:" #: optiondialog.cpp:636 msgid "" "Changing this color will only be effective when starting the next directory " "comparison." msgstr "" +"Il cambiamento di questo colore sarà effettivo quando si avvierà un nuovo " +"confronto tra cartelle." #: optiondialog.cpp:641 msgid "Oldest file color:" -msgstr "" +msgstr "Colore del file più vecchio:" #: optiondialog.cpp:648 msgid "Middle age file color:" -msgstr "" +msgstr "Colore del file di età media:" #: optiondialog.cpp:655 msgid "Color for missing files:" -msgstr "" +msgstr "Colore per file mancanti:" #: optiondialog.cpp:667 msgid "Editor" @@ -1540,7 +1526,7 @@ #: optiondialog.cpp:677 msgid "Tab inserts spaces" -msgstr "I Tab inseriscono spazi" +msgstr "Il Tab inserisce spazi" #: optiondialog.cpp:680 msgid "" @@ -1566,7 +1552,7 @@ #: optiondialog.cpp:698 msgid "Auto copy selection" -msgstr "Copia automaticamente la selezione" +msgstr "Copia automaticamente della selezione" #: optiondialog.cpp:701 msgid "" @@ -1585,30 +1571,28 @@ "Sets the line endings for when an edited file is saved.\n" "DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A" msgstr "" -"Imposta il \"fine riga\" da usare nel salvare un file modificato:\n" +"Imposta il \"fine riga\" da usare quando salvi un file modificato:\n" "DOS/Windows: CR+LF; Unix: LF; dove CR=0D, LF=0A" #: optiondialog.cpp:729 -#, fuzzy msgid "Diff and Merge" msgstr "Differenza e fusione" #: optiondialog.cpp:729 -#, fuzzy msgid "Diff and Merge Settings" -msgstr "Impostazioni per confronti e fusioni" +msgstr "Impostazioni differenze e fusioni" #: optiondialog.cpp:740 msgid "Preserve carriage return" -msgstr "Mostra i \"ritorno carrello\" (CR)" +msgstr "Conserva il ritorno carrello" #: optiondialog.cpp:743 msgid "" "Show carriage return characters '\\r' if they exist.\n" "Helps to compare files that were modified under different operating systems." msgstr "" -"Mostra i caratteri di ritorno carrello \"\\r\"se presenti\n" -".Aiuta a confrontare file modificati sotto sistemi operativi diversi." +"Mostra i caratteri di ritorno carrello \"\\r\"se presenti.\n" +"Aiuta a confrontare file modificati sotto sistemi operativi diversi." #: optiondialog.cpp:748 msgid "Ignore numbers" @@ -1620,8 +1604,8 @@ "space.)\n" "Might help to compare files with numeric data." msgstr "" -"Ignora i caratteri numerici durante il confronto. (Analogo a \"Ignora spazi " -"bianchi\".)\n" +"Ignora i caratteri numerici durante il confronto. (Analogo a \"Ignora " +"spazi\".)\n" "Può essere utile per confrontare file con dati numerici." #: optiondialog.cpp:756 @@ -1638,7 +1622,7 @@ #: optiondialog.cpp:765 msgid "Treat case differences like white space changes. ('a'<=>'A')" -msgstr "Tratta differenze maiusc/minusc. come spazi bianchi. ('a'<=>'A')" +msgstr "Tratta differenze maiusc./minusc. come spazi bianchi. ('a'<=>'A')" #: optiondialog.cpp:769 msgid "Preprocessor command:" @@ -1647,7 +1631,7 @@ #: optiondialog.cpp:773 msgid "User defined pre-processing. (See the docs for details.)" msgstr "" -"Preprocessore definito dall'utente. Vedi il manuale per maggiori dettagli." +"Preprocessore definito dall'utente. Vedi il manuale per maggiori dettagli" #: optiondialog.cpp:776 msgid "Line-matching preprocessor command:" @@ -1660,7 +1644,7 @@ msgstr "" "Questo preprocessore viene utilizzato solo\n" "per verificare la corrispondenza di righe.\n" -"Vedi il manuale per maggiori dettagli." +"Vedi il manuale per maggiori dettagli" #: optiondialog.cpp:783 msgid "Try hard (slower)" @@ -1676,7 +1660,7 @@ #: optiondialog.cpp:791 msgid "Auto advance delay (ms):" -msgstr "Pause nell'avanzamento automatico(ms):" +msgstr "Ritardo nell'avanzamento automatico(ms):" #: optiondialog.cpp:796 msgid "" @@ -1685,7 +1669,7 @@ msgstr "" "Quando si è in modalità avanzamento automatico, il risultato della\n" "selezione attuale viene mostrato per questo tempo, prima di passare\n" -"al prossimo conflitto. Valori ammessi: 0-2000 ms." +"al prossimo conflitto. Valori ammessi: 0-2000 ms" #: optiondialog.cpp:801 msgid "White space 2-file merge default:" @@ -1709,11 +1693,11 @@ #: optiondialog.cpp:828 msgid "Automatic Merge Regular Expression" -msgstr "" +msgstr "Fusione automatica espressioni regolari" #: optiondialog.cpp:837 smalldialogs.cpp:379 msgid "Auto merge regular expression:" -msgstr "" +msgstr "Fondi automaticamente espressione regolare:" #: optiondialog.cpp:841 msgid "" @@ -1722,24 +1706,31 @@ "When a line with a conflict matches the regular expression then\n" "- if available - C, otherwise B will be chosen." msgstr "" +"Espressione regolare per le righe dove Kdiff3 dovrebbe scegliere " +"automaticamente una fonte.\n" +"Quando una riga con un conflitto corrisponde all'espressione regolare allora " +"sarà scelto\n" +"- se disponibile - C, altrimenti B." #: optiondialog.cpp:847 msgid "Run regular expression auto merge on merge start" -msgstr "" +msgstr "Avvia fusione automatica dell'espressione regolare all'avvio fusione" #: optiondialog.cpp:849 msgid "" "Run the merge for auto merge regular expressions\n" "immediately when a merge starts.\n" msgstr "" +"Esegue la fusione per l'operazione automatica con le espressioni regolari\n" +"immediatamente all'avvio dell'operazione.\n" #: optiondialog.cpp:854 msgid "Version Control History Merging" -msgstr "" +msgstr "Fusione della cronologia del controllo della versione" #: optiondialog.cpp:863 smalldialogs.cpp:406 msgid "History start regular expression:" -msgstr "" +msgstr "Avvio cronologia dell'espressione regolare:" #: optiondialog.cpp:867 msgid "" @@ -1747,10 +1738,14 @@ "Usually this line contains the \"$Log$\"-keyword.\n" "Default value: \".*\\$Log.*\\$.*\"" msgstr "" +"Espressione regolare per l'inizio dell'elemento di cronologia del controllo " +"della versione.\n" +"Solitamente questa riga contiene \"$Log$\"-keyword.\n" +"Valore predefinito: \".*\\$Log.*\\$.*\"" #: optiondialog.cpp:873 smalldialogs.cpp:435 msgid "History entry start regular expression:" -msgstr "" +msgstr "Espressione regolare di inizio dell'elemento di cronologia:" #: optiondialog.cpp:885 msgid "" @@ -1761,18 +1756,28 @@ "If left empty, then KDiff3 assumes that empty lines separate history entries.\n" "See the documentation for details." msgstr "" +"Un elemento di cronologia del controllo della versione consiste di diverse " +"linee.\n" +"Specifica l'espressione regolare per individuare la prima riga (senza il " +"commento principale).\n" +"Usa le parentesi per raggruppare le chiavi che si vogliono usare per " +"l'ordinamento.\n" +"Se la parte sinistra è mancante, KDiff3 considera che le linee vuote saparano " +"gli elementi di cronologia.\n" +"Consulta la documentazione per ulteriori dettagli." #: optiondialog.cpp:893 msgid "History merge sorting" -msgstr "" +msgstr "Ordinamento della fusione della cronologia" #: optiondialog.cpp:895 msgid "Sort version control history by a key." -msgstr "" +msgstr "Ordina la cronologia del controllo di versione per chiavi." #: optiondialog.cpp:905 msgid "History entry start sort key order:" msgstr "" +"Ordine della chiave d'ordinamento d'inizio dell'elemento di cronologia:" #: optiondialog.cpp:909 msgid "" @@ -1783,22 +1788,30 @@ "If left empty, then no sorting will be done.\n" "See the documentation for details." msgstr "" +"Ogni parentesi usata nell'espressione regolare per la voce di avvio della " +"cronologia\n" +"raggruppa una chiave che può essere usata per l'ordinamento.\n" +"Specifica la lista delle chiavi (che sono numerate in ordine di avvenimento\n" +"iniziando con 1) usando ',' come separatore (p.e. \"4,5,6,1,2,3,7\").\n" +"Consulta la documentazione per i ulteriori dettagli." #: optiondialog.cpp:920 msgid "Merge version control history on merge start" -msgstr "" +msgstr "Fondi la cronologia del controllo di versione all'inizio della fusione" #: optiondialog.cpp:922 msgid "Run version control history automerge on merge start." msgstr "" +"Avvia l'autofusione della cronologia del controllo di versione all'inizio della " +"fusione." #: optiondialog.cpp:926 msgid "Test your regular expressions" -msgstr "" +msgstr "Prova le tue espressioni regolari" #: optiondialog.cpp:931 msgid "Irrelevant merge command:" -msgstr "" +msgstr "Comando di fusione irrilevante:" #: optiondialog.cpp:935 msgid "" @@ -1806,6 +1819,9 @@ "when no other relevant changes were detected.\n" "Called with the parameters: filename1 filename2 filename3" msgstr "" +"Se specificato questo script è avviato dopo la fusione automatica\n" +"quando non sono rilevati altri cambiamenti rilevanti.\n" +"Chiamati con i paramentri: filename1 filename2 filename3" #: optiondialog.cpp:945 msgid "Directory Merge" @@ -1911,7 +1927,7 @@ #: optiondialog.cpp:1035 msgid "Case sensitive filename comparison" -msgstr "" +msgstr "Confronto nomi file sensibili alle maiuscole/minuscole" #: optiondialog.cpp:1038 msgid "" @@ -1920,6 +1936,10 @@ "Set this option if the case of the names must match. (Default for Windows is " "off, otherwise on.)" msgstr "" +"Il confronto tra cartelle confronterà file o cartelle quando i loro nomi " +"coincidono.\n" +"Imposta questa opzione se il caso dei nomi deve coincidere. (l'opzione " +"predefinita per Windows è off, altrimenti on.)" #: optiondialog.cpp:1042 msgid "File Comparison Mode" @@ -2030,11 +2050,11 @@ msgid "Regional Settings" msgstr "Impostazioni locali" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Lingua (bisogna riavviare kdiff3)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2042,11 +2062,11 @@ "Scegli una lingua dell'interfaccia grafica o \"Auto\".\n" "Affinché la lingua venga cambiata, devi uscire e riavviare KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Usa la stessa codifica per tutto:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2054,35 +2074,35 @@ "Permette di cambiare tutte le codifiche cambiando solo la prima.\n" "Disattivala se servono impostazioni differenziate." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Nota: La codifica locale è " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Codifica per file A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Codifica per file B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Codifica per file C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Codifica per i file fusione e salvataggio:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Codifica per i file sottoposti al preprocessore:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Lingue scritte da destra a sin." -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2090,29 +2110,31 @@ "Alcune lingue si scrivono da destra a sinistra.\n" "Questa opzione cambia editor e visualizzazione per adattarvisi." -#: optiondialog.cpp:1315 -#, fuzzy +#: optiondialog.cpp:1318 msgid "Integration" -msgstr "Operazione" - -#: optiondialog.cpp:1315 -#, fuzzy +msgstr "Integrazione" + +#: optiondialog.cpp:1318 msgid "Integration Settings" -msgstr "Impostazioni locali" - -#: optiondialog.cpp:1325 +msgstr "Impostazioni di integrazione" + +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" -msgstr "" - -#: optiondialog.cpp:1330 +msgstr "Opzioni di riga di comando da ignorare:" + +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" "Several values can be specified if separated via ';'\n" "This will suppress the \"Unknown option\"-error." msgstr "" - -#: optiondialog.cpp:1383 +"Lista delle opzioni da riga di comando che dovrebbero essere ignorate quando " +"KDiff3 viene usato da altri strumenti.\n" +"Molti valori possono essere specificati se separati con ';'\n" +"Questo elimina l'errore \"Opzione sconosciuta\"." + +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2128,19 +2150,19 @@ "\n" "Vuoi continuare o preferisci cambiare font?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Font incompatibile " -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Continua a tuo rischio" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Scegli un altro font" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "Verranno ripristinate tutte le opzioni.\n" @@ -2215,23 +2237,23 @@ msgstr "Diff. righe: A <-> C" #: pdiff.cpp:509 -#, fuzzy msgid "All input files contain the same text, but are not binary equal." -msgstr "Tutti i file in input contengono lo stesso testo." +msgstr "" +"Tutti i file in input contengono lo stesso testo, ma non sono uguali a livello " +"binario." #: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 -#, fuzzy msgid "" "Files %1 and %2 are binary equal.\n" msgstr "" -"I file B e C sono uguali a livello binario.\n" +"I file %1 e %2 sono uguali a livello binario.\n" #: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 -#, fuzzy msgid "" "Files %1 and %2 have equal text, but are not binary equal. \n" msgstr "" -"I file A e B sono uguali a livello binario.\n" +"I file %1 e %2 contengono lo stesso testo, ma non sono uguali a livello " +"binario. \n" #: pdiff.cpp:526 msgid "" @@ -2283,14 +2305,14 @@ msgid "Search Complete" msgstr "Ricerca completata." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" - -#: pdiff.cpp:2129 -#, fuzzy +"Non è selezionato niente neanche nella finestra di input delle differenze." + +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" -msgstr "Errore nel creare una directory." +msgstr "Errore nell'aggiungere intervalli di differenza manuali" #. i18n: file kdiff3_part.rc line 4 #: rc.cpp:3 @@ -2366,19 +2388,19 @@ #: smalldialogs.cpp:108 msgid "Swap/Copy Names ..." -msgstr "" +msgstr "Scambia/copia Nomi..." #: smalldialogs.cpp:114 smalldialogs.cpp:115 smalldialogs.cpp:116 msgid "Swap %1<->%2" -msgstr "" +msgstr "Scambia %1<->%2" #: smalldialogs.cpp:117 smalldialogs.cpp:118 smalldialogs.cpp:119 msgid "Copy %1->Output" -msgstr "" +msgstr "Copia %1->Output" #: smalldialogs.cpp:120 smalldialogs.cpp:121 smalldialogs.cpp:122 msgid "Swap %1<->Output" -msgstr "" +msgstr "Scambia %1<->Output" #: smalldialogs.cpp:129 msgid "Output (optional):" @@ -2418,88 +2440,60 @@ #: smalldialogs.cpp:376 msgid "Regular Expression Tester" -msgstr "" +msgstr "Tester espressione regolare" #: smalldialogs.cpp:387 msgid "Example auto merge line:" -msgstr "" +msgstr "Esempio riga di fusione automatica:" #: smalldialogs.cpp:389 msgid "For auto merge test copy a line as used in your files." -msgstr "" +msgstr "Per il test fusione automatica copia una riga come fai nei tuoi file." #: smalldialogs.cpp:395 smalldialogs.cpp:424 smalldialogs.cpp:461 msgid "Match result:" -msgstr "" +msgstr "Risultato confronto:" #: smalldialogs.cpp:414 msgid "Example history start line (with leading comment):" -msgstr "" +msgstr "Esempio di riga di avvio cronologia (con relativo commento):" #: smalldialogs.cpp:417 msgid "" "Copy a history start line as used in your files,\n" "including the leading comment." msgstr "" +"Copia una riga di avvio cronologia come fai nei tuoi file,\n" +"includendo il relativo commento." #: smalldialogs.cpp:443 msgid "History sort key order:" -msgstr "" +msgstr "Ordine della chiave d'ordinamento cronologico:" #: smalldialogs.cpp:451 msgid "Example history entry start line (without leading comment):" -msgstr "" +msgstr "Esempio di riga di avvio cronologia (senza relativo commento):" #: smalldialogs.cpp:453 msgid "" "Copy a history entry start line as used in your files,\n" "but omit the leading comment." msgstr "" +"Copia una riga di avvio voce di cronologia come fai nei tuoi file,\n" +"ma ometti il relativo commento." #: smalldialogs.cpp:468 msgid "Sort key result:" -msgstr "" +msgstr "Ordina il risultato per chiave:" #: smalldialogs.cpp:519 smalldialogs.cpp:529 smalldialogs.cpp:550 msgid "Match success." -msgstr "" +msgstr "Confronto con successo." #: smalldialogs.cpp:523 smalldialogs.cpp:533 smalldialogs.cpp:556 -#, fuzzy msgid "Match failed." -msgstr "Salvataggio non riuscito." +msgstr "Confronto fallito." #: smalldialogs.cpp:541 msgid "Opening and closing parentheses don't match in regular expression." -msgstr "" - -#, fuzzy -#~ msgid "Synchronize Directories" -#~ msgstr "Sincronizza le directory" - -#, fuzzy -#~ msgid "Copy Newer Files Instead of Merging" -#~ msgstr "Copia il più recente invece di fondere (non sicuro)" - -#~ msgid "List only deltas" -#~ msgstr "Elenca solo le differenze" - -#~ msgid "Files and directories without change will not appear in the list." -#~ msgstr "Non compariranno nell'elenco i file e le directory non modificati." - -#, fuzzy -#~ msgid "no selection" -#~ msgstr "Copia automaticamente la selezione" - -#, fuzzy -#~ msgid "Manually match lines" -#~ msgstr "Scelta manuale" - -#~ msgid "Has no effect. For compatibility with certain tools." -#~ msgstr "Non ha effetti. Per compatibilità con alcuni programmi." - -#~ msgid "For compatibility with certain tools." -#~ msgstr "Per compatibilità con alcuni strumenti." - -#~ msgid "Colors in Editor & Diff Output" -#~ msgstr "Colore per l'editor e per l'output di diff" +msgstr "Aprire e chiudere parentesi non confronta le espressioni regolari." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/ja.po --- a/kdiff3/po/ja.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/ja.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-14 21:25+0900\n" "Last-Translator: Yukiko Bando \n" "Language-Team: Japanese \n" @@ -52,7 +52,7 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -60,7 +60,7 @@ "データæå¤±ã‚¨ãƒ©ãƒ¼:\n" "ã‚‚ã—å†ç¾ã™ã‚‹ã‚ˆã†ãªã‚‰ä½œè€…ã«ã‚³ãƒ³ã‚¿ã‚¯ãƒˆã‚’ã¨ã£ã¦ä¸‹ã•ã„\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "深刻ãªå†…部エラー" @@ -244,7 +244,7 @@ msgid "Changing All Merge Operations" msgstr "ã™ã¹ã¦ã®ãƒžãƒ¼ã‚¸æ“作を更新中" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "続行(&O)" @@ -623,16 +623,6 @@ msgid "Unfold All Subdirs" msgstr "ã™ã¹ã¦ã®ã‚µãƒ–ディレクトリを展開" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "ディレクトリマージ" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "ディレクトリマージ" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "ã™ã¹ã¦ã®é …ç›®ã«ã¤ã„㦠A ã‚’é¸æŠž" @@ -705,7 +695,7 @@ msgid "Merge to A && B" msgstr "A 㨠B ã«ãƒžãƒ¼ã‚¸" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -713,7 +703,7 @@ "ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—作æˆä¸­ã€å¤ã„ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—を削除ã«å¤±æ•—.\n" "ファイルå: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -721,79 +711,79 @@ "ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—作æˆä¸­ã€åå‰å¤‰æ›´ã«å¤±æ•—\n" "ファイルå: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "ファイルã®çŠ¶æ…‹ã‚’å–得中: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "ファイルを読ã¿è¾¼ã¿ä¸­: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "ãƒ•ã‚¡ã‚¤ãƒ«ã«æ›¸ãè¾¼ã¿ä¸­: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "メモリãŒè¶³ã‚Šã¾ã›ã‚“" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "ディレクトリ作æˆä¸­: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "ディレクトリ削除中: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "ファイル削除中: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "シンボリックリンク作æˆä¸­: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "ファイルã®å称変更中: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "ファイルをコピー中: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "ファイルコピー中ã«ã‚¨ãƒ©ãƒ¼: ファイル読ã¿è¾¼ã¿ã«å¤±æ•—. ファイルå: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "ファイルコピー中ã«ã‚¨ãƒ©ãƒ¼: ファイル書ãè¾¼ã¿ã«å¤±æ•—. ファイルå: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "ファイルコピー中ã«ã‚¨ãƒ©ãƒ¼: 読ã¿è¾¼ã¿ã«å¤±æ•—. ファイルå: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "ファイルコピー中ã«ã‚¨ãƒ©ãƒ¼: 書ãè¾¼ã¿ã«å¤±æ•—. ファイルå: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "ディレクトリを読ã¿è¾¼ã¿ä¸­: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "ディレクトリをリスト中: %1" @@ -860,7 +850,7 @@ #: kdiff3.cpp:432 msgid "Select everything in current window" -msgstr "ç¾åœ¨ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®å…¨ã¦ã‚’é¸æŠž" +msgstr "ç¾åœ¨ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ã™ã¹ã¦ã‚’é¸æŠž" #: kdiff3.cpp:434 msgid "Search for a string" @@ -1035,7 +1025,7 @@ #: kdiff3.cpp:512 msgid "Normal Overview" -msgstr "å…¨ã¦æ¯”較 (標準)" +msgstr "ã™ã¹ã¦æ¯”較 (標準)" #: kdiff3.cpp:513 msgid "A vs. B Overview" @@ -1134,11 +1124,11 @@ msgid "Toggle the statusbar..." msgstr "状態表示ãƒãƒ¼ã®è¡¨ç¤ºã‚’切替..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "比較ã™ã‚‹ãƒ•ァイルをã¿ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã§ã—ãŸ" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1239,13 +1229,13 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "未解決ã®è¡çªã®æ•°: %1 (内 %2 ã¯ç©ºç™½)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1253,55 +1243,55 @@ "å‡ºåŠ›ãŒæ›´æ–°ã•れã¾ã—ãŸ\n" "続行ã™ã‚‹ã¨æ›´æ–°å†…容ã¯å¤±ãªã‚れã¾ã™" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "ã™ã¹ã¦ã®å…¥åŠ›ãƒ•ã‚¡ã‚¤ãƒ«ãƒã‚¤ãƒŠãƒªã¯åŒã˜ã§ã™" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "ã™ã¹ã¦ã®å…¥åŠ›ãƒ•ã‚¡ã‚¤ãƒ«ã¯åŒã˜ãƒ†ã‚­ã‚¹ãƒˆã§ã™" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "ファイル A 㨠B ã¯åŒã˜ãƒã‚¤ãƒŠãƒªã§ã™\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "ファイル A 㨠B ã¯åŒã˜ãƒ†ã‚­ã‚¹ãƒˆã§ã™\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "ファイル A 㨠C ã¯åŒã˜ãƒã‚¤ãƒŠãƒªã§ã™\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "ファイル A 㨠C ã¯åŒã˜ãƒ†ã‚­ã‚¹ãƒˆã§ã™\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "ファイル B 㨠C ã¯åŒã˜ãƒã‚¤ãƒŠãƒªã§ã™\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "ファイル B 㨠C ã¯åŒã˜ãƒ†ã‚­ã‚¹ãƒˆã§ã™\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "è¡çªã®ç·è¨ˆ: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1309,7 +1299,7 @@ "\n" "自動的ã«è§£æ±ºã•れãŸè¡çªã®æ•°: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1317,31 +1307,31 @@ "\n" "未解決ã®è¡çªã®æ•°: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "è¡çª" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "<ソース行ãªã—>" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "<マージè¡çª (空白ã®ã¿)>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<マージè¡çª>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "出力" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[æ›´æ–°]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1349,11 +1339,11 @@ "ã™ã¹ã¦ã®è¡çªãŒã¾ã è§£æ±ºã•れã¦ã„ã¾ã›ã‚“\n" "ファイルã¯ä¿å­˜ã•れã¾ã›ã‚“\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "è¡çª(å·¦)" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1363,11 +1353,11 @@ "\n" "ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—ファイルã®ä½œæˆã«å¤±æ•—。ファイルã¯ä¿å­˜ã•れã¾ã›ã‚“。" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "ファイルä¿å­˜ã‚¨ãƒ©ãƒ¼" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "書ãè¾¼ã¿ä¸­ã«ã‚¨ãƒ©ãƒ¼" @@ -1970,75 +1960,75 @@ msgid "Regional Settings" msgstr "言語ã®è¨­å®š" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "言語 (å†ã‚¹ã‚¿ãƒ¼ãƒˆãŒå¿…è¦)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" -msgstr "å…¨ã¦ã«åŒã˜ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã‚’使用:" - -#: optiondialog.cpp:1264 +msgstr "ã™ã¹ã¦ã«åŒã˜ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã‚’使用:" + +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -"ã“ã®ã‚ªãƒ—ションを有効ã«ã™ã‚‹ã¨ã€æœ€åˆã‚’変更ã™ã‚‹ã ã‘ã§å…¨ã¦ã®ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã‚’åŒæ™‚ã«å¤‰æ›´ã§ãã¾ã™ã€‚\n" +"ã“ã®ã‚ªãƒ—ションを有効ã«ã™ã‚‹ã¨ã€æœ€åˆã‚’変更ã™ã‚‹ã ã‘ã§ã™ã¹ã¦ã®ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã‚’åŒæ™‚ã«å¤‰æ›´ã§ãã¾ã™ã€‚\n" "ãれãžã‚Œã«å€‹åˆ¥ã«è¨­å®šã™ã‚‹å¿…è¦ãŒã‚ã‚‹å ´åˆã¯ã€ã“れを無効ã«ã—ã¦ãã ã•ã„。" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "ç¾åœ¨ã®ãƒ­ã‚«ãƒ¼ãƒ«ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°: " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "A ã®ãƒ•ァイルã®ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "B ã®ãƒ•ァイルã®ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "C ã®ãƒ•ァイルã®ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "マージ出力ã¨ä¿å­˜æ™‚ã®ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "プリプロセッサファイルã®ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "å³ã‹ã‚‰å·¦ã«èª­ã‚€è¨€èªž" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "çµ±åˆ" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "çµ±åˆã®è¨­å®š" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "無視ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³ã‚ªãƒ—ション:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2049,7 +2039,7 @@ "複数ã®ã‚ªãƒ—ションã¯ã‚»ãƒŸã‚³ãƒ­ãƒ³(;)ã§åŒºåˆ‡ã£ã¦æŒ‡å®šã—ã¦ãã ã•ã„。\n" "ã“れã«ã‚ˆã£ã¦ \"䏿˜Žãªã‚ªãƒ—ション\" エラーを抑制ã§ãã¾ã™ã€‚" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2065,19 +2055,19 @@ "\n" "続行ã™ã‚‹ã‹ã€ä»–ã®ãƒ•ã‚©ãƒ³ãƒˆã‚’é¸æŠžã—ã¦ä¸‹ã•ã„" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "éžäº’æ›ãªãƒ•ォント" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "自己責任ã§ç¶šè¡Œ" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "ä»–ã®ãƒ•ã‚©ãƒ³ãƒˆã‚’é¸æŠž" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "ç¾åœ¨ã®ãƒˆãƒ”ックã ã‘ã§ãªãã™ã¹ã¦ã®ã‚ªãƒ—ションをリセット" @@ -2211,11 +2201,11 @@ msgid "Search Complete" msgstr "検索完了" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "ディレクトリ作æˆä¸­ã«ã‚¨ãƒ©ãƒ¼" @@ -2400,3 +2390,11 @@ #: smalldialogs.cpp:541 msgid "Opening and closing parentheses don't match in regular expression." msgstr "" + +#, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "ディレクトリマージ" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "ディレクトリマージ" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/ka.po --- a/kdiff3/po/ka.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/ka.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-03-28 01:44+0400\n" "Last-Translator: Giasher \n" "Language-Team: \n" @@ -62,7 +62,7 @@ "\n" "ხáƒáƒ–თრდáƒáƒ›áƒ—ხვევრáƒáƒ®áƒšáƒ გáƒáƒ›áƒáƒ˜áƒ áƒ—ვებáƒ." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -70,7 +70,7 @@ "მáƒáƒœáƒáƒªáƒ”მების დáƒáƒ™áƒáƒ áƒ’ვის შეცდáƒáƒ›áƒ:\n" "თუ ეს მეáƒáƒ áƒ“ებáƒ, გთხáƒáƒ•თ დáƒáƒ£áƒ™áƒáƒ•შირდეთ áƒáƒ•ტáƒáƒ áƒ¡.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "მკáƒáƒªáƒ áƒ˜ შინáƒáƒ’áƒáƒœáƒ˜ შეცდáƒáƒ›áƒ" @@ -258,7 +258,7 @@ msgid "Changing All Merge Operations" msgstr "ყველრშერწყმის áƒáƒžáƒ”რáƒáƒªáƒ˜áƒ”ბის შეცვლáƒ" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&გáƒáƒ’რძელებáƒ" @@ -649,16 +649,6 @@ msgid "Unfold All Subdirs" msgstr "ყველრქვედირექტáƒáƒ áƒ˜áƒ˜áƒ¡ áƒáƒ áƒ©áƒáƒ™áƒ”ცვáƒ" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "დირექტáƒáƒ áƒ˜áƒáƒ—რშერწყმáƒ" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "დირექტáƒáƒ áƒ˜áƒáƒ—რშერწყმáƒ" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "A -თვის ყველრელემენტების áƒáƒ áƒ©áƒ”ვáƒ" @@ -734,7 +724,7 @@ msgid "Merge to A && B" msgstr "შერწყმრA დრB-სკენ" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -742,7 +732,7 @@ "სáƒáƒ áƒ”ზერვრáƒáƒ¡áƒšáƒ˜áƒ¡ გáƒáƒ™áƒ”თების მცდელáƒáƒ‘ისáƒáƒ¡, ძველი სáƒáƒ áƒ”ზერვრáƒáƒ¡áƒšáƒ˜áƒ¡ წáƒáƒ¨áƒšáƒ ვერ შედგáƒ. \n" "ფáƒáƒ˜áƒšáƒ˜áƒ¡ სáƒáƒ®áƒ”ლი: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -750,53 +740,53 @@ "სáƒáƒ áƒ”ზერვრáƒáƒ¡áƒšáƒ˜áƒ¡ გáƒáƒ™áƒ”თების მცდელáƒáƒ‘ისáƒáƒ¡, სáƒáƒ®áƒ”ლის გáƒáƒ“áƒáƒ áƒ¥áƒ›áƒ”ვრვერ შედგáƒ. \n" "ფáƒáƒ˜áƒšáƒ˜áƒ¡ სáƒáƒ®áƒ”ლები: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ მდგáƒáƒ›áƒáƒ áƒ”áƒáƒ‘ის მიღებáƒ: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ წáƒáƒ™áƒ˜áƒ—ხვáƒ: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ ჩáƒáƒ¬áƒ”რáƒ: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "მეხსიერებრáƒáƒ áƒáƒ სáƒáƒ™áƒ›áƒáƒ áƒ˜áƒ¡áƒ˜" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "დირექტáƒáƒ áƒ˜áƒ˜áƒ¡ შექმნáƒ: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "დირექტáƒáƒ áƒ˜áƒ˜áƒ¡ წáƒáƒ¨áƒšáƒ: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ წáƒáƒ¨áƒšáƒ: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "სიმბáƒáƒšáƒ£áƒ áƒ˜ ბმულის შექმნáƒ: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ სáƒáƒ®áƒ”ლის გáƒáƒ“áƒáƒ áƒ¥áƒ›áƒ”ვáƒ: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ áƒáƒ¡áƒšáƒ˜: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -804,7 +794,7 @@ "შეცდáƒáƒ›áƒ áƒáƒ¡áƒšáƒ˜áƒ¡ გáƒáƒ™áƒ”თების áƒáƒžáƒ”რáƒáƒªáƒ˜áƒ˜áƒ¡áƒáƒ¡: ფáƒáƒ˜áƒšáƒ˜áƒ¡ წáƒáƒ¡áƒáƒ™áƒ˜áƒ—ხáƒáƒ“ გáƒáƒ®áƒ¡áƒœáƒ ვერ შედგáƒ. ფáƒáƒ˜áƒšáƒ˜áƒ¡ " "სáƒáƒ®áƒ”ლი: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -812,23 +802,23 @@ "შეცდáƒáƒ›áƒ áƒáƒ¡áƒšáƒ˜áƒ¡ გáƒáƒ™áƒ”თების áƒáƒžáƒ”რáƒáƒªáƒ˜áƒ˜áƒ¡áƒáƒ¡: ფáƒáƒ˜áƒšáƒ˜áƒ¡ ჩáƒáƒ¡áƒáƒ¬áƒ”რáƒáƒ“ გáƒáƒ®áƒ¡áƒœáƒ ვერ შედგáƒ. ფáƒáƒ˜áƒšáƒ˜áƒ¡ " "სáƒáƒ®áƒ”ლი: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "შეცდáƒáƒ›áƒ áƒáƒ¡áƒšáƒ˜áƒ¡ გáƒáƒ™áƒ”თების áƒáƒžáƒ”რáƒáƒªáƒ˜áƒ˜áƒ¡áƒáƒ¡: წáƒáƒ™áƒ˜áƒ—ხვრვერ შედგáƒ. ფáƒáƒ˜áƒšáƒ˜áƒ¡ სáƒáƒ®áƒ”ლი: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "შეცდáƒáƒ›áƒ áƒáƒ¡áƒšáƒ˜áƒ¡ გáƒáƒ™áƒ”თების áƒáƒžáƒ”რáƒáƒªáƒ˜áƒ˜áƒ¡áƒáƒ¡: ჩáƒáƒ¬áƒ”რრვერ შედგáƒ. ფáƒáƒ˜áƒšáƒ˜áƒ¡ სáƒáƒ®áƒ”ლი: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "დირექტáƒáƒ áƒ˜áƒ˜áƒ¡ წáƒáƒ™áƒ˜áƒ—ხვáƒ:" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "დირექტáƒáƒ áƒ˜áƒ˜áƒ¡ სიáƒ: %1" @@ -1175,11 +1165,11 @@ msgid "Toggle the statusbar..." msgstr "სტáƒáƒ¢áƒ£áƒ¡áƒ˜áƒ¡ ზáƒáƒšáƒ˜áƒ¡ გáƒáƒ“áƒáƒ áƒ—ვáƒ..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "შსáƒáƒ“áƒáƒ áƒ”ბელი ფáƒáƒ˜áƒšáƒ”ბი ვერ მáƒáƒ˜áƒ«áƒ”ბნáƒ." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1281,14 +1271,14 @@ msgstr "" "+ დიდი მáƒáƒ“ლáƒáƒ‘რმáƒáƒ— ვინც გვáƒáƒ¢áƒ§áƒáƒ‘ინებს ბზიკების შესáƒáƒ®áƒ”ბ დრგვáƒáƒ¬áƒáƒ“ებს იდეებს!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "დáƒáƒ áƒ©áƒ”ნილი გáƒáƒ“áƒáƒ£áƒ­áƒ áƒ”ლი კáƒáƒœáƒ¤áƒšáƒ˜áƒ¥áƒ¢áƒ”ბის რáƒáƒáƒ“ენáƒáƒ‘áƒ: %1 (სáƒáƒ˜áƒ“áƒáƒœáƒáƒª %2 áƒáƒ áƒ˜áƒ¡ ღáƒáƒ áƒ˜)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1296,55 +1286,55 @@ "გáƒáƒ›áƒáƒœáƒáƒ¢áƒáƒœáƒ˜ ჩáƒáƒ¡áƒ¬áƒáƒ áƒ”ბულიáƒ.\n" "თუ გáƒáƒáƒ’რძელებთ ცვლილებები დáƒáƒ’ეკáƒáƒ áƒ’ებáƒáƒ—." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "ყველრშეტáƒáƒœáƒ˜áƒšáƒ˜ ბáƒáƒ˜áƒšáƒ˜áƒ¡ ბინáƒáƒ áƒ˜ ტáƒáƒšáƒ˜áƒ." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "ყველრშეტáƒáƒœáƒ˜áƒšáƒ˜ ფáƒáƒ˜áƒšáƒ˜áƒ¡ შეიცáƒáƒ•ს ერთიდáƒáƒ˜áƒ’ივე ტექსტი." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "A დრB ბინáƒáƒ áƒ£áƒšáƒáƒ“ ტáƒáƒšáƒ˜áƒ.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "A დრB áƒáƒ¥áƒ•თ ერთიდáƒáƒ˜áƒ’ივე ტექსტი. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "A დრC ბინáƒáƒ áƒ£áƒšáƒáƒ“ ტáƒáƒšáƒ˜áƒ.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "A დრC áƒáƒ¥áƒ•თ ერთიდáƒáƒ˜áƒ’ივე ტექსტი. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "B დრC ბინáƒáƒ áƒ£áƒšáƒáƒ“ ტáƒáƒšáƒ˜áƒ.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "B დრC áƒáƒ¥áƒ•თ ერთიდáƒáƒ˜áƒ’ივე ტექსტი. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "კáƒáƒœáƒ¤áƒšáƒ˜áƒ¥áƒ¢áƒ”ბის სრული რáƒáƒáƒ“ენáƒáƒ‘áƒ: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1352,7 +1342,7 @@ "\n" "áƒáƒ•ტáƒáƒ›áƒáƒ¢áƒ£áƒ áƒáƒ“ გáƒáƒ“áƒáƒ­áƒ áƒ˜áƒšáƒ˜ კáƒáƒœáƒ¤áƒšáƒ˜áƒ¥áƒ¢áƒ”ბის რáƒáƒáƒ“ენáƒáƒ‘áƒ: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1360,31 +1350,31 @@ "\n" "გáƒáƒ“áƒáƒ£áƒ­áƒ áƒ”ლი კáƒáƒœáƒ¤áƒšáƒ˜áƒ¥áƒ¢áƒ”ბის რáƒáƒáƒ“ენáƒáƒ‘áƒ: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "კáƒáƒœáƒ¤áƒšáƒ˜áƒ¥áƒ¢áƒ”ბი" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "გáƒáƒ›áƒáƒœáƒáƒ¢áƒáƒœáƒ˜" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[ჩáƒáƒ¡áƒ¬áƒáƒ áƒ”ბულიáƒ]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1392,11 +1382,11 @@ "ყველრკáƒáƒœáƒ¤áƒšáƒ˜áƒ¥áƒ¢áƒ˜ ჯერ áƒáƒ áƒáƒ გáƒáƒ“áƒáƒ­áƒ áƒ˜áƒšáƒ˜.\n" "ფáƒáƒ˜áƒšáƒ˜ áƒáƒ áƒáƒ შენáƒáƒ®áƒ£áƒšáƒ˜.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "დáƒáƒ áƒ©áƒ”ნილი კáƒáƒœáƒ¤áƒšáƒ˜áƒ¥áƒ¢áƒ”ბი" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1406,11 +1396,11 @@ "\n" "სáƒáƒ áƒ”ზერვრáƒáƒ¡áƒšáƒ˜áƒ¡ შექმნრვერ შედგáƒ. ფáƒáƒ˜áƒšáƒ˜ áƒáƒ áƒáƒ შენáƒáƒ®áƒ£áƒšáƒ˜." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ შენáƒáƒ®áƒ•ის შეცდáƒáƒ›áƒ" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "ჩáƒáƒ¬áƒ”რისáƒáƒ¡ შეცდáƒáƒ›áƒ." @@ -2009,11 +1999,11 @@ msgid "Regional Settings" msgstr "რეგიáƒáƒœáƒáƒšáƒ£áƒ áƒ˜ პáƒáƒ áƒáƒ›áƒ”ტრები" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "ენრ(გáƒáƒ“áƒáƒ¢áƒ•ირთვáƒáƒ სáƒáƒ­áƒ˜áƒ áƒ)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2021,11 +2011,11 @@ "GUI-სტრიქáƒáƒœáƒ˜áƒ¡áƒ—ვის ენის შეცვლრáƒáƒœ \"áƒáƒ•ტáƒ\".\n" "ენის ცვლილებრრáƒáƒ› გáƒáƒáƒ¥áƒ¢áƒ˜áƒ£áƒ áƒ“ეს დáƒáƒ®áƒ£áƒ áƒ”თ დრგáƒáƒ“áƒáƒ¢áƒ•ირთეთ KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "ყველáƒáƒ¡áƒ—ვის იგივე კáƒáƒ“ირების გáƒáƒ›áƒáƒ§áƒ”ნებáƒ:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2034,35 +2024,35 @@ "შეცვლით.\n" "გáƒáƒ›áƒáƒ áƒ—ეთ ეს თუ გáƒáƒœáƒ¡áƒ®áƒ•áƒáƒ•ებული ინდივიდუáƒáƒšáƒ£áƒ áƒ£áƒ˜ პáƒáƒ áƒáƒ›áƒ”ტრებირსáƒáƒ­áƒ˜áƒ áƒ." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "შენიშვნáƒ: ლáƒáƒ™áƒáƒšáƒ£áƒ áƒ˜ კáƒáƒ“ირებრáƒáƒ áƒ˜áƒ¡" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ კáƒáƒ“ირებრA-თვის:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ კáƒáƒ“ირებრB-თვის:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ კáƒáƒ“ირებრC-თვის:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ კáƒáƒ“ირებრგáƒáƒ›áƒáƒœáƒáƒ¢áƒáƒœáƒ˜áƒ¡ შერწყმისრდრშენáƒáƒ®áƒ•ისთვის:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "ფáƒáƒ˜áƒšáƒ˜áƒ¡ კáƒáƒ“ირებრ-პრეპრáƒáƒªáƒ”სáƒáƒ áƒ˜áƒ¡ ფáƒáƒ˜áƒšáƒ”ბისთვის:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "მáƒáƒ áƒ¯áƒ•ნიდáƒáƒœ მáƒáƒ áƒªáƒ®áƒœáƒ˜áƒ• ენáƒ" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2070,21 +2060,21 @@ "ზáƒáƒ’ი ენრმáƒáƒ áƒ¯áƒ•ნიდáƒáƒœ მáƒáƒ áƒªáƒ®áƒœáƒ˜áƒ• იკითხებáƒ.\n" "ეს პáƒáƒ áƒáƒ›áƒ”ტრი შეცვლის ხედს დრრედáƒáƒ¥áƒ¢áƒáƒ áƒ¡." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "áƒáƒžáƒ”რáƒáƒªáƒ˜áƒ" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "რეგიáƒáƒœáƒáƒšáƒ£áƒ áƒ˜ პáƒáƒ áƒáƒ›áƒ”ტრები" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2092,7 +2082,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2108,19 +2098,19 @@ "\n" "გსურთ გáƒáƒáƒ’რძელáƒáƒ— თუ სხვრშრიფტს áƒáƒ˜áƒ áƒ©áƒ”ვთ." -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "შეუთáƒáƒ•სებელი შრიფტი" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "სáƒáƒ™áƒ£áƒ—áƒáƒ áƒ˜ თáƒáƒ•ის იმედáƒáƒ— გáƒáƒ’რძელებáƒ" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "სხვრშრიფტის áƒáƒ›áƒáƒ áƒ©áƒ”ვáƒ" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "ეს ყველრპáƒáƒ áƒáƒ›áƒ”ტრს სáƒáƒ¬áƒ§áƒ˜áƒ¡ მდგáƒáƒ›áƒáƒ áƒ”áƒáƒ‘áƒáƒ–ე áƒáƒ‘რუნებს. áƒáƒ áƒ მხáƒáƒšáƒáƒ“ მიმდინáƒáƒ áƒ” თემისáƒáƒ¡." @@ -2262,11 +2252,11 @@ msgid "Search Complete" msgstr "ძიებრდáƒáƒ¡áƒ áƒ£áƒšáƒ“áƒ" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "დირექტáƒáƒ áƒ˜áƒ˜áƒ¡ შექმნისáƒáƒ¡ შეცდáƒáƒ›áƒ." @@ -2453,6 +2443,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "დირექტáƒáƒ áƒ˜áƒáƒ—რშერწყმáƒ" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "დირექტáƒáƒ áƒ˜áƒáƒ—რშერწყმáƒ" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "დირექტáƒáƒ áƒ˜áƒ”ბის სინქრáƒáƒœáƒ˜áƒ–áƒáƒªáƒ˜áƒ" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/lt.po --- a/kdiff3/po/lt.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/lt.po Sat Nov 04 00:05:00 2006 +0000 @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: ziogelis 77\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-02-23 01:27+0100\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -52,13 +52,13 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "" @@ -426,7 +426,7 @@ msgid "Changing All Merge Operations" msgstr "" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&TÄ™sti" @@ -788,14 +788,6 @@ msgid "Unfold All Subdirs" msgstr "" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "" @@ -869,91 +861,91 @@ msgid "Merge to A && B" msgstr "" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "" @@ -1329,11 +1321,11 @@ msgid "Toggle the statusbar..." msgstr "Perjungti bÅ«senos juostÄ…..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "" @@ -1428,89 +1420,89 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 #, fuzzy msgid "Output" msgstr "" @@ -1519,32 +1511,32 @@ "#-#-#-#-# kbabel.po (kbabel) #-#-#-#-#\n" "IÅ¡vestis" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "" @@ -2115,74 +2107,74 @@ msgid "Regional Settings" msgstr "" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Operacija" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2190,7 +2182,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2200,19 +2192,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" @@ -2341,11 +2333,11 @@ msgid "Search Complete" msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/nb.po --- a/kdiff3/po/nb.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/nb.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,40 +1,39 @@ -# translation of kdiff3.po to -# Copyright (C) 2003 Free Software Foundation, Inc. +# translation of kdiff3.po to Norwegian BokmÃ¥l +# Copyright (C) 2003, 2006 Free Software Foundation, Inc. # Knut Yrvin , 2003. +# Bjørn Steensrud , 2006. # msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" -"PO-Revision-Date: 2003-10-30 11:10+0100\n" -"Last-Translator: Knut Yrvin \n" -"Language-Team: \n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-06-10 22:03+0200\n" +"Last-Translator: Bjørn Steensrud \n" +"Language-Team: Norwegian BokmÃ¥l \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.0.2\n" +"X-Generator: KBabel 1.10\n" #: _translatorinfo.cpp:1 -#, fuzzy msgid "" "_: NAME OF TRANSLATORS\n" "Your names" -msgstr "Knut Yrvin" +msgstr "Bjørn Steensrud" #: _translatorinfo.cpp:3 -#, fuzzy msgid "" "_: EMAIL OF TRANSLATORS\n" "Your emails" -msgstr "knuty@skolelinux.no" +msgstr "bjornst@powertech.no" #: diff.cpp:245 msgid "Writing clipboard data to temp file failed." -msgstr "" +msgstr "Klarte ikke Ã¥ skrive fra utklippstavla til midlertidig fil." #: diff.cpp:249 msgid "From Clipboard" -msgstr "" +msgstr "Fra utklippstavla" #: diff.cpp:451 msgid "" @@ -44,6 +43,11 @@ "\n" "The preprocessing command will be disabled now." msgstr "" +"Forarbeidet muligens mislykket. Se denne kommandoen:\n" +"\n" +" %1\n" +"\n" +"Kommandoen for forarbeide blir nÃ¥ slÃ¥tt av." #: diff.cpp:486 msgid "" @@ -53,124 +57,134 @@ "\n" "The line-matching-preprocessing command will be disabled now." msgstr "" - -#: diff.cpp:1617 diff.cpp:1631 +"Forarbeidet med Ã¥ samordne linjer muligens mislykket. Se denne kommandoen:\n" +"\n" +" %1\n" +"\n" +"Forarbeide-kommandoen for linjesamordning blir nÃ¥ slÃ¥tt av." + +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" - -#: diff.cpp:1619 diff.cpp:1633 +"Datatap-feil:\n" +"Hvis det kan gjenskapes, vennligst kontakt forfatteren.\n" + +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" -msgstr "" +msgstr "Alvorlig intern feil" #: difftextwindow.cpp:1637 kdiff3.cpp:743 msgid "Top line" -msgstr "" +msgstr "Øverste linje" #: difftextwindow.cpp:1647 msgid "End" -msgstr "" +msgstr "Slutt" #: directorymergewindow.cpp:142 msgid "Mix of links and normal files." -msgstr "" +msgstr "Blanding av lenker og normale filer." #: directorymergewindow.cpp:149 msgid "Link: " -msgstr "" +msgstr "Lenke: " #: directorymergewindow.cpp:157 msgid "Size. " -msgstr "" +msgstr "Størrelse: " #: directorymergewindow.cpp:170 msgid "Date & Size: " -msgstr "" +msgstr "Dato og størrelse: " #: directorymergewindow.cpp:179 directorymergewindow.cpp:185 msgid "Creating temp copy of %1 failed." -msgstr "" +msgstr "Klarte ikke opprette midlertidig kopi av %1." #: directorymergewindow.cpp:196 directorymergewindow.cpp:204 msgid "Opening %1 failed." -msgstr "" +msgstr "Klarte ikke Ã¥pne %1." #: directorymergewindow.cpp:208 msgid "Comparing file..." -msgstr "" +msgstr "Sammenlikner fil ..." #: directorymergewindow.cpp:218 directorymergewindow.cpp:224 #, c-format msgid "Error reading from %1" -msgstr "" +msgstr "Feil ved lesing fra %1" #: directorymergewindow.cpp:282 -#, fuzzy msgid "Name" msgstr "Navn" #: directorymergewindow.cpp:286 msgid "Operation" -msgstr "" +msgstr "Handling" #: directorymergewindow.cpp:287 -#, fuzzy msgid "Status" msgstr "Status" #: directorymergewindow.cpp:288 msgid "Unsolved" -msgstr "" +msgstr "Uløst" #: directorymergewindow.cpp:289 msgid "Solved" -msgstr "" +msgstr "Løst" #: directorymergewindow.cpp:290 msgid "Nonwhite" -msgstr "" +msgstr "Ikkehvitt" #: directorymergewindow.cpp:291 msgid "White" -msgstr "" +msgstr "Hvitt" #: directorymergewindow.cpp:319 msgid "" "You are currently doing a directory merge. Are you sure, you want to abort the " "merge and rescan the directory?" msgstr "" +"NÃ¥ utfører du en mappefletting. Er du sikker pÃ¥ at du vil avbryte flettingen og " +"lese gjennom mappa pÃ¥ nytt?" #: directorymergewindow.cpp:320 directorymergewindow.cpp:2864 msgid "Rescan" -msgstr "" +msgstr "Les pÃ¥ nytt" #: directorymergewindow.cpp:320 kdiff3.cpp:594 pdiff.cpp:965 msgid "Continue Merging" -msgstr "" +msgstr "Fortsett fletting" #: directorymergewindow.cpp:462 msgid "Opening of directories failed:" -msgstr "" +msgstr "Klarte ikke Ã¥pne mapper:" #: directorymergewindow.cpp:465 msgid "" "Dir A \"%1\" does not exist or is not a directory.\n" msgstr "" +"Mappe A «%1» finnes ikke eller er ikke en mappe.\n" #: directorymergewindow.cpp:468 msgid "" "Dir B \"%1\" does not exist or is not a directory.\n" msgstr "" +"Mappe B «%1» finnes ikke eller er ikke en mappe.\n" #: directorymergewindow.cpp:471 msgid "" "Dir C \"%1\" does not exist or is not a directory.\n" msgstr "" +"Mappe C «%1» finnes ikke eller er ikke en mappe.\n" #: directorymergewindow.cpp:473 msgid "Directory Open Error" -msgstr "" +msgstr "Feil ved Ã¥pning av mappe" #: directorymergewindow.cpp:481 msgid "" @@ -178,145 +192,145 @@ "are merged.\n" "Check again before continuing." msgstr "" +"MÃ¥lmappa mÃ¥ være en annen enn A eller B nÃ¥r tre mapper flettes.\n" +"Kontroller igjen før du fortsetter." #: directorymergewindow.cpp:483 msgid "Parameter Warning" -msgstr "" +msgstr "Parameter-advarsel" #: directorymergewindow.cpp:488 msgid "Scanning directories..." -msgstr "" +msgstr "Leser mapper ..." #: directorymergewindow.cpp:537 msgid "Reading Directory A" -msgstr "" +msgstr "Leser mappe A" #: directorymergewindow.cpp:559 msgid "Reading Directory B" -msgstr "" +msgstr "Leser mappe B" #: directorymergewindow.cpp:581 msgid "Reading Directory C" -msgstr "" +msgstr "Leser mappe C" #: directorymergewindow.cpp:607 msgid "Some subdirectories were not readable in" -msgstr "" +msgstr "Noen undermapper var ikke lesbare i" #: directorymergewindow.cpp:612 msgid "Check the permissions of the subdirectories." -msgstr "" +msgstr "Kontroller rettigheter pÃ¥ undermappene." #: directorymergewindow.cpp:646 kdiff3.cpp:547 kdiff3.cpp:627 kdiff3.cpp:651 #: kdiff3.cpp:924 kdiff3.cpp:945 pdiff.cpp:1045 pdiff.cpp:1117 pdiff.cpp:1155 #: pdiff.cpp:1171 pdiff.cpp:1201 pdiff.cpp:1212 -#, fuzzy msgid "Ready." msgstr "Klar." #: directorymergewindow.cpp:660 msgid "Directory Comparison Status" -msgstr "" +msgstr "Status for mappesammenlikning" #: directorymergewindow.cpp:661 msgid "Number of subdirectories:" -msgstr "" +msgstr "Antall undermapper:" #: directorymergewindow.cpp:662 msgid "Number of equal files:" -msgstr "" +msgstr "Antall like filer:" #: directorymergewindow.cpp:663 msgid "Number of different files:" -msgstr "" +msgstr "Antall forskjellige filer:" #: directorymergewindow.cpp:666 msgid "Number of manual merges:" -msgstr "" +msgstr "Antall manuelle flettinger:" #: directorymergewindow.cpp:802 msgid "This affects all merge operations." -msgstr "" +msgstr "Dette pÃ¥virker alle flettehandlinger." #: directorymergewindow.cpp:803 msgid "Changing All Merge Operations" -msgstr "" - -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +msgstr "Endre alle flette-handlinger" + +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" -msgstr "" +msgstr "F&ortsett" #: directorymergewindow.cpp:1169 msgid "Processing " -msgstr "" +msgstr "Arbeider " #: directorymergewindow.cpp:1644 directorymergewindow.cpp:1650 msgid "To do." -msgstr "" +msgstr "GjenstÃ¥r." #: directorymergewindow.cpp:1752 directorymergewindow.cpp:2895 msgid "Copy A to B" -msgstr "" +msgstr "Kopier A til B" #: directorymergewindow.cpp:1753 directorymergewindow.cpp:2896 msgid "Copy B to A" -msgstr "" +msgstr "Kopier B til A" #: directorymergewindow.cpp:1754 directorymergewindow.cpp:2897 msgid "Delete A" -msgstr "" +msgstr "Slett A" #: directorymergewindow.cpp:1755 directorymergewindow.cpp:2898 msgid "Delete B" -msgstr "" +msgstr "Slett B" #: directorymergewindow.cpp:1756 msgid "Delete A & B" -msgstr "" +msgstr "Slett A & B" #: directorymergewindow.cpp:1757 directorymergewindow.cpp:2900 msgid "Merge to A" -msgstr "" +msgstr "Flett til A" #: directorymergewindow.cpp:1758 directorymergewindow.cpp:2901 msgid "Merge to B" -msgstr "" +msgstr "Flett til B" #: directorymergewindow.cpp:1759 msgid "Merge to A & B" -msgstr "" +msgstr "Flett til A & B" #: directorymergewindow.cpp:1763 directorymergewindow.cpp:2892 msgid "Delete (if exists)" -msgstr "" +msgstr "Slett (hvis det finnes)" #: directorymergewindow.cpp:1764 directorymergewindow.cpp:1765 #: directorymergewindow.cpp:2891 smalldialogs.cpp:102 -#, fuzzy msgid "Merge" -msgstr "SlÃ¥ sammen" +msgstr "Flett sammen" #: directorymergewindow.cpp:1764 directorymergewindow.cpp:1765 msgid "Merge (manual)" -msgstr "" +msgstr "Flett (manuelt)" #: directorymergewindow.cpp:1766 msgid "Error: Conflicting File Types" -msgstr "" +msgstr "Feil: Konflikt mellom filtyper" #: directorymergewindow.cpp:1767 msgid "Error: Dates are equal but files are not." -msgstr "" +msgstr "Feil: Datoene er like, men ikke filene." #: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 #: directorymergewindow.cpp:1845 msgid "This operation is currently not possible." -msgstr "" +msgstr "Denne handlingen er ikke mulig nÃ¥." #: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 #: directorymergewindow.cpp:1845 directorymergewindow.cpp:2102 msgid "Operation Not Possible" -msgstr "" +msgstr "Handling ikke mulig" #: directorymergewindow.cpp:1884 msgid "" @@ -326,40 +340,46 @@ "\n" "If you know how to reproduce this, please contact the program author." msgstr "" +"Dette skulle aldri skje: \n" +"\n" +"mergeResultSaved: m_pMFI=0\n" +"\n" +"Hvis du vet hvordan dette kan gjenskapes, ta kontakt med programforfatteren." #: directorymergewindow.cpp:1884 msgid "Program Error" -msgstr "" +msgstr "Programfeil" #: directorymergewindow.cpp:1895 msgid "" "An error occurred while copying.\n" msgstr "" +"Det oppsto en feil under kopiering.\n" #: directorymergewindow.cpp:1896 directorymergewindow.cpp:2302 msgid "Merge Error" -msgstr "" +msgstr "Flettefeil" #: directorymergewindow.cpp:1901 directorymergewindow.cpp:2307 msgid "Error." -msgstr "" +msgstr "Feil." #: directorymergewindow.cpp:1906 directorymergewindow.cpp:2198 #: directorymergewindow.cpp:2238 msgid "Done." -msgstr "" +msgstr "Ferdig." #: directorymergewindow.cpp:1929 msgid "Not saved." -msgstr "" +msgstr "Ikke lagret." #: directorymergewindow.cpp:1964 msgid "Unknown merge operation. (This must never happen!)" -msgstr "" +msgstr "Ukjent flettehandling. (Dette mÃ¥ aldri skje!)" #: directorymergewindow.cpp:1996 msgid "Unknown merge operation." -msgstr "" +msgstr "Ukjent flettehandling." #: directorymergewindow.cpp:2011 msgid "" @@ -372,36 +392,46 @@ "Be aware that this program still has beta status and there is NO WARRANTY " "whatsoever! Make backups of your vital data!" msgstr "" +"Flettingen skal til Ã¥ starte.\n" +"\n" +"Velg «Gjør det» hvis du har lest instruksjonene og vet hva du gjør.\n" +"Velg «Simuler det» for Ã¥ se hva som vil skje.\n" +"\n" +"Vær oppmerksom pÃ¥ at dette programmet er i beta-status og det er OVERHODET " +"INGEN GARANTI! Ta sikkerhetskopi av vitale data!" #: directorymergewindow.cpp:2016 msgid "Starting Merge" -msgstr "" +msgstr "Starter fletting" #: directorymergewindow.cpp:2016 msgid "Do It" -msgstr "" +msgstr "Gjør det" #: directorymergewindow.cpp:2016 msgid "Simulate It" -msgstr "" +msgstr "Simuler det" #: directorymergewindow.cpp:2042 msgid "" "The highlighted item has a different type in the different directories. Select " "what to do." msgstr "" +"Det markerte elementet har forskjellig type i de forskjellige mappene. Velg hva " +"som skal gjøres." #: directorymergewindow.cpp:2051 msgid "" "The modification dates of the file are equal but the files are not. Select what " "to do." msgstr "" +"Filene er ulike men har samme dato for siste endring. Velg hva som skal gjøres." #: directorymergewindow.cpp:2102 msgid "" "This operation is currently not possible because directory merge is currently " "running." -msgstr "" +msgstr "Denne handlingen er ikke mulig nÃ¥ fordi en mappefletting pÃ¥gÃ¥r." #: directorymergewindow.cpp:2162 msgid "" @@ -409,715 +439,717 @@ "Do you want to continue with the item that caused the error or do you want to " "skip this item?" msgstr "" +"Det var en feil i siste steg.\n" +"Vil du fortsette med elementet som ga feil, eller hoppe over det?" #: directorymergewindow.cpp:2164 msgid "Continue merge after an error" -msgstr "" +msgstr "Fortsett fletting etter feil" #: directorymergewindow.cpp:2164 msgid "Continue With Last Item" -msgstr "" +msgstr "Fortsett med siste element" #: directorymergewindow.cpp:2164 msgid "Skip Item" -msgstr "" +msgstr "Hopp over element" #: directorymergewindow.cpp:2198 msgid "Skipped." -msgstr "" +msgstr "Hoppet over." #: directorymergewindow.cpp:2205 directorymergewindow.cpp:2431 msgid "In progress..." -msgstr "" +msgstr "PÃ¥gÃ¥r ..." #: directorymergewindow.cpp:2253 msgid "Merge operation complete." -msgstr "" +msgstr "Flettehandling fullført." #: directorymergewindow.cpp:2253 directorymergewindow.cpp:2256 msgid "Merge Complete" -msgstr "" +msgstr "Fletting fullført" #: directorymergewindow.cpp:2265 msgid "" "Simulated merge complete: Check if you agree with the proposed operations." msgstr "" +"Simulert fletting fullført. Se etter om du er enig i de foreslÃ¥tte handlingene." #: directorymergewindow.cpp:2301 msgid "" "An error occurred. Press OK to see detailed information.\n" msgstr "" +"Det oppsto en feil. Trykk OK for Ã¥ se detaljerte opplysninger.\n" #: directorymergewindow.cpp:2344 msgid "Error: While deleting %1: Creating backup failed." -msgstr "" +msgstr "Feil: Under sletting av %1: oppretting av sikkerhetskopi mislyktes." #: directorymergewindow.cpp:2351 msgid "delete directory recursively( %1 )" -msgstr "" +msgstr "slett mappe rekursivt( %1 )" #: directorymergewindow.cpp:2353 msgid "delete( %1 )" -msgstr "" +msgstr "slett ( %1 )" #: directorymergewindow.cpp:2368 msgid "Error: delete dir operation failed while trying to read the directory." -msgstr "" +msgstr "Feil: mappesletting mislyktes under forsøk pÃ¥ Ã¥ lese mappa." #: directorymergewindow.cpp:2387 msgid "Error: rmdir( %1 ) operation failed." -msgstr "" +msgstr "Feil: rmdir( %1 ) mislyktes." #: directorymergewindow.cpp:2397 msgid "Error: delete operation failed." -msgstr "" +msgstr "Feil: sletting mislyktes." #: directorymergewindow.cpp:2423 msgid "manual merge( %1, %2, %3 -> %4)" -msgstr "" +msgstr "manuell fletting( %1, %2, %3 -> %4)" #: directorymergewindow.cpp:2426 msgid "" " Note: After a manual merge the user should continue by pressing F7." msgstr "" +" Merk: Etter en manuell fletting bør brukeren fortsette ved Ã¥ trykke F7." #: directorymergewindow.cpp:2449 msgid "Error: copy( %1 -> %2 ) failed.Deleting existing destination failed." msgstr "" +"Feil: kopiering (%1 -> %2) mislyktes. Eksisterende mÃ¥l kunne ikke slettes." #: directorymergewindow.cpp:2459 msgid "copyLink( %1 -> %2 )" -msgstr "" +msgstr "copyLink( %1 -> %2 )" #: directorymergewindow.cpp:2470 msgid "Error: copyLink failed: Remote links are not yet supported." -msgstr "" +msgstr "Feil: copyLink mislyktes. Det er ikke støtte for nettverkslenker ennÃ¥." #: directorymergewindow.cpp:2476 msgid "Error: copyLink failed." -msgstr "" +msgstr "Feil: copyLink mislyktes." #: directorymergewindow.cpp:2496 msgid "copy( %1 -> %2 )" -msgstr "" +msgstr "kopier(%1 -> %2 )" #: directorymergewindow.cpp:2522 msgid "Error during rename( %1 -> %2 ): Cannot delete existing destination." -msgstr "" +msgstr "Feil under navneendring( %1 -> %2 ): Kan ikke slette eksisterende mÃ¥l." #: directorymergewindow.cpp:2528 msgid "rename( %1 -> %2 )" -msgstr "" +msgstr "endre navn ( %1 -> %2 )" #: directorymergewindow.cpp:2537 msgid "Error: Rename failed." -msgstr "" +msgstr "Feil: navneendring mislyktes." #: directorymergewindow.cpp:2555 msgid "Error during makeDir of %1. Cannot delete existing file." -msgstr "" +msgstr "Feil ved oppretting av mappe %1. Kan ikke slette eksisterende fil." #: directorymergewindow.cpp:2571 msgid "makeDir( %1 )" -msgstr "" +msgstr "Lag mappe( %1 )" #: directorymergewindow.cpp:2581 msgid "Error while creating directory." -msgstr "" +msgstr "Feil under oppretting av mappe." #: directorymergewindow.cpp:2604 directorymergewindow.cpp:2721 msgid "Dest" -msgstr "" +msgstr "MÃ¥l" #: directorymergewindow.cpp:2608 directorymergewindow.cpp:2646 msgid "Dir" -msgstr "" +msgstr "Mappe" #: directorymergewindow.cpp:2609 -#, fuzzy msgid "Type" msgstr "Type" #: directorymergewindow.cpp:2610 -#, fuzzy msgid "Size" msgstr "Størrelse" #: directorymergewindow.cpp:2611 msgid "Attr" -msgstr "" +msgstr "Attr" #: directorymergewindow.cpp:2612 msgid "Last Modification" -msgstr "" +msgstr "Siste endring" #: directorymergewindow.cpp:2613 msgid "Link-Destination" -msgstr "" +msgstr "LenkemÃ¥l" #: directorymergewindow.cpp:2663 msgid "not available" -msgstr "" +msgstr "ikke tilgjengelig" #: directorymergewindow.cpp:2683 msgid "A (Dest): " -msgstr "" +msgstr "A (mÃ¥l): " #: directorymergewindow.cpp:2686 msgid "A (Base): " -msgstr "" +msgstr "A (basis): " #: directorymergewindow.cpp:2692 msgid "B (Dest): " -msgstr "" +msgstr "B (mÃ¥l): " #: directorymergewindow.cpp:2700 msgid "C (Dest): " -msgstr "" +msgstr "C (mÃ¥l) :" #: directorymergewindow.cpp:2706 msgid "Dest: " -msgstr "" +msgstr "MÃ¥l: " #: directorymergewindow.cpp:2771 msgid "Save Directory Merge State As..." -msgstr "" +msgstr "Lagre status for mappefletting som ..." #: directorymergewindow.cpp:2858 msgid "Start/Continue Directory Merge" -msgstr "" +msgstr "Start/fortsett mappefletting" #: directorymergewindow.cpp:2859 msgid "Run Operation for Current Item" -msgstr "" +msgstr "Kjør handling for gjeldende element" #: directorymergewindow.cpp:2860 msgid "Compare Selected File" -msgstr "" +msgstr "Sammenlikne valgt fil" #: directorymergewindow.cpp:2861 msgid "Merge Current File" -msgstr "" +msgstr "Flett gjeldende fil" #: directorymergewindow.cpp:2862 msgid "Fold All Subdirs" -msgstr "" +msgstr "Brett sammen alle undermapper" #: directorymergewindow.cpp:2863 msgid "Unfold All Subdirs" -msgstr "" - -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "" - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "" +msgstr "Fold ut alle undermapper" #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" -msgstr "" +msgstr "Velg A for alle elementer" #: directorymergewindow.cpp:2868 msgid "Choose B for All Items" -msgstr "" +msgstr "Velg B for alle elementer" #: directorymergewindow.cpp:2869 msgid "Choose C for All Items" -msgstr "" +msgstr "Velg C for alle elementer" #: directorymergewindow.cpp:2870 msgid "Auto-Choose Operation for All Items" -msgstr "" +msgstr "Auto-velg handling for alle elementer" #: directorymergewindow.cpp:2871 msgid "No Operation for All Items" -msgstr "" +msgstr "Ingen handling for alle elementer" #: directorymergewindow.cpp:2876 msgid "Show Identical Files" -msgstr "" +msgstr "Vis identiske filer" #: directorymergewindow.cpp:2877 msgid "Show Different Files" -msgstr "" +msgstr "Vis forskjellige filer" #: directorymergewindow.cpp:2878 msgid "Show Files only in A" -msgstr "" +msgstr "Vis filer bare i A" #: directorymergewindow.cpp:2879 msgid "Show Files only in B" -msgstr "" +msgstr "Vis filer bare i B" #: directorymergewindow.cpp:2880 msgid "Show Files only in C" -msgstr "" +msgstr "Vis filer bare i C" #: directorymergewindow.cpp:2884 msgid "Compare Explicitly Selected Files" -msgstr "" +msgstr "Sammenlikne uttrykkelig valgte filer" #: directorymergewindow.cpp:2885 msgid "Merge Explicitly Selected Files" -msgstr "" +msgstr "Flett uttrykkelig valgte filer" #: directorymergewindow.cpp:2887 directorymergewindow.cpp:2894 msgid "Do Nothing" -msgstr "" +msgstr "Ikke gjør noe" #: directorymergewindow.cpp:2888 msgid "A" -msgstr "" +msgstr "A" #: directorymergewindow.cpp:2889 msgid "B" -msgstr "" +msgstr "B" #: directorymergewindow.cpp:2890 msgid "C" -msgstr "" +msgstr "C" #: directorymergewindow.cpp:2899 msgid "Delete A && B" -msgstr "" +msgstr "Slett A && B" #: directorymergewindow.cpp:2902 msgid "Merge to A && B" -msgstr "" - -#: fileaccess.cpp:563 +msgstr "Flett til A && B" + +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" - -#: fileaccess.cpp:570 +"Under forsøk pÃ¥ Ã¥ lage sikkerhetskopi lyktes det ikke Ã¥ slette \n" +"en tidligere kopi. Filnavn: " + +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" - -#: fileaccess.cpp:592 +"Under forsøk pÃ¥ Ã¥ lage sikkerhetskopi lyktes det ikke Ã¥ endre navn.\n" +"Filnavn: " + +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" -msgstr "" - -#: fileaccess.cpp:635 +msgstr "Henter filstatus: %1" + +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" -msgstr "" - -#: fileaccess.cpp:671 +msgstr "Leser fil: %1" + +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" -msgstr "" - -#: fileaccess.cpp:699 +msgstr "Skriver fil: %1" + +#: fileaccess.cpp:717 msgid "Out of memory" -msgstr "" - -#: fileaccess.cpp:734 +msgstr "Slapp opp for minne" + +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" -msgstr "" - -#: fileaccess.cpp:754 +msgstr "Lager mappe: %1" + +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" -msgstr "" - -#: fileaccess.cpp:769 +msgstr "Fjerner mappe: %1" + +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" -msgstr "" - -#: fileaccess.cpp:785 +msgstr "Fjerner fil: %1" + +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" -msgstr "" - -#: fileaccess.cpp:811 +msgstr "Oppretter symbolsk lenke: %1 -> %2" + +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" -msgstr "" - -#: fileaccess.cpp:847 +msgstr "Endrer navn pÃ¥ fil: %1 -> %2" + +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" -msgstr "" - -#: fileaccess.cpp:861 +msgstr "Kopierer fil: %1 -> %2" + +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" -msgstr "" - -#: fileaccess.cpp:867 +msgstr "Feil under filkopiering: Klarte ikke Ã¥pne fil for lesing. Filnavn: %1" + +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" - -#: fileaccess.cpp:882 +"Feil under filkopiering: Klarte ikke Ã¥pne fil for skriving. Filnavn: %1" + +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" -msgstr "" - -#: fileaccess.cpp:891 +msgstr "Feil under filkopiering: Lesing mislyktes. Filnavn: %1" + +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" -msgstr "" - -#: fileaccess.cpp:1187 +msgstr "Feil under filkopiering: Skriving mislyktes. Filnavn: %1" + +#: fileaccess.cpp:1205 msgid "Reading directory: " -msgstr "" - -#: fileaccess.cpp:1316 +msgstr "Leser mappe: " + +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" -msgstr "" +msgstr "Lister mappe: %1" #: kdiff3.cpp:142 msgid "Current Configuration:" -msgstr "" +msgstr "Gjeldende oppsett:" #: kdiff3.cpp:147 msgid "Config Option Error:" -msgstr "" +msgstr "Feil i oppsett:" #: kdiff3.cpp:187 msgid "Option --auto used, but no output file specified." -msgstr "" +msgstr "--auto brukt, men ingen utdatafil er oppgitt." #: kdiff3.cpp:318 msgid "Option --auto ignored for directory comparison." -msgstr "" +msgstr "--auto ignorert for mappesammelikning." #: kdiff3.cpp:354 msgid "Saving failed." -msgstr "" +msgstr "Lagring mislyktes." #: kdiff3.cpp:381 pdiff.cpp:1027 pdiff.cpp:1098 msgid "Opening of these files failed:" -msgstr "" +msgstr "Klarte ikke Ã¥pne disse filene:" #: kdiff3.cpp:390 msgid "File Open Error" -msgstr "" +msgstr "Feil ved Ã¥pning av fil" #: kdiff3.cpp:413 msgid "Opens documents for comparison..." -msgstr "" +msgstr "Ã…pner dokumentere for sammenlikning ..." #: kdiff3.cpp:418 msgid "Saves the merge result. All conflicts must be solved!" -msgstr "" +msgstr "Lagrer fletteresultatet. Alle konflikter mÃ¥ løses!" #: kdiff3.cpp:420 msgid "Saves the current document as..." -msgstr "" +msgstr "Lagrer gjeldende dokument som ..." #: kdiff3.cpp:422 msgid "Print the differences" -msgstr "" +msgstr "Skriv ut forskjellene" #: kdiff3.cpp:424 msgid "Quits the application" -msgstr "" +msgstr "Avslutter programmet" #: kdiff3.cpp:426 msgid "Cuts the selected section and puts it to the clipboard" -msgstr "" +msgstr "Klipper ut det markerte og legger det pÃ¥ utklippstavla" #: kdiff3.cpp:428 msgid "Copies the selected section to the clipboard" -msgstr "" +msgstr "Kopierer det markerte til utklippstavla" #: kdiff3.cpp:430 msgid "Pastes the clipboard contents to actual position" -msgstr "" +msgstr "Limer innholdet inn der markøren stÃ¥r" #: kdiff3.cpp:432 msgid "Select everything in current window" -msgstr "" +msgstr "Velg alt i gjeldende vindu" #: kdiff3.cpp:434 msgid "Search for a string" -msgstr "" +msgstr "Søk etter en streng" #: kdiff3.cpp:436 msgid "Search again for the string" -msgstr "" +msgstr "Søk igjen etter strengen" #: kdiff3.cpp:438 msgid "Enables/disables the toolbar" -msgstr "" +msgstr "SlÃ¥r verktøylinja av/pÃ¥" #: kdiff3.cpp:440 msgid "Enables/disables the statusbar" -msgstr "" +msgstr "SlÃ¥r statuslinja av/pÃ¥" #: kdiff3.cpp:444 msgid "Configure KDiff3..." -msgstr "" +msgstr "Sett opp KDiff3 ..." #: kdiff3.cpp:465 msgid "Go to Current Delta" -msgstr "" +msgstr "GÃ¥ til gjeldende Delta" #: kdiff3.cpp:466 msgid "Go to First Delta" -msgstr "" +msgstr "GÃ¥ til første Delta" #: kdiff3.cpp:467 msgid "Go to Last Delta" -msgstr "" +msgstr "GÃ¥ til siste Delta" #: kdiff3.cpp:468 msgid "(Skips white space differences when \"Show White Space\" is disabled.)" -msgstr "" +msgstr "(Hopper over forskjeller i tomrom nÃ¥r «Vis tomrom» er slÃ¥tt av.)" #: kdiff3.cpp:469 msgid "" "(Does not skip white space differences even when \"Show White Space\" is " "disabled.)" msgstr "" +"(Hopper ikkeover forskjeller i tomrom selv nÃ¥r «Vis tomrom» er slÃ¥tt av.)" #: kdiff3.cpp:470 msgid "Go to Previous Delta" -msgstr "" +msgstr "GÃ¥ til forrige Delta" #: kdiff3.cpp:472 msgid "Go to Next Delta" -msgstr "" +msgstr "GÃ¥ til neste Delta" #: kdiff3.cpp:474 msgid "Go to Previous Conflict" -msgstr "" +msgstr "GÃ¥ til forrige konflikt" #: kdiff3.cpp:476 msgid "Go to Next Conflict" -msgstr "" +msgstr "GÃ¥ til neste konflikt" #: kdiff3.cpp:478 msgid "Go to Previous Unsolved Conflict" -msgstr "" +msgstr "GÃ¥ til forrige uløste konflikt" #: kdiff3.cpp:480 msgid "Go to Next Unsolved Conflict" -msgstr "" +msgstr "GÃ¥ til neste uløste konflikt" #: kdiff3.cpp:482 msgid "Select Line(s) From A" -msgstr "" +msgstr "Velg linje(r) fra A" #: kdiff3.cpp:483 msgid "Select Line(s) From B" -msgstr "" +msgstr "Velg linje(r) fra B" #: kdiff3.cpp:484 msgid "Select Line(s) From C" -msgstr "" +msgstr "Velg linje(r) fra C" #: kdiff3.cpp:485 msgid "Automatically Go to Next Unsolved Conflict After Source Selection" -msgstr "" +msgstr "GÃ¥ automatisk til neste uløste konflikt etter at kildene er valgt" #: kdiff3.cpp:487 msgid "Show Space && Tabulator Characters for Differences" -msgstr "" +msgstr "Vis mellomrom og tabulatortegn for forskjeller" #: kdiff3.cpp:488 msgid "Show White Space" -msgstr "" +msgstr "Vis tomrom" #: kdiff3.cpp:490 msgid "Show Line Numbers" -msgstr "" +msgstr "Vis linjenumre" #: kdiff3.cpp:491 msgid "Choose A Everywhere" -msgstr "" +msgstr "Velg A overalt" #: kdiff3.cpp:492 msgid "Choose B Everywhere" -msgstr "" +msgstr "Velg B overalt" #: kdiff3.cpp:493 msgid "Choose C Everywhere" -msgstr "" +msgstr "Velg C overalt" #: kdiff3.cpp:494 msgid "Choose A for All Unsolved Conflicts" -msgstr "" +msgstr "Velg A for alle uløste konflikter" #: kdiff3.cpp:495 msgid "Choose B for All Unsolved Conflicts" -msgstr "" +msgstr "Velg B for alle uløste konflikter" #: kdiff3.cpp:496 msgid "Choose C for All Unsolved Conflicts" -msgstr "" +msgstr "Velg C for alle uløste konflikter" #: kdiff3.cpp:497 msgid "Choose A for All Unsolved Whitespace Conflicts" -msgstr "" +msgstr "Velg A for alle uløste tomromkonflikter" #: kdiff3.cpp:498 msgid "Choose B for All Unsolved Whitespace Conflicts" -msgstr "" +msgstr "Velg B for alle uløste tomromkonflikter" #: kdiff3.cpp:499 msgid "Choose C for All Unsolved Whitespace Conflicts" -msgstr "" +msgstr "Velg C for alle uløste tomromkonflikter" #: kdiff3.cpp:500 msgid "Automatically Solve Simple Conflicts" -msgstr "" +msgstr "Løs enkle konflikter automatisk" #: kdiff3.cpp:501 msgid "Set Deltas to Conflicts" -msgstr "" +msgstr "Sett deltaer til konflikter" #: kdiff3.cpp:502 msgid "Run Regular Expression Auto Merge" -msgstr "" +msgstr "Kjør autofletting med regulære uttrykk" #: kdiff3.cpp:503 msgid "Automatically Solve History Conflicts" -msgstr "" +msgstr "Løs opp historiekonflikter automatisk" #: kdiff3.cpp:504 msgid "Split Diff At Selection" -msgstr "" +msgstr "Splitt differansen ved utvalget" #: kdiff3.cpp:505 msgid "Join Selected Diffs" -msgstr "" +msgstr "SlÃ¥ sammen valgte differ" #: kdiff3.cpp:507 msgid "Show Window A" -msgstr "" +msgstr "Vis vindu A" #: kdiff3.cpp:508 msgid "Show Window B" -msgstr "" +msgstr "Vis vindu B" #: kdiff3.cpp:509 msgid "Show Window C" -msgstr "" +msgstr "Vis vindu C" #: kdiff3.cpp:510 kdiff3.cpp:521 msgid "Focus Next Window" -msgstr "" +msgstr "Fokus pÃ¥ neste vindu" #: kdiff3.cpp:512 msgid "Normal Overview" -msgstr "" +msgstr "Normal oversikt" #: kdiff3.cpp:513 msgid "A vs. B Overview" -msgstr "" +msgstr "Oversikt A mot B" #: kdiff3.cpp:514 msgid "A vs. C Overview" -msgstr "" +msgstr "Oversikt A mot C" #: kdiff3.cpp:515 msgid "B vs. C Overview" -msgstr "" +msgstr "Oversikt B mot C" #: kdiff3.cpp:516 msgid "Word Wrap Diff Windows" -msgstr "" +msgstr "Ordbryt i diff-vinduer" #: kdiff3.cpp:517 msgid "Add Manual Diff Alignment" -msgstr "" +msgstr "Legg til manuell diff-innretting" #: kdiff3.cpp:518 msgid "Clear All Manual Diff Alignments" -msgstr "" +msgstr "Tilbakestill all manuell diff-innretting" #: kdiff3.cpp:523 msgid "Focus Prev Window" -msgstr "" +msgstr "Fokus pÃ¥ forrige vindu" #: kdiff3.cpp:524 msgid "Toggle Split Orientation" -msgstr "" +msgstr "Bytt om splitt-orientering" #: kdiff3.cpp:526 msgid "Dir && Text Split Screen View" -msgstr "" +msgstr "Mappe og tekst delt visning" #: kdiff3.cpp:528 msgid "Toggle Between Dir && Text View" -msgstr "" +msgstr "Bytt mellom mappe- og tekstvisning" #: kdiff3.cpp:573 pdiff.cpp:1698 msgid "The merge result hasn't been saved." -msgstr "" +msgstr "Fletteresultatet er ikke lagret." #: kdiff3.cpp:574 msgid "Save && Quit" -msgstr "" +msgstr "Lagre og avslutt" #: kdiff3.cpp:574 msgid "Quit Without Saving" -msgstr "" +msgstr "Avslutt uten lagring" #: kdiff3.cpp:582 pdiff.cpp:1707 msgid "Saving the merge result failed." -msgstr "" +msgstr "Fletteresultatet kunne ikke lagres." #: kdiff3.cpp:593 pdiff.cpp:964 msgid "" "You are currently doing a directory merge. Are you sure, you want to abort?" -msgstr "" +msgstr "Du holder pÃ¥ med en mappefletting. Er du sikker pÃ¥ at du vil avbryte?" #: kdiff3.cpp:616 msgid "Saving file..." -msgstr "" +msgstr "Lagrer fil ..." #: kdiff3.cpp:633 msgid "Saving file with a new filename..." -msgstr "" +msgstr "Lagrer fil med nytt filnavn ..." #: kdiff3.cpp:722 msgid "Printing..." -msgstr "" +msgstr "Skriver ut ..." #: kdiff3.cpp:728 kdiff3.cpp:890 msgid "Printing aborted." -msgstr "" +msgstr "Utskrift avbrutt." #: kdiff3.cpp:860 msgid "Selection" -msgstr "" +msgstr "Utvalg" #: kdiff3.cpp:886 msgid "Printing completed." -msgstr "" +msgstr "Utskrift fullført." #: kdiff3.cpp:896 msgid "Exiting..." -msgstr "" +msgstr "Avslutter ..." #: kdiff3.cpp:908 msgid "Toggling toolbar..." -msgstr "" +msgstr "SlÃ¥r verktøylinje av/pÃ¥ ..." #: kdiff3.cpp:929 msgid "Toggle the statusbar..." -msgstr "" - -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +msgstr "SlÃ¥ statuslinje av/pÃ¥ ..." + +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." -msgstr "" - -#: kdiff3_part.cpp:290 +msgstr "Klarte ikke finne filer for sammenlikning." + +#: kdiff3_part.cpp:291 msgid "KDiff3Part" -msgstr "" +msgstr "KDiff3Part" #: kdiff3_shell.cpp:78 msgid "" @@ -1125,388 +1157,421 @@ "This usually happens due to an installation problem. Please read the " "README-file in the source package for details." msgstr "" +"Fant ikke vÃ¥r part!\n" +"Dette skyldes oftest et installasjonsproblem. Det stÃ¥r mer om dette i " +"README-fila i kildekoden." #: main.cpp:35 msgid "Tool for Comparison and Merge of Files and Directories" -msgstr "" +msgstr "Verktøy for sammenlikning og fletting av filer og mapper" #: main.cpp:40 msgid "Merge the input." -msgstr "" +msgstr "Flett inn-data." #: main.cpp:42 msgid "Explicit base file. For compatibility with certain tools." -msgstr "" +msgstr "Uttrykkelig angitt basefil. For kompatibilitet med visse verktøy." #: main.cpp:44 msgid "Output file. Implies -m. E.g.: -o newfile.txt" -msgstr "" +msgstr "Utdata-fil. Impliserer -m. F.eks: -o nyfil.txt" #: main.cpp:45 msgid "Output file, again. (For compatibility with certain tools.)" -msgstr "" +msgstr "Utdata-fil, igjen. (For kompatibilitet med visse verktøy)." #: main.cpp:46 msgid "No GUI if all conflicts are auto-solvable. (Needs -o file)" -msgstr "" +msgstr "Ingen GUI hvis alle konflikter kan auto-løses. (Trenger -o fil)" #: main.cpp:47 msgid "Don't solve conflicts automatically. (For compatibility...)" -msgstr "" +msgstr "Ikke løs konflikter automatisk. (For kompatibilitet ...)" #: main.cpp:48 msgid "Visible name replacement for input file 1 (base)." -msgstr "" +msgstr "Synlig navnerstatning for inn-fil 1 (basis)." #: main.cpp:49 msgid "Visible name replacement for input file 2." -msgstr "" +msgstr "Synlig navnerstatning for inn-fil 2." #: main.cpp:50 msgid "Visible name replacement for input file 3." -msgstr "" +msgstr "Synlig navnerstatning for inn-fil 3." #: main.cpp:52 msgid "Alternative visible name replacement. Supply this once for every input." -msgstr "" +msgstr "Alternativ synlig navnerstatning. Angi en gang for hver inngang." #: main.cpp:53 msgid "" "Override a config setting. Use once for every setting. E.g.: --cs " "\"AutoAdvance=1\"" msgstr "" +"Overstyr en innstilling. Bruk en gang for hver innstilling. F.eks.: --cs " +"\"AutoAdvance=1\"" #: main.cpp:54 msgid "Show list of config settings and current values." -msgstr "" +msgstr "Vis liste over oppsettsinnstillinger og gjeldende verdier." #: main.cpp:55 msgid "Use a different config file." -msgstr "" +msgstr "Bruk en annen oppsettsfil." #: main.cpp:59 msgid "file1 to open (base, if not specified via --base)" -msgstr "" +msgstr "fil 1 som skal Ã¥pnes (basis, hvis ikke oppgitt via --base)" #: main.cpp:60 msgid "file2 to open" -msgstr "" +msgstr "fil 2 som skal Ã¥pnes" #: main.cpp:61 msgid "file3 to open" -msgstr "" +msgstr "fil 3 som skal Ã¥pnes" #: main.cpp:93 msgid "Ignored. (User defined.)" -msgstr "" +msgstr "Ignorert. (Selvvalgt.)" #. i18n: file kdiff3_part.rc line 16 #: main.cpp:171 rc.cpp:9 #, no-c-format msgid "KDiff3" -msgstr "" +msgstr "KDiff3" #: main.cpp:184 msgid "+ Many thanks to those who reported bugs and contributed ideas!" -msgstr "" - -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +msgstr "+ Mange takk til dem som rapporterte feil og bidro med ideer!" + +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" -msgstr "" - -#: mergeresultwindow.cpp:282 +msgstr "Antall uløste konflikter som gjenstÃ¥r: %1 ( herav %2 tomrom )" + +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" - -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +"Utdata er blitt endret.\n" +"Hvis du fortsetter mister du endringene dine." + +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." -msgstr "" - -#: mergeresultwindow.cpp:796 +msgstr "Alle inn-filer er binært like." + +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." -msgstr "" - -#: mergeresultwindow.cpp:798 +msgstr "Alle inn-filer inneholder samme tekst." + +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" - -#: mergeresultwindow.cpp:799 +"Filer A og B er binært like.\n" + +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" - -#: mergeresultwindow.cpp:800 +"Filer A og B har lik tekst. \n" + +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" - -#: mergeresultwindow.cpp:801 +"Filer A og C er binært like.\n" + +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" - -#: mergeresultwindow.cpp:802 +"Filer A og C har lik tekst. \n" + +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" - -#: mergeresultwindow.cpp:803 +"Filer B og C er binært like.\n" + +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" - -#: mergeresultwindow.cpp:809 +"Filer B og C har lik tekst. \n" + +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " -msgstr "" - -#: mergeresultwindow.cpp:810 +msgstr "Totalt antall konflikter: " + +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" - -#: mergeresultwindow.cpp:811 +"\n" +"Antall automatisk løste konflikter: " + +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" - -#: mergeresultwindow.cpp:813 +"\n" +"Antall uløste konflikter :" + +#: mergeresultwindow.cpp:814 msgid "Conflicts" -msgstr "" - -#: mergeresultwindow.cpp:1649 +msgstr "Konflikter" + +#: mergeresultwindow.cpp:1650 msgid "" -msgstr "" - -#: mergeresultwindow.cpp:1657 +msgstr "" + +#: mergeresultwindow.cpp:1658 msgid "" -msgstr "" - -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +msgstr "" + +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" -msgstr "" - -#: mergeresultwindow.cpp:1729 +msgstr "" + +#: mergeresultwindow.cpp:1730 msgid "Output" -msgstr "" - -#: mergeresultwindow.cpp:1731 +msgstr "Utdata" + +#: mergeresultwindow.cpp:1732 msgid "[Modified]" -msgstr "" - -#: mergeresultwindow.cpp:2655 +msgstr "[Endret]" + +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" - -#: mergeresultwindow.cpp:2657 +"Ikke alle konflikter er løst ennÃ¥.\n" +"Fila er ikke lagret.\n" + +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" -msgstr "" - -#: mergeresultwindow.cpp:2669 +msgstr "GjenstÃ¥ende konflikter" + +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" - -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +"\n" +"\n" +"Det lyktes ikke Ã¥ lage sikkerhetskopi. Fila er ikke lagret." + +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" -msgstr "" - -#: mergeresultwindow.cpp:2709 +msgstr "Feil ved fillagring" + +#: mergeresultwindow.cpp:2710 msgid "Error while writing." -msgstr "" +msgstr "Feil ved skriving." #: optiondialog.cpp:361 msgid "Unicode, 8 bit" -msgstr "" +msgstr "Unicode, 8 bit" #: optiondialog.cpp:362 msgid "Unicode" -msgstr "" +msgstr "Unicode" #: optiondialog.cpp:363 msgid "Latin1" -msgstr "" +msgstr "Latin1" #: optiondialog.cpp:382 msgid "Change this if non-ASCII characters are not displayed correctly." -msgstr "" +msgstr "Endre dette hvis tegn som ikke er i ASCII ikke blir vist riktig." #: optiondialog.cpp:507 msgid "Editor & Diff Output Font" -msgstr "" +msgstr "Skrift for redigering og utdata" #: optiondialog.cpp:528 msgid "Italic font for deltas" -msgstr "" +msgstr "Kursivskrift for deltaer" #: optiondialog.cpp:531 msgid "" "Selects the italic version of the font for differences.\n" "If the font doesn't support italic characters, then this does nothing." msgstr "" +"Velger kursivversjon av skriften for forskjeller.\n" +"Hvis skriften ikke finnes i kursiv, sÃ¥ gjør dette ingenting." #: optiondialog.cpp:539 -#, fuzzy msgid "Color" msgstr "Farge" #: optiondialog.cpp:539 msgid "Colors Settings" -msgstr "" +msgstr "Fargeinnstillinger" #: optiondialog.cpp:553 msgid "Editor and Diff Views:" -msgstr "" +msgstr "Redigering og forskjellsvisning:" #: optiondialog.cpp:561 msgid "Foreground color:" -msgstr "" +msgstr "Forgrunnsfarge:" #: optiondialog.cpp:567 msgid "Background color:" -msgstr "" +msgstr "Bakgrunnsfarge:" #: optiondialog.cpp:575 msgid "Diff background color:" -msgstr "" +msgstr "Bakgrunnsfarge for forskjell:" #: optiondialog.cpp:582 msgid "Color A:" -msgstr "" +msgstr "Farge A:" #: optiondialog.cpp:589 msgid "Color B:" -msgstr "" +msgstr "Farge B:" #: optiondialog.cpp:596 msgid "Color C:" -msgstr "" +msgstr "Farge C:" #: optiondialog.cpp:602 msgid "Conflict color:" -msgstr "" +msgstr "Konfliktfarge:" #: optiondialog.cpp:609 msgid "Current range background color:" -msgstr "" +msgstr "Bakgrunnsfarge for gjeldende omrÃ¥de:" #: optiondialog.cpp:616 msgid "Current range diff background color:" -msgstr "" +msgstr "Bakgrunnsfarge for gjeldende forskjellsomrÃ¥de:" #: optiondialog.cpp:622 msgid "Color for manually aligned difference ranges:" -msgstr "" +msgstr "Farge for manuelt innrettede forskjellsomrÃ¥der:" #: optiondialog.cpp:627 msgid "Directory Comparison View:" -msgstr "" +msgstr "Mappesammenlikning:" #: optiondialog.cpp:633 msgid "Newest file color:" -msgstr "" +msgstr "Farge for nyeste fil:" #: optiondialog.cpp:636 msgid "" "Changing this color will only be effective when starting the next directory " "comparison." msgstr "" +"Endring av denne fargen fÃ¥r bare virkning nÃ¥r neste mappe-sammenlikning " +"utføres." #: optiondialog.cpp:641 msgid "Oldest file color:" -msgstr "" +msgstr "Farge for eldste fil:" #: optiondialog.cpp:648 msgid "Middle age file color:" -msgstr "" +msgstr "Farge for filer med midlere alder:" #: optiondialog.cpp:655 msgid "Color for missing files:" -msgstr "" +msgstr "Farge for manglende filer:" #: optiondialog.cpp:667 -#, fuzzy msgid "Editor" -msgstr "Behandler, Redigerer" +msgstr "Redigerer" #: optiondialog.cpp:667 msgid "Editor Behavior" -msgstr "" +msgstr "Redigeringsoppsett" #: optiondialog.cpp:677 msgid "Tab inserts spaces" -msgstr "" +msgstr "TAB setter inn mellomrom" #: optiondialog.cpp:680 msgid "" "On: Pressing tab generates the appropriate number of spaces.\n" "Off: A Tab-character will be inserted." msgstr "" +"PÃ¥: TAB-tasten setter inn passende antall mellomrom.\n" +"Av: Et TAB-tegn settes inn." #: optiondialog.cpp:686 msgid "Tab size:" -msgstr "" +msgstr "TAB-størrelse:" #: optiondialog.cpp:691 msgid "Auto indentation" -msgstr "" +msgstr "Automatisk innrykk" #: optiondialog.cpp:694 msgid "" "On: The indentation of the previous line is used for a new line.\n" msgstr "" +"PÃ¥: Innrykket for forrige linje brukes for en ny linje.\n" #: optiondialog.cpp:698 msgid "Auto copy selection" -msgstr "" +msgstr "Autokopier utvalg" #: optiondialog.cpp:701 msgid "" "On: Any selection is immediately written to the clipboard.\n" "Off: You must explicitely copy e.g. via Ctrl-C." msgstr "" +"PÃ¥: Alt som markeres skrives straks til utklippstavla.\n" +"Av: Du mÃ¥ uttrykkelig kopiere, f.eks. med Ctrl-C." #: optiondialog.cpp:706 msgid "Line end style:" -msgstr "" +msgstr "Linjeavslutning:" #: optiondialog.cpp:718 msgid "" "Sets the line endings for when an edited file is saved.\n" "DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A" msgstr "" +"Bestemmer tegn for slutt pÃ¥ linja nÃ¥r en fil lagres.\n" +"DOS/Windows: CR+LF; UNIX: LF; med CR=0D, LF=0A" #: optiondialog.cpp:729 msgid "Diff and Merge" -msgstr "" +msgstr "Diff og fletting" #: optiondialog.cpp:729 msgid "Diff and Merge Settings" -msgstr "" +msgstr "Innstillinger for Diff og fletting" #: optiondialog.cpp:740 msgid "Preserve carriage return" -msgstr "" +msgstr "Bevar vognretur" #: optiondialog.cpp:743 msgid "" "Show carriage return characters '\\r' if they exist.\n" "Helps to compare files that were modified under different operating systems." msgstr "" +"Vis tegn «\\r» for vognretur hvis de finnes.\n" +"Hjelper Ã¥ sammenlikne filer som ble endret i forskjellige operativsystemer." #: optiondialog.cpp:748 msgid "Ignore numbers" -msgstr "" +msgstr "Ignorer tall" #: optiondialog.cpp:751 msgid "" @@ -1514,86 +1579,96 @@ "space.)\n" "Might help to compare files with numeric data." msgstr "" +"Ignorer sifre nÃ¥r linjene søkes opp. (Likner Ignorer tomrom)\n" +"Kan hjelpe til Ã¥ sammenlikne filer med numeriske data." #: optiondialog.cpp:756 msgid "Ignore C/C++ comments" -msgstr "" +msgstr "Ignorer C/C++-kommentarer" #: optiondialog.cpp:758 msgid "Treat C/C++ comments like white space." -msgstr "" +msgstr "Behandle kommentarer i C/C++ som tomrom." #: optiondialog.cpp:762 msgid "Ignore case" -msgstr "" +msgstr "Ikke ta hensyn til store/smÃ¥ bokstaver" #: optiondialog.cpp:765 msgid "Treat case differences like white space changes. ('a'<=>'A')" -msgstr "" +msgstr "Behandle endringer smÃ¥/store som endring i tomrom («a»<=>«A»)" #: optiondialog.cpp:769 msgid "Preprocessor command:" -msgstr "" +msgstr "Forarbeide-kommando:" #: optiondialog.cpp:773 msgid "User defined pre-processing. (See the docs for details.)" -msgstr "" +msgstr "Selvvalgt forarbeide. (Detaljer finnes i dokumentasjonen)" #: optiondialog.cpp:776 msgid "Line-matching preprocessor command:" -msgstr "" +msgstr "Linjesøkende forarbeide, kommando:" #: optiondialog.cpp:780 msgid "" "This pre-processor is only used during line matching.\n" "(See the docs for details.)" msgstr "" +"Denne forbehandleren brukes bare nÃ¥r linjer søkes.\n" +"(Detaljer i dokumentasjonen)." #: optiondialog.cpp:783 msgid "Try hard (slower)" -msgstr "" +msgstr "Grundig (langsommere)" #: optiondialog.cpp:786 msgid "" "Enables the --minimal option for the external diff.\n" "The analysis of big files will be much slower." msgstr "" +"SlÃ¥r pÃ¥ --minimal for det eksterne diff-programmet.\n" +"Analyse av store filer blir mye langsommere." #: optiondialog.cpp:791 msgid "Auto advance delay (ms):" -msgstr "" +msgstr "Forsinkelse for auto-avansering (ms):" #: optiondialog.cpp:796 msgid "" "When in Auto-Advance mode the result of the current selection is shown \n" "for the specified time, before jumping to the next conflict. Range: 0-2000 ms" msgstr "" +"NÃ¥r det brukes auto-avansering vises resultatet av gjeldende utvalg \n" +"i oppgitt tid, før det hoppes til neste konflikt. VerdiomrÃ¥de fra 0-2000 ms" #: optiondialog.cpp:801 msgid "White space 2-file merge default:" -msgstr "" +msgstr "Standard for 2-fils tomromsfletting:" #: optiondialog.cpp:805 optiondialog.cpp:818 msgid "Manual Choice" -msgstr "" +msgstr "Manuelt valg" #: optiondialog.cpp:809 optiondialog.cpp:823 msgid "" "Allow the merge algorithm to automatically select an input for white-space-only " "changes." msgstr "" +"Tillat flettealgoritmen Ã¥ velge inn-data automatisk for endringer som bare " +"gjelder tomrom." #: optiondialog.cpp:814 msgid "White space 3-file merge default:" -msgstr "" +msgstr "Standard for 3-fils tomromsfletting:" #: optiondialog.cpp:828 msgid "Automatic Merge Regular Expression" -msgstr "" +msgstr "Automatisk fletting med regulært uttrykk" #: optiondialog.cpp:837 smalldialogs.cpp:379 msgid "Auto merge regular expression:" -msgstr "" +msgstr "Regulært uttrykk for automatisk fletting:" #: optiondialog.cpp:841 msgid "" @@ -1602,24 +1677,29 @@ "When a line with a conflict matches the regular expression then\n" "- if available - C, otherwise B will be chosen." msgstr "" +"Regulært uttrykk for linjer der KDiff3 skal velge én kilde automatisk.\n" +"NÃ¥r en linje med konflikt stemmer med det regulære uttrykket, sÃ¥ \n" +"velges C hvis tilgjengelig, ellers B." #: optiondialog.cpp:847 msgid "Run regular expression auto merge on merge start" -msgstr "" +msgstr "Kjør autofletting med regulære uttrykk ved flettestart" #: optiondialog.cpp:849 msgid "" "Run the merge for auto merge regular expressions\n" "immediately when a merge starts.\n" msgstr "" +"Kjør autoflettingen med regulære uttrykk med en\n" +"gang nÃ¥r en fletting begynner.\n" #: optiondialog.cpp:854 msgid "Version Control History Merging" -msgstr "" +msgstr "Fletting av historien fra versjonskontroll" #: optiondialog.cpp:863 smalldialogs.cpp:406 msgid "History start regular expression:" -msgstr "" +msgstr "Regulært uttrykk for start pÃ¥ historien:" #: optiondialog.cpp:867 msgid "" @@ -1627,10 +1707,13 @@ "Usually this line contains the \"$Log$\"-keyword.\n" "Default value: \".*\\$Log.*\\$.*\"" msgstr "" +"Regulært uttrykk for start pÃ¥ oppføringen i versjonskontroll-historien.\n" +"Denne linja inneholder som regel \"$Log$\"-nøkkelordet.\n" +"Standard: \".*\\$Log.*\\$.*\"" #: optiondialog.cpp:873 smalldialogs.cpp:435 msgid "History entry start regular expression:" -msgstr "" +msgstr "Regulært uttrykk for start pÃ¥ historieoppføring:" #: optiondialog.cpp:885 msgid "" @@ -1641,18 +1724,24 @@ "If left empty, then KDiff3 assumes that empty lines separate history entries.\n" "See the documentation for details." msgstr "" +"En historieoppføring bestÃ¥r av flere linjer.\n" +"Oppgi et regulært uttrykk som finner første linje (uten kommentaren foran).\n" +"Bruk parenteser for Ã¥ binde sammen nøkler du vil bruke til sortering.\n" +"Hvis det stÃ¥r tomt regner KDiff3 med at det er blanke linjer mellom " +"historieoppføringene.\n" +"Se i dokumentasjonen etter detaljer." #: optiondialog.cpp:893 msgid "History merge sorting" -msgstr "" +msgstr "Flettesortering av historien" #: optiondialog.cpp:895 msgid "Sort version control history by a key." -msgstr "" +msgstr "Sorter versjonskontroll-historien etter en nøkkel." #: optiondialog.cpp:905 msgid "History entry start sort key order:" -msgstr "" +msgstr "Nøkkelrekkefølge for sortering av historiestart:" #: optiondialog.cpp:909 msgid "" @@ -1663,22 +1752,28 @@ "If left empty, then no sorting will be done.\n" "See the documentation for details." msgstr "" +"Hver parentes brukt i det regulære uttrykket for start pÃ¥ historieoppføringen\n" +"definerer en nøkkel som kan brukes til sortering.\n" +"Oppgi en liste over nøkler (nummerert i den rekkefølge de opptrer\n" +"med start pÃ¥ 1), med «,» som skilletegn (f.eks. \"4,5,6,1,2,3,7\").\n" +"StÃ¥r dette tomt blir det ikke sortert.\n" +"Detaljer finnes i dokumentasjonen." #: optiondialog.cpp:920 msgid "Merge version control history on merge start" -msgstr "" +msgstr "Flett versjonshistorien nÃ¥r flettingen begynner" #: optiondialog.cpp:922 msgid "Run version control history automerge on merge start." -msgstr "" +msgstr "Kjør autofletting pÃ¥ versjonshistorien nÃ¥r fletting begynner." #: optiondialog.cpp:926 msgid "Test your regular expressions" -msgstr "" +msgstr "Test de regulære uttrykkene" #: optiondialog.cpp:931 msgid "Irrelevant merge command:" -msgstr "" +msgstr "Irrelevant flettekommando:" #: optiondialog.cpp:935 msgid "" @@ -1686,22 +1781,25 @@ "when no other relevant changes were detected.\n" "Called with the parameters: filename1 filename2 filename3" msgstr "" +"Hvis det er oppgitt, kjøres dette skriptet etter\n" +"autofletting nÃ¥r ingen andre relevante endringer \n" +"ble funnet. Kalles med parametre filnavn1 filnavn2 filnavn3" #: optiondialog.cpp:945 msgid "Directory Merge" -msgstr "" +msgstr "Mappefletting" #: optiondialog.cpp:954 msgid "Recursive directories" -msgstr "" +msgstr "Rekursive mapper" #: optiondialog.cpp:956 msgid "Whether to analyze subdirectories or not." -msgstr "" +msgstr "Om undermapper skal analyseres eller ikke." #: optiondialog.cpp:958 msgid "File pattern(s):" -msgstr "" +msgstr "Filmønster(e):" #: optiondialog.cpp:963 msgid "" @@ -1709,10 +1807,13 @@ "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" msgstr "" +"Mønster(e) for filnavn som skal analyseres.\n" +"Jokertegn: «*» og «?»\n" +"Flere mønstre kan oppgis med «;» som skilletegn" #: optiondialog.cpp:969 msgid "File-anti-pattern(s):" -msgstr "" +msgstr "Fil-antimønster(e):" #: optiondialog.cpp:974 msgid "" @@ -1720,10 +1821,13 @@ "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" msgstr "" +"Mønster(e) for filer som ikke skal analyseres. \n" +"Jokertegn: «*» og «?»\n" +"Flere mønstre kan oppgis med «;» som skilletegn" #: optiondialog.cpp:980 msgid "Dir-anti-pattern(s):" -msgstr "" +msgstr "Mappe-antimønster(e) :" #: optiondialog.cpp:985 msgid "" @@ -1731,52 +1835,61 @@ "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" msgstr "" +"Mønster(e) for mapper som ikke skal analyseres. \n" +"Jokertegn: «*» og «?»\n" +"Flere mønstre kan oppgis med «;» som skilletegn" #: optiondialog.cpp:991 msgid "Use .cvsignore" -msgstr "" +msgstr "Bruk .cvsignore" #: optiondialog.cpp:994 msgid "" "Extends the antipattern to anything that would be ignored by CVS.\n" "Via local \".cvsignore\"-files this can be directory specific." msgstr "" +"Utvider antimønsteret til alt som CVS ville ignorere.\n" +"Dette kan gjøres pr. mappe med lokale «.cvsignore»-filer." #: optiondialog.cpp:999 msgid "Find hidden files and directories" -msgstr "" +msgstr "Finn skjulte filer og mapper" #: optiondialog.cpp:1002 msgid "Finds files and directories with the hidden attribute." -msgstr "" +msgstr "Finner filer og mapper som har attributten «skjult." #: optiondialog.cpp:1004 msgid "Finds files and directories starting with '.'." -msgstr "" +msgstr "Finner filer og mapper med navn som begynner med «.»." #: optiondialog.cpp:1008 msgid "Follow file links" -msgstr "" +msgstr "Følg fil-lenker" #: optiondialog.cpp:1011 msgid "" "On: Compare the file the link points to.\n" "Off: Compare the links." msgstr "" +"PÃ¥: Sammenlikne filer som lenkene peker pÃ¥.\n" +"Av: Sammenlikne lenkene." #: optiondialog.cpp:1016 msgid "Follow directory links" -msgstr "" +msgstr "Følg mappelenker" #: optiondialog.cpp:1019 msgid "" "On: Compare the directory the link points to.\n" "Off: Compare the links." msgstr "" +"PÃ¥: Sammenlikne mapper lenkene peker pÃ¥.\n" +"Av: Sammenlikne lenkene." #: optiondialog.cpp:1035 msgid "Case sensitive filename comparison" -msgstr "" +msgstr "Store/smÃ¥ bokstaver i filnavn" #: optiondialog.cpp:1038 msgid "" @@ -1785,32 +1898,37 @@ "Set this option if the case of the names must match. (Default for Windows is " "off, otherwise on.)" msgstr "" +"Mappesammenlikningen behandler filer og mapper nÃ¥r navnene er like.\n" +"SlÃ¥ pÃ¥ dette hvis navnene er versalvâre - dvs store/smÃ¥ bokstaver mÃ¥ være like. " +"(Standard for Windows er av, ellers pÃ¥.)v" #: optiondialog.cpp:1042 msgid "File Comparison Mode" -msgstr "" +msgstr "Hvordan filer sammenliknes" #: optiondialog.cpp:1046 msgid "Binary comparison" -msgstr "" +msgstr "Binær sammenlikning" #: optiondialog.cpp:1047 msgid "Binary comparison of each file. (Default)" -msgstr "" +msgstr "Binær sammenlikning av hver fil. (Standard)" #: optiondialog.cpp:1049 msgid "Full analysis" -msgstr "" +msgstr "Full analyse" #: optiondialog.cpp:1050 msgid "" "Do a full analysis and show statistics information in extra columns.\n" "(Slower than a binary comparison, much slower for binary files.)" msgstr "" +"Gjør en full analyse og vis statistikk i ekstra kolonner.\n" +"(Langsommere enn binær sammenlikning, mye langsommere for binære filer.)" #: optiondialog.cpp:1053 msgid "Trust the modification date (unsafe)" -msgstr "" +msgstr "Stol pÃ¥ endringsdatoen (utrygt)" #: optiondialog.cpp:1054 msgid "" @@ -1818,10 +1936,12 @@ "equal.\n" "Useful for big directories or slow networks." msgstr "" +"Anta at filer er like hvis endringsdatoene og størrelsene er like.\n" +"Nyttig for store mapper eller langsomme nett." #: optiondialog.cpp:1057 msgid "Trust the size (unsafe)" -msgstr "" +msgstr "Stol pÃ¥ størrelsen (utrygt)" #: optiondialog.cpp:1058 msgid "" @@ -1829,10 +1949,13 @@ "Useful for big directories or slow networks when the date is modified during " "download." msgstr "" +"Anta at filer er like hvis størrelsene er like.\n" +"Nyttig for store mapper eller langsomme nett nÃ¥r datoen endres under " +"nedlasting." #: optiondialog.cpp:1062 msgid "Synchronize directories" -msgstr "" +msgstr "Synkroniser mapper" #: optiondialog.cpp:1065 msgid "" @@ -1840,20 +1963,25 @@ "both directories are the same afterwards.\n" "Works only when comparing two directories without specifying a destination." msgstr "" +"Kan lagre filer i begge mapper slik at begge\n" +"mappene er like etterpÃ¥. Dette virker bare hvis\n" +"to mapper sammenliknes uten Ã¥ oppgi et mÃ¥l." #: optiondialog.cpp:1071 msgid "White space differences considered equal" -msgstr "" +msgstr "Tomromsforskjeller betraktes som like" #: optiondialog.cpp:1074 msgid "" "If files differ only by white space consider them equal.\n" "This is only active when full analysis is chosen." msgstr "" +"Hvis filer er forskjellige bare i tomrom, betrakt dem som\n" +"like. Dette er bare aktivt nÃ¥r det kjøres full analyse." #: optiondialog.cpp:1080 msgid "Copy newer instead of merging (unsafe)" -msgstr "" +msgstr "Kopier den nyeste i stedet for Ã¥ flette (utrygt)" #: optiondialog.cpp:1083 msgid "" @@ -1861,96 +1989,111 @@ "(Use this only if you know what you are doing!)\n" "Only effective when comparing two directories." msgstr "" +"Ikke se inni filene, bare bruk den nyeste fila.\n" +"(Bruk dette bare nÃ¥r du vet hva du gjør!)\n" +"Bare virksomt nÃ¥r to mapper sammenliknes." #: optiondialog.cpp:1088 msgid "Backup files (.orig)" -msgstr "" +msgstr "Ta sikkerhetskopi av filer (.orig)" #: optiondialog.cpp:1091 msgid "" "When a file would be saved over an old file, then the old file\n" "will be renamed with a '.orig'-extension instead of being deleted." msgstr "" +"NÃ¥r en ny fil ville bli lagret oppÃ¥ en gammel, sÃ¥ fÃ¥r den gamle\n" +"fila nytt navn med «.orig» til slutt i stedet for Ã¥ bli slettet." #: optiondialog.cpp:1118 msgid "Regional Settings" -msgstr "" - -#: optiondialog.cpp:1211 +msgstr "Regionale innstillinger" + +#: optiondialog.cpp:1214 msgid "Language (restart required)" -msgstr "" - -#: optiondialog.cpp:1243 +msgstr "SprÃ¥k (krever omstart av KDiff3)" + +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" - -#: optiondialog.cpp:1261 +"Velg sprÃ¥k for GUI-strengene, eller «Auto».\n" +"KDiff3 mÃ¥ stoppes og startes pÃ¥ nytt for at dette skal fÃ¥ virkning." + +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" -msgstr "" - -#: optiondialog.cpp:1264 +msgstr "Bruk samme koding for alt:" + +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" - -#: optiondialog.cpp:1269 +"Hvis dette er slÃ¥tt pÃ¥ kan alle kodinger endres ved bare Ã¥ endre den første.\n" +"SlÃ¥ av hvis det trengs separate innstillinger." + +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " -msgstr "" - -#: optiondialog.cpp:1273 +msgstr "Merk: Lokal koding er " + +#: optiondialog.cpp:1276 msgid "File Encoding for A:" -msgstr "" - -#: optiondialog.cpp:1278 +msgstr "Filkoding for A :" + +#: optiondialog.cpp:1281 msgid "File Encoding for B:" -msgstr "" - -#: optiondialog.cpp:1283 +msgstr "Filkoding for B :" + +#: optiondialog.cpp:1286 msgid "File Encoding for C:" -msgstr "" - -#: optiondialog.cpp:1288 +msgstr "Filkoding for C :" + +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" -msgstr "" - -#: optiondialog.cpp:1293 +msgstr "Filkoding for flettet resultat og lagring:" + +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" -msgstr "" - -#: optiondialog.cpp:1302 +msgstr "Filkoding for forbehandlingsfiler:" + +#: optiondialog.cpp:1305 msgid "Right To Left Language" -msgstr "" - -#: optiondialog.cpp:1305 +msgstr "Høyre mot venstre-sprÃ¥k" + +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" - -#: optiondialog.cpp:1315 +"Noen sprÃ¥k leses fra høyre mot venstre.\n" +"Denne innstillingen endrer visning og redigering tilsvarende." + +#: optiondialog.cpp:1318 msgid "Integration" -msgstr "" - -#: optiondialog.cpp:1315 +msgstr "Integrasjon" + +#: optiondialog.cpp:1318 msgid "Integration Settings" -msgstr "" - -#: optiondialog.cpp:1325 +msgstr "Integrasjonsinnstillinger" + +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" -msgstr "" - -#: optiondialog.cpp:1330 +msgstr "Kommandolinjeparametre som skal ignoreres:" + +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" "Several values can be specified if separated via ';'\n" "This will suppress the \"Unknown option\"-error." msgstr "" - -#: optiondialog.cpp:1383 +"Liste over kommandolinje-parametre som skal hoppes over nÃ¥r KDiff3 brukes av " +"andre verktøy.\n" +"Flere verdier kan oppgis atskilt med «;»\n" +"Da forsvinner feilmeldingen «Ukjent parameter»." + +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -1959,31 +2102,38 @@ "\n" "Do you want to continue or do you want to select another font." msgstr "" - -#: optiondialog.cpp:1387 +"Du har valgt en skrift med variabel bredde.\n" +"\n" +"Fordi dette programmet ikke hÃ¥ndterer skrifter med\n" +"variabel bredde riktig, kan du fÃ¥ vansker med redigering.\n" +"\n" +"Vil du fortsette, eller vil du velge en annen skrift." + +#: optiondialog.cpp:1390 msgid "Incompatible Font" -msgstr "" - -#: optiondialog.cpp:1388 +msgstr "Ikke kompatibel skrift" + +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" -msgstr "" - -#: optiondialog.cpp:1388 +msgstr "Fortsett pÃ¥ egen risiko" + +#: optiondialog.cpp:1391 msgid "Select Another Font" -msgstr "" - -#: optiondialog.cpp:1413 +msgstr "Velg en annen skrift" + +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." -msgstr "" +msgstr "Dette tilbakestiller alle valg, ikke bare dem i dette emnet." #: pdiff.cpp:258 msgid "PreprocessorCmd: " -msgstr "" +msgstr "Forbehandlingskommando :" #: pdiff.cpp:263 msgid "" "The following option(s) you selected might change data:\n" msgstr "" +"Følgende innstillinger som er valgt kan endre data:\n" #: pdiff.cpp:264 msgid "" @@ -1991,68 +2141,73 @@ "Most likely this is not wanted during a merge.\n" "Do you want to disable these settings or continue with these settings active?" msgstr "" +"\n" +"Ved fletting er nok ikke dette ønsket.\n" +"Vil du slÃ¥ av disse innstillingene eller fortsette med dem slÃ¥tt pÃ¥?" #: pdiff.cpp:266 msgid "Option Unsafe for Merging" -msgstr "" +msgstr "Utrygg innstilling for fletting" #: pdiff.cpp:267 msgid "Use These Options During Merge" -msgstr "" +msgstr "Bruk disse innstillingene under fletting" #: pdiff.cpp:267 msgid "Disable Unsafe Options" -msgstr "" +msgstr "SlÃ¥ av utrygge innstillinger" #: pdiff.cpp:297 msgid "Loading A" -msgstr "" +msgstr "Laster A" #: pdiff.cpp:301 msgid "Loading B" -msgstr "" +msgstr "Laster B" #: pdiff.cpp:318 pdiff.cpp:344 msgid "Diff: A <-> B" -msgstr "" +msgstr "Diff: A <-> B" #: pdiff.cpp:324 pdiff.cpp:366 msgid "Linediff: A <-> B" -msgstr "" +msgstr "Linjediff A <-> B" #: pdiff.cpp:335 msgid "Loading C" -msgstr "" +msgstr "Laster C" #: pdiff.cpp:347 msgid "Diff: B <-> C" -msgstr "" +msgstr "Diff: B <-> C" #: pdiff.cpp:350 msgid "Diff: A <-> C" -msgstr "" +msgstr "Diff: A <-> C" #: pdiff.cpp:369 msgid "Linediff: B <-> C" -msgstr "" +msgstr "Linjediff B <-> C" #: pdiff.cpp:372 msgid "Linediff: A <-> C" -msgstr "" +msgstr "Linjediff A <-> C" #: pdiff.cpp:509 msgid "All input files contain the same text, but are not binary equal." -msgstr "" +msgstr "Alle inn-filene inneholder samme tekst, men er ikke binært like." #: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 msgid "" "Files %1 and %2 are binary equal.\n" msgstr "" +"Filene %1 og %2 er binært like.\n" #: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 msgid "" "Files %1 and %2 have equal text, but are not binary equal. \n" msgstr "" +"Filene %1 og %2 har lik tekst, men er ikke binært like. \n" #: pdiff.cpp:526 msgid "" @@ -2060,234 +2215,252 @@ "Note that the KDiff3-merge was not meant for binary data.\n" "Continue at your own risk." msgstr "" +"Det ser ut til at noen av inndata-filene ikke er rene tekstfiler.\n" +"Merk at KDiff3-fletting ikke er beregnet for binære data.\n" +"Fortsett pÃ¥ egen risiko." #: pdiff.cpp:965 msgid "Abort" -msgstr "" +msgstr "Avbryt" #: pdiff.cpp:971 pdiff.cpp:1059 msgid "Opening files..." -msgstr "" +msgstr "Ã…pner filer ..." #: pdiff.cpp:1036 pdiff.cpp:1107 msgid "File open error" -msgstr "" +msgstr "Feil ved filÃ¥pning" #: pdiff.cpp:1139 msgid "Cutting selection..." -msgstr "" +msgstr "Klipper ut utvalget ..." #: pdiff.cpp:1160 msgid "Copying selection to clipboard..." -msgstr "" +msgstr "Kopierer utvalg til utklippstavla ..." #: pdiff.cpp:1176 msgid "Inserting clipboard contents..." -msgstr "" +msgstr "Setter inn fra utklippstavla ..." #: pdiff.cpp:1699 msgid "Save && Continue" -msgstr "" +msgstr "Lagre og fortsett" #: pdiff.cpp:1699 msgid "Continue Without Saving" -msgstr "" +msgstr "Fortsett uten lagring" #: pdiff.cpp:1906 msgid "Search complete." -msgstr "" +msgstr "Søk fullført." #: pdiff.cpp:1906 msgid "Search Complete" -msgstr "" - -#: pdiff.cpp:2129 +msgstr "Søk fullført" + +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." -msgstr "" - -#: pdiff.cpp:2129 +msgstr "Ingenting er valgt i noe av inndata-vinduene." + +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" -msgstr "" +msgstr "Feil oppsto ved tillegg av manuelt diff-omrÃ¥de" #. i18n: file kdiff3_part.rc line 4 #: rc.cpp:3 #, no-c-format msgid "&KDiff3" -msgstr "" +msgstr "&KDiff3" #. i18n: file kdiff3_part.rc line 13 #: rc.cpp:6 #, no-c-format msgid "Configure KDiff3" -msgstr "" +msgstr "Sett opp KDiff3" #. i18n: file kdiff3_shell.rc line 7 #: rc.cpp:15 #, no-c-format msgid "&Directory" -msgstr "" +msgstr "M&appe" #. i18n: file kdiff3_shell.rc line 30 #: rc.cpp:18 #, no-c-format msgid "Current Item Merge Operation" -msgstr "" +msgstr "Flettehandling pÃ¥ gjeldende element" #. i18n: file kdiff3_shell.rc line 38 #: rc.cpp:21 #, no-c-format msgid "Current Item Sync Operation" -msgstr "" +msgstr "Synk-handling pÃ¥ gjeldende element" #. i18n: file kdiff3_shell.rc line 50 #: rc.cpp:24 #, no-c-format msgid "&Movement" -msgstr "" +msgstr "F&lytting" #. i18n: file kdiff3_shell.rc line 61 #: rc.cpp:27 #, no-c-format msgid "D&iffview" -msgstr "" +msgstr "D&iffvisning" #. i18n: file kdiff3_shell.rc line 73 #: rc.cpp:30 #, no-c-format msgid "&Merge" -msgstr "" +msgstr "&Flett" #. i18n: file kdiff3_shell.rc line 95 #: rc.cpp:33 #, no-c-format msgid "&Window" -msgstr "" +msgstr "&Vindu" #: smalldialogs.cpp:53 msgid "A (Base):" -msgstr "" +msgstr "A (Basis):" #: smalldialogs.cpp:59 smalldialogs.cpp:75 smalldialogs.cpp:91 #: smalldialogs.cpp:134 msgid "File..." -msgstr "" +msgstr "Fil ..." #: smalldialogs.cpp:61 smalldialogs.cpp:77 smalldialogs.cpp:93 #: smalldialogs.cpp:136 msgid "Dir..." -msgstr "" +msgstr "Mappe ..." #: smalldialogs.cpp:86 msgid "C (Optional):" -msgstr "" +msgstr "C (valgfri):" #: smalldialogs.cpp:108 msgid "Swap/Copy Names ..." -msgstr "" +msgstr "Bytt/kopier navn ..." #: smalldialogs.cpp:114 smalldialogs.cpp:115 smalldialogs.cpp:116 msgid "Swap %1<->%2" -msgstr "" +msgstr "Bytt om %1<->%2" #: smalldialogs.cpp:117 smalldialogs.cpp:118 smalldialogs.cpp:119 msgid "Copy %1->Output" -msgstr "" +msgstr "Kopier %1->Utdata" #: smalldialogs.cpp:120 smalldialogs.cpp:121 smalldialogs.cpp:122 msgid "Swap %1<->Output" -msgstr "" +msgstr "Bytt om %1<->utdata" #: smalldialogs.cpp:129 msgid "Output (optional):" -msgstr "" +msgstr "Utdata (valgfri):" #: smalldialogs.cpp:158 msgid "Configure..." -msgstr "" +msgstr "Sett opp ..." #: smalldialogs.cpp:329 -#, fuzzy msgid "Search text:" -msgstr "&Søk" +msgstr "Søketekst:" #: smalldialogs.cpp:336 -#, fuzzy msgid "Case sensitive" msgstr "Skill mellom store og smÃ¥ bokstaver" #: smalldialogs.cpp:339 msgid "Search A" -msgstr "" +msgstr "Søk i A" #: smalldialogs.cpp:344 msgid "Search B" -msgstr "" +msgstr "Søk i B" #: smalldialogs.cpp:349 msgid "Search C" -msgstr "" +msgstr "Søk i C" #: smalldialogs.cpp:354 msgid "Search output" -msgstr "" +msgstr "Utdata fra søk" #: smalldialogs.cpp:359 -#, fuzzy msgid "&Search" msgstr "&Søk" #: smalldialogs.cpp:376 msgid "Regular Expression Tester" -msgstr "" +msgstr "Prøv ut regulært uttrykk" #: smalldialogs.cpp:387 msgid "Example auto merge line:" -msgstr "" +msgstr "Eksempel pÃ¥ autoflette-linje:" #: smalldialogs.cpp:389 msgid "For auto merge test copy a line as used in your files." msgstr "" +"Kopier hit en linje slik som brukt i filene dine, for Ã¥ teste autofletting." #: smalldialogs.cpp:395 smalldialogs.cpp:424 smalldialogs.cpp:461 msgid "Match result:" -msgstr "" +msgstr "Resultat av søk:" #: smalldialogs.cpp:414 msgid "Example history start line (with leading comment):" -msgstr "" +msgstr "Eksempel pÃ¥ startlinje for historie (med innledende kommentar):" #: smalldialogs.cpp:417 msgid "" "Copy a history start line as used in your files,\n" "including the leading comment." msgstr "" +"Kopier en historie-startlinje fra en av filene dine,\n" +"ta med den innledende kommentaren." #: smalldialogs.cpp:443 msgid "History sort key order:" -msgstr "" +msgstr "Sorteringsrekkefølge for historienøkler:" #: smalldialogs.cpp:451 msgid "Example history entry start line (without leading comment):" msgstr "" +"Eksempel pÃ¥ startlinje for historieoppføring (uten innledende kommentar):" #: smalldialogs.cpp:453 msgid "" "Copy a history entry start line as used in your files,\n" "but omit the leading comment." msgstr "" +"Kopier en startlinje for historieoppføring fra en av filene dine,\n" +"men ta bort den innledende kommentaren." #: smalldialogs.cpp:468 msgid "Sort key result:" -msgstr "" +msgstr "Resulterende sorteringsnøkler:" #: smalldialogs.cpp:519 smalldialogs.cpp:529 smalldialogs.cpp:550 msgid "Match success." -msgstr "" +msgstr "Tilslag." #: smalldialogs.cpp:523 smalldialogs.cpp:533 smalldialogs.cpp:556 msgid "Match failed." -msgstr "" +msgstr "Ikke tilslag." #: smalldialogs.cpp:541 msgid "Opening and closing parentheses don't match in regular expression." -msgstr "" +msgstr "Begynn- og sluttparenteser stemmer ikke overens i regulært uttrykk." + +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Lagre status for mappefletting ..." + +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Last inn status for mappefletting ..." + +#~ msgid "Synchronize Directories" +#~ msgstr "Synkroniser mapper" + +#~ msgid "Copy Newer Files Instead of Merging" +#~ msgstr "Kopier nyere filer i stedet for Ã¥ flette" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/nl.po --- a/kdiff3/po/nl.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/nl.po Sat Nov 04 00:05:00 2006 +0000 @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-24 23:48+0200\n" "Last-Translator: Bram Schoenmakers \n" "Language-Team: Nederlands \n" @@ -72,7 +72,7 @@ "\n" "Dit commando zal nu worden uitgeschakeld." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -80,7 +80,7 @@ "Fout met dataverlies:\n" "Als dit reproduceerbaar is, neem dan contact op met de auteur.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Ernstige interne fout" @@ -267,7 +267,7 @@ msgid "Changing All Merge Operations" msgstr "Verandering van alle samenvoegingen" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "D&oorgaan" @@ -667,14 +667,6 @@ msgid "Unfold All Subdirs" msgstr "Alle submappen uitvouwen" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Staat van mappen samenvoegen opslaan..." - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "Staat van mappen samenvoegen laden..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Voor alle items A kiezen" @@ -747,7 +739,7 @@ msgid "Merge to A && B" msgstr "Samenvoegen met A && B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -756,7 +748,7 @@ "nieuwe reservekopie.\n" "Bestandsnaam: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -764,53 +756,53 @@ "Tijdens het aanmaken van een reservekopie is het hernoemen mislukt. \n" "Bestandsnamen: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Bestandstatus opvragen: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Bestand lezen: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Bestand schrijven: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Onvoldoende geheugen" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Map aanmaken: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Map verwijderen: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Bestand verwijderen: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Symbolische koppeling aanmaken: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Bestand hernoemen: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Bestand kopiëren: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -818,7 +810,7 @@ "Fout tijdens bestanden kopiëren: het openen van het bestand is mislukt.\n" "Bestandsnaam: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -826,25 +818,25 @@ "Fout tijdens bestanden kopiëren: het bestand kon niet worden opgeslagen.\n" "Bestandsnaam: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Fout tijdens bestanden kopiëren: het openen is mislukt.\n" "Bestandsnaam: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Fout tijdens bestanden kopiëren: het opslaan is mislukt.\n" "Bestandsnaam: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Map lezen: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Map inlezen: %1" @@ -1190,11 +1182,11 @@ msgid "Toggle the statusbar..." msgstr "Statusbalk aan/uit..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "De bestanden om te vergelijken zijn niet gevonden." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1300,14 +1292,14 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "En iedereen bedankt die fouten heeft gemeld en met ideeën kwam!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Aantal overgebleven onopgeloste conflicten: %1 (waarvan %2 witruimtes zijn)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1315,55 +1307,55 @@ "De uitvoer is gewijzigd.\n" "Als u verder gaat zullen uw wijzigingen verloren gaan." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Alle invoerbestanden zijn binair gelijk." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Alle invoerbestanden bevatten dezelfde tekst." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Bestanden A en B zijn binair gelijk.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Bestanden A en B hebben dezelfde tekst.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Bestanden A en C zijn binair gelijk.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Bestanden A en C hebben dezelfde tekst.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Bestanden B en C zijn binair gelijk.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Bestanden B en C hebben dezelfde tekst.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Totaal aantal conflicten: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1371,7 +1363,7 @@ "\n" "Aantal automatisch opgeloste conflicten: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1379,31 +1371,31 @@ "\n" "Aantal onopgeloste conflicten: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Conflicten" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Uitvoer" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Gewijzigd]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1411,11 +1403,11 @@ "Nog niet alle conflicten zijn opgelost.\n" "Bestand is niet opgeslagen.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Er zijn nog onopgeloste conflicten" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1425,11 +1417,11 @@ "\n" "Het aanmaken van de reservekopie is mislukt. Het bestand is niet opgeslagen." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Fout bij opslaan van het bestand" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Fout bij het opslaan." @@ -2081,11 +2073,11 @@ msgid "Regional Settings" msgstr "Regionale instellingen" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Taal (herstart vereist)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2093,11 +2085,11 @@ "Kies de taal voor de GUI-tekst, of \"Auto\".\n" "Om de taal te wijzigen dient u KDiff3 te herstarten." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Dezelfde codering gebruiken voor alles:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2106,35 +2098,35 @@ "passen.\n" "Schakel dit uit als er verschillende individuele instellingen nodig zijn." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Opmerking: lokale codering is " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Bestandscodering voor A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Bestandscodering voor B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Bestandscodering voor C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Bestandscodering voor samenvoeguitvoer en opslag:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Bestandscodering voor preprocessorbestanden:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Rechts-naar-links-taal" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2142,19 +2134,19 @@ "Sommige talen worden van rechts naar links gelezen.\n" "Deze instelling zal de viewer en editor hierop aanpassen." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Integratie" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Integratie-instellingen" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Te negeren commandoregelopties:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2167,7 +2159,7 @@ "';'\n" "Dit onderdrukt de foutmelding \"Onbekende optie\"." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2183,19 +2175,19 @@ "\n" "Wilt u doorgaan, of wilt u een ander lettertype selecteren?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Incompatibel lettertype" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Doorgaan op eigen risico" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Ander lettertype kiezen" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Dit zet alle opties terug, niet alleen die van het huidige onderwerp." @@ -2335,11 +2327,11 @@ msgid "Search Complete" msgstr "Zoeken voltooid" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "Er is niets geselecteerd in beide invoervensters voor de vergelijking." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Fout bij het toevoegen van handmatig vergelijkingsbereik" @@ -2531,3 +2523,9 @@ msgid "Opening and closing parentheses don't match in regular expression." msgstr "" "Er zijn niet evenveel openings- als sluitingshaakjes in de reguliere expressie." + +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Staat van mappen samenvoegen opslaan..." + +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Staat van mappen samenvoegen laden..." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/pl.po --- a/kdiff3/po/pl.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/pl.po Sat Nov 04 00:05:00 2006 +0000 @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-12-30 14:10+0100\n" "Last-Translator: Robert Gomulka \n" "Language-Team: polish \n" @@ -74,7 +74,7 @@ "\n" "Polecenie przetwarzenia wstÄ™pnego dopasowywania wierszy zostanie wyłączone." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -82,7 +82,7 @@ "Błąd utraty danych:\n" "JeÅ›li jest powtarzalny, to skontaktuj siÄ™ z autorem programu.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Poważny błąd wewnÄ™trzny" @@ -270,7 +270,7 @@ msgid "Changing All Merge Operations" msgstr "Zmiana wszystkich operacji łączenia" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "K&ontynuuj" @@ -660,16 +660,6 @@ msgid "Unfold All Subdirs" msgstr "Nie uwzglÄ™dniaj podkatalogów" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Połączenia katalogów" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Połączenia katalogów" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Wybierz A dla wszystkich pozycji" @@ -745,7 +735,7 @@ msgid "Merge to A && B" msgstr "Połącz z A i B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -753,7 +743,7 @@ "Błąd w trakcie wykonywania kopii zapasowej. Nieudane kasowanie starej kopii. \n" "Nazwa pliku: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -761,60 +751,60 @@ "Błąd w trakcie wykonywania kopii zapasowej. Nieudana zmiana nazwy. \n" "Nazwa plików: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Pobranie statusu pliku: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Czytanie pliku: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Zapisywanie pliku: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Brak pamiÄ™ci" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Tworzenie katalogu: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Usuwanie katalogu: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Usuwanie pliku: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Tworzenie dowiÄ…zania symbolicznego:%1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Zmiana nazwy pliku: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Kopiowanie pliku: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" "Błąd podczas kopiowania pliku: Nieudane otwarcie pliku. Nazwa pliku: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -822,21 +812,21 @@ "Błąd podczas kopiowania pliku: Nieudane otwarcie pliku do zapisu. Nazwa pliku: " "%1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Błąd w czasie kopiowania. Nieudany odczyt. Nazwa pliku: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Błąd w czasie kopiowania. Nieudany zapis. Nazwa pliku: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Czytanie katalogu: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "WyÅ›wietlenie zawartoÅ›ci katalogu: %1" @@ -1189,11 +1179,11 @@ msgid "Toggle the statusbar..." msgstr "Przełączanie paska statusu..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Nie można znaleźć plików do porównania." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1299,15 +1289,15 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "+ Wielkie dziÄ™ki zgÅ‚aszajÄ…cym błędy i wnoszÄ…cym nowe pomysÅ‚y!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Liczba pozostaÅ‚ych nie rozwiÄ…zanych konfliktów: %1 (z których %2 dotyczy znaków " "odstÄ™pu)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1315,55 +1305,55 @@ "Plik wyjÅ›ciowy zostaÅ‚ zmieniony.\n" "JeÅ›li bÄ™dziesz kontynuować zmiany zostanÄ… utracone." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Wszystkie pliki wejÅ›ciowe sÄ… binarnie równe." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Wszystkie wejÅ›ciowe pliki zawierajÄ…c ten sam tekst." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Pliki A i B sÄ… binarnie identyczne.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Pliki A i B majÄ… identyczny tekst.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Pliki A i C sÄ… binarnie identyczne.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Pliki A i C majÄ… identyczny tekst.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Pliki B i C sÄ… binarnie identyczne.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Pliki B i C majÄ… identyczny tekst. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "CaÅ‚kowita liczba konfliktów: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1371,7 +1361,7 @@ "\n" "Liczba automatycznie rozwiÄ…zanych konfliktów: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1379,31 +1369,31 @@ "\n" "Liczba nie rozwiÄ…zanych konfliktów: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Konflikty" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "WyjÅ›cie" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[zmodyfikowane]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1411,11 +1401,11 @@ "Nie wszystkie konflikty zostaÅ‚y rozwiÄ…zane.\n" "Plik nie zostaÅ‚ zapisany.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "PozostaÅ‚e konflikty" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1425,11 +1415,11 @@ "\n" "Tworzenie pliku zapasowego nie powiodÅ‚o siÄ™. Plik nezapisany." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Błąd zapisu pliku" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Błąd w czasie zapisu." @@ -2044,11 +2034,11 @@ msgid "Regional Settings" msgstr "Ustawienia regionalne" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "JÄ™zyk(wymaga ponownego uruchomienia)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2056,11 +2046,11 @@ "Wybierz jÄ™zyk dla GUI lub ustaw na\"Automatycznie\". \n" "Po zmianie jÄ™zyka należy uruchomić ponownie KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Używanie tego samego kodowania dla wszystkiego:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2069,35 +2059,35 @@ "pierwsze. \n" "ProszÄ™ wyłączyć jeÅ›li potrzebne sÄ… różne ustawienia indywidualne. " -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Uwaga: lokalne kodowanie to " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Kodowanie pliku A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Kodowanie pliku B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Kodowanie pliku C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Kodowanie pliku wynikowego i przy zapisywaniu:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Kodowanie plików preprocesora:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "JÄ™zyk z pismem prawy-do-lewego" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2105,21 +2095,21 @@ "Niektóre jÄ™zyka pisze siÄ™ od prawej strony do lewej. \n" "Ustawienie to zmieni odpowiednio za równo przeglÄ…darkÄ™ jak i edutor." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Operacja" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Ustawienia regionalne" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2127,7 +2117,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2143,19 +2133,19 @@ "\n" "Chcesz kontynuować czy też wybrać innÄ… czcionkÄ™." -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Niekompatybilna czcionka" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Kontynuacja na wÅ‚asne ryzyko" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Wybierz innÄ… czcionkÄ™" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Kasuje wszystkie ustawienia. DziaÅ‚a nie tylko na bieżącej zakÅ‚adce." @@ -2296,11 +2286,11 @@ msgid "Search Complete" msgstr "Połączenie zakoÅ„czone" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Błąd w trakcie tworzenia katalogu." @@ -2487,6 +2477,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Połączenia katalogów" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Połączenia katalogów" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Synchronizacja katalogów" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/pt.po --- a/kdiff3/po/pt.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/pt.po Sat Nov 04 00:05:00 2006 +0000 @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-10 17:08+0100\n" "Last-Translator: Pedro Morais \n" "Language-Team: pt \n" @@ -10,6 +10,7 @@ "Content-Transfer-Encoding: 8bit\n" "X-POFile-SpellExtra: LF return Dif carriage ms diff CR KDiff cvsignore\n" "X-POFile-SpellExtra: orig Log\n" +"X-POFile-IgnoreConsistency: End\n" #: _translatorinfo.cpp:1 msgid "" @@ -57,7 +58,7 @@ " %1\n" "O comando de pré-processamento com procura de linhas vai ser desactivado." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -65,7 +66,7 @@ "Erro de perda de dados:\n" "Se for reprodutível, contacte por favor o autor.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Erro Interno Grave" @@ -252,7 +253,7 @@ msgid "Changing All Merge Operations" msgstr "A Mudar Todas as Operações de Junção" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "C&ontinuar" @@ -641,14 +642,6 @@ msgid "Unfold All Subdirs" msgstr "Expandir Todas as Sub-Pastas" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Gravar o Estado da Junção de Pastas..." - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "Carregar o Estado da Junção de Pastas..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Seleccionar Todos os Itens do A" @@ -721,7 +714,7 @@ msgid "Merge to A && B" msgstr "Juntar a A e B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -730,7 +723,7 @@ "\n" "Ficheiro: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -738,53 +731,53 @@ "Ao tentar fazer uma cópia de segurança, a mudança de nome falhou. \n" "Ficheiros: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "A obter o estado do ficheiro: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "A ler o ficheiro: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "A escrever o ficheiro: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Sem memória" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "A criar a pasta: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "A remover a pasta: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "A remover o ficheiro. %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "A criar a ligação simbólica: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "A mudar o nome do ficheiro: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "A copiar o ficheiro: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -792,7 +785,7 @@ "Erro durante a operação de cópia do ficheiro: O acesso ao ficheiro para leitura " "falhou. Ficheiro: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -800,23 +793,23 @@ "Erro durante a operação de cópia do ficheiro: O acesso ao ficheiro para escrita " "falhou. Ficheiro: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Erro durante a operação de cópia do ficheiro: A leitura falhou. Ficheiro: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Erro durante a operação de cópia do ficheiro: A escrita falhou. Ficheiro: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "A ler a pasta: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "A analisar a pasta: %1" @@ -1166,11 +1159,11 @@ msgid "Toggle the statusbar..." msgstr "Comutar a barra de estado..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Não foi possível encontrar os ficheiros a comparar." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1276,14 +1269,14 @@ msgstr "" "Muitos agradecimentos a todos os que comunicaram erros e contribuíram ideias!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Número de conflitos por resolver: %1 (dos quais %2 são espaço em branco)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1291,55 +1284,55 @@ "O resultado foi modificado.\n" "Se você continuar as suas alterações serão perdidas." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Todos os ficheiros de entrada são iguais a nível binário." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Todos os ficheiros de entrada contêm o mesmo texto." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Os ficheiros A e B são iguais a nível binário.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Os ficheiros A e B têm texto igual.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Os ficheiros A e C são iguais a nível binário.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Os ficheiros A e C têm texto igual.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Os ficheiros B e C são iguais a nível binário.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Os ficheiros B e C têm texto igual.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Número total de conflitos: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1347,7 +1340,7 @@ "\n" "Número total de conflitos resolvidos automaticamente: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1355,31 +1348,31 @@ "\n" "Número de conflitos por resolver: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Conflitos" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Resultado" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Modificado]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1387,11 +1380,11 @@ "Nem todos os conflitos estão ainda resolvidos.\n" "O ficheiro não foi gravado.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Conflitos Restantes" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1401,11 +1394,11 @@ "\n" "A criação de salvaguarda falhou. Ficheiro não gravado." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Erro na Gravação do Ficheiro" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Erro ao gravar." @@ -2054,11 +2047,11 @@ msgid "Regional Settings" msgstr "Configuração Regional" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Língua (necessário reiniciar)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2066,11 +2059,11 @@ "Escolha a língua da interface gráfica ou \"Auto\".\n" "Para mudar de língua tem que reiniciar o KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Utilizar a mesma codificação para tudo:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2079,35 +2072,35 @@ "primeira.\n" "Torne inactivo se forem necessárias opções individuais." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Nota: A codificação local é" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Codificação do Ficheiro A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Codificação do Ficheiro B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Codificação do Ficheiro C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Codificação do Ficheiro para Junção de Resultado e Gravação:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Codificação do Ficheiro dos Ficheiros de Pré-processador:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Língua da Direita para a Esquerda" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2115,19 +2108,19 @@ "Algumas línguas são lidas da direita para esquerda.\n" "Esta opção muda o visualizador e editor de acordo com elas." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Integração" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Configuração da Integração" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Opções da linha de comandos a ignorar:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2139,7 +2132,7 @@ "Se desejar indicar vários valores, separe-os por ';'\n" "Isto irá eliminar o erro de \"Opção desconhecida\"." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2155,19 +2148,19 @@ "\n" "Deseja continuar ou prefere seleccionar outro tipo de letra." -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Tipo de Letra Incompatível" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Continuar à Mesma" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Seleccionar Outro Tipo de Letra" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Isto repõe todas as opções, não só as do tópico actual." @@ -2308,12 +2301,12 @@ msgid "Search Complete" msgstr "Procura Terminada" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" "Não está nada seleccionado em nenhuma janela de entrada das diferenças." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Erro ao adicionar o intervalo manual de diferenças" @@ -2503,3 +2496,9 @@ msgid "Opening and closing parentheses don't match in regular expression." msgstr "" "Os parêntesis de abertura e fecho não correspondem na expressão regular." + +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Gravar o Estado da Junção de Pastas..." + +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Carregar o Estado da Junção de Pastas..." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/pt_BR.po --- a/kdiff3/po/pt_BR.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/pt_BR.po Sat Nov 04 00:05:00 2006 +0000 @@ -8,34 +8,36 @@ # translation of kdiff3.po to # translation of kdiff3.po to # translation of kdiff3.po to -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006 Free Software Foundation, Inc. +# # Paulo Henrique Alkmin da Costa , 2003. # Lisiane Sztoltz , 2003. # Lisiane Sztoltz Teixeira , 2004. -# +# Diniz Fernando Bortolotto Ferreira , 2006. msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" -"PO-Revision-Date: 2004-06-29 13:57-0300\n" -"Last-Translator: Lisiane Sztoltz Teixeira \n" -"Language-Team: Brazilian Portuguese \n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-07-14 23:11-0300\n" +"Last-Translator: Diniz Fernando Bortolotto Ferreira \n" +"Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.3.1\n" +"X-Generator: KBabel 1.11.2\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #: _translatorinfo.cpp:1 msgid "" "_: NAME OF TRANSLATORS\n" "Your names" -msgstr "Paulo Henrique Alkmin da Costa " +msgstr "Paulo Henrique Alkmin da Costa, Diniz Bortolotto" #: _translatorinfo.cpp:3 msgid "" "_: EMAIL OF TRANSLATORS\n" "Your emails" -msgstr "phalkmin@yahoo.com.br" +msgstr "phalkmin@yahoo.com.br, diniz.bb@gmail.com" #: diff.cpp:245 msgid "Writing clipboard data to temp file failed." @@ -54,11 +56,11 @@ "\n" "The preprocessing command will be disabled now." msgstr "" -"O pré-processamento possivelmente teve uma falha. Verifique este comando:\n" +"O pré-processamento possivelmente falhou. Verifique este comando:\n" "\n" " %1\n" "\n" -"O comando de pré-processamento será desabilitado agora." +"O comando de pré-processamento vai ser desativado." #: diff.cpp:486 msgid "" @@ -68,33 +70,32 @@ "\n" "The line-matching-preprocessing command will be disabled now." msgstr "" -"O pré-processamento de coincidência de linha possivelmente falhou. Verifique " -"este comando:\n" +"O pré-processamento com procura de linhas possivelmente falhou. Verifique este " +"comando:\n" "\n" " %1\n" "\n" -"O pré-processamento de coincidência de linha será desabilitado agora." - -#: diff.cpp:1617 diff.cpp:1631 +"O comando de pré-processamento com procura de linhas vai ser desativado." + +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" "Erro de perda de dados:\n" -" Se o erro puder ser reproduzido, contate o autor.\n" - -#: diff.cpp:1619 diff.cpp:1633 +"Se for reproduzível por favor contate o autor.\n" + +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" -msgstr "Erro Interno Severo" +msgstr "Erro Interno Grave" #: difftextwindow.cpp:1637 kdiff3.cpp:743 -#, fuzzy msgid "Top line" -msgstr "Linha %1" +msgstr "Linha de topo" #: difftextwindow.cpp:1647 msgid "End" -msgstr "Final" +msgstr "Fim" #: directorymergewindow.cpp:142 msgid "Mix of links and normal files." @@ -102,37 +103,36 @@ #: directorymergewindow.cpp:149 msgid "Link: " -msgstr "Link:" +msgstr "Link: " #: directorymergewindow.cpp:157 msgid "Size. " -msgstr "Tamanho" +msgstr "Tamanho. " #: directorymergewindow.cpp:170 msgid "Date & Size: " -msgstr "Data & Tamanho" +msgstr "Data e Tamanho: " #: directorymergewindow.cpp:179 directorymergewindow.cpp:185 msgid "Creating temp copy of %1 failed." -msgstr "Criação da cópia temporário de %1 falhou." +msgstr "A criação da cópia temporária de %1 falhou." #: directorymergewindow.cpp:196 directorymergewindow.cpp:204 msgid "Opening %1 failed." -msgstr "Abertura %1 falhou." +msgstr "O acesso a %1 falhou." #: directorymergewindow.cpp:208 -#, fuzzy msgid "Comparing file..." -msgstr "Comparando arquivo...." +msgstr "Comparando arquivo..." #: directorymergewindow.cpp:218 directorymergewindow.cpp:224 #, c-format msgid "Error reading from %1" -msgstr "Erro de leitura de %1" +msgstr "Erro ao ler de %1" #: directorymergewindow.cpp:282 msgid "Name" -msgstr "Nomelinks" +msgstr "Nome" #: directorymergewindow.cpp:286 msgid "Operation" @@ -144,7 +144,7 @@ #: directorymergewindow.cpp:288 msgid "Unsolved" -msgstr "Sem solução" +msgstr "Não resolvido" #: directorymergewindow.cpp:289 msgid "Solved" @@ -152,23 +152,23 @@ #: directorymergewindow.cpp:290 msgid "Nonwhite" -msgstr "Diferente de branco" +msgstr "Não vazio" #: directorymergewindow.cpp:291 msgid "White" -msgstr "Branco" +msgstr "Vazio" #: directorymergewindow.cpp:319 msgid "" "You are currently doing a directory merge. Are you sure, you want to abort the " "merge and rescan the directory?" msgstr "" -"Você está tentando fazer uma mesclagem de pastas. Você tem certeza de que " -"deseja mesclar e rescanear a pasta?" +"Você está neste momento fazendo uma mesclagem de diretórios. Tem certeza que " +"deseja interromper a mesclagem e analisar o diretório de novo?" #: directorymergewindow.cpp:320 directorymergewindow.cpp:2864 msgid "Rescan" -msgstr "Rescanear" +msgstr "Pesquisar de Novo" #: directorymergewindow.cpp:320 kdiff3.cpp:594 pdiff.cpp:965 msgid "Continue Merging" @@ -176,29 +176,29 @@ #: directorymergewindow.cpp:462 msgid "Opening of directories failed:" -msgstr "Abertura de pastas falhou:" +msgstr "Abertura de diretórios falhou:" #: directorymergewindow.cpp:465 msgid "" "Dir A \"%1\" does not exist or is not a directory.\n" msgstr "" -"A \"%1\" não existe ou não é uma pasta.\n" +"Dir A \"%1\" não existe ou não é um diretório.\n" #: directorymergewindow.cpp:468 msgid "" "Dir B \"%1\" does not exist or is not a directory.\n" msgstr "" -"B \"%1\"não existe ou não é uma pasta.\n" +"Dir B \"%1\" não existe ou não é um diretório.\n" #: directorymergewindow.cpp:471 msgid "" "Dir C \"%1\" does not exist or is not a directory.\n" msgstr "" -"C \"%1\"não existe ou não é um pasta.\n" +"Dir C \"%1\" não existe ou não é um diretório.\n" #: directorymergewindow.cpp:473 msgid "Directory Open Error" -msgstr "Erro na abertura da pasta" +msgstr "Erro na abertura do Diretório" #: directorymergewindow.cpp:481 msgid "" @@ -206,56 +206,55 @@ "are merged.\n" "Check again before continuing." msgstr "" -"A pasta de destino não pode ser a mesma que A ou B quando três pastas estão " -"sendo mescladas.\n" -" Cheque novamente antes de continuar" +"O diretório de destino não pode ser o mesmo que A ou B quando são mesclados " +"três diretórios.\n" +"Verifique de novo antes de continuar." #: directorymergewindow.cpp:483 msgid "Parameter Warning" msgstr "Aviso de Parâmetro" #: directorymergewindow.cpp:488 -#, fuzzy msgid "Scanning directories..." -msgstr "Varrendo pastas..." +msgstr "Pesquisando diretórios..." #: directorymergewindow.cpp:537 msgid "Reading Directory A" -msgstr "Lendo Pasta A" +msgstr "Lendo Diretório A" #: directorymergewindow.cpp:559 msgid "Reading Directory B" -msgstr "Lendo Pasta B" +msgstr "Lendo Diretório B" #: directorymergewindow.cpp:581 msgid "Reading Directory C" -msgstr "Lendo Pasta C" +msgstr "Lendo Diretório C" #: directorymergewindow.cpp:607 msgid "Some subdirectories were not readable in" -msgstr "Alguns sub-pastas não são legíveis em " +msgstr "Alguns sub-diretórios não eram legíveis" #: directorymergewindow.cpp:612 msgid "Check the permissions of the subdirectories." -msgstr "Cheque as permissões dos sub-pastas." +msgstr "Verifique as permissões dos sub-diretórios." #: directorymergewindow.cpp:646 kdiff3.cpp:547 kdiff3.cpp:627 kdiff3.cpp:651 #: kdiff3.cpp:924 kdiff3.cpp:945 pdiff.cpp:1045 pdiff.cpp:1117 pdiff.cpp:1155 #: pdiff.cpp:1171 pdiff.cpp:1201 pdiff.cpp:1212 msgid "Ready." -msgstr "Pronto" +msgstr "Pronto." #: directorymergewindow.cpp:660 msgid "Directory Comparison Status" -msgstr "Estado da Comparação de Pastas" +msgstr "Estado da Comparação de Diretório" #: directorymergewindow.cpp:661 msgid "Number of subdirectories:" -msgstr "-Número de sub-pastas:" +msgstr "Número de sub-diretórios:" #: directorymergewindow.cpp:662 msgid "Number of equal files:" -msgstr "Número de arquivos iguais: " +msgstr "Número de arquivos iguais:" #: directorymergewindow.cpp:663 msgid "Number of different files:" @@ -267,23 +266,23 @@ #: directorymergewindow.cpp:802 msgid "This affects all merge operations." -msgstr "Isso afetará todas as operações de mesclagem." +msgstr "Isto afeta todas as operações de mesclagem." #: directorymergewindow.cpp:803 msgid "Changing All Merge Operations" -msgstr "Mudando todas operações de Mesclagem" - -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +msgstr "Mudando Todas as Operações de Mesclagem" + +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "C&ontinuar" #: directorymergewindow.cpp:1169 msgid "Processing " -msgstr "Processando" +msgstr "Processando " #: directorymergewindow.cpp:1644 directorymergewindow.cpp:1650 msgid "To do." -msgstr "Para Fazer" +msgstr "Fazer." #: directorymergewindow.cpp:1752 directorymergewindow.cpp:2895 msgid "Copy A to B" @@ -303,19 +302,19 @@ #: directorymergewindow.cpp:1756 msgid "Delete A & B" -msgstr "Apagar A & B" +msgstr "Apagar A e B" #: directorymergewindow.cpp:1757 directorymergewindow.cpp:2900 msgid "Merge to A" -msgstr "Mesclar para A" +msgstr "Mesclar com A" #: directorymergewindow.cpp:1758 directorymergewindow.cpp:2901 msgid "Merge to B" -msgstr "Mesclar para B" +msgstr "Mesclar com B" #: directorymergewindow.cpp:1759 msgid "Merge to A & B" -msgstr "Mesclar para A & B" +msgstr "Mesclar com A e B" #: directorymergewindow.cpp:1763 directorymergewindow.cpp:2892 msgid "Delete (if exists)" @@ -332,21 +331,21 @@ #: directorymergewindow.cpp:1766 msgid "Error: Conflicting File Types" -msgstr "Erro: Tipos de Arquivos Conflitantes" +msgstr "Erro: Tipos de Arquivos em Conflito" #: directorymergewindow.cpp:1767 msgid "Error: Dates are equal but files are not." -msgstr "Erro: Datas são iguais, mas os arquivos diferem." +msgstr "Erro: As datas são iguais mas os arquivos não." #: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 #: directorymergewindow.cpp:1845 msgid "This operation is currently not possible." -msgstr "Essa operação não é possível no momento." +msgstr "Esta operação não é possível no momento." #: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 #: directorymergewindow.cpp:1845 directorymergewindow.cpp:2102 msgid "Operation Not Possible" -msgstr "A Operação Não É Possível" +msgstr "Operação Não Possível" #: directorymergewindow.cpp:1884 msgid "" @@ -356,15 +355,15 @@ "\n" "If you know how to reproduce this, please contact the program author." msgstr "" -"Esse não deve acontecer nunca: \n" +"Isto nunca deve acontecer:\n" "\n" "mergeResultSaved: m_pMFI=0\n" "\n" -"Se você souber como reproduzir isso, contacte o autor." +"Se souber como reproduzir isto, contate por favor o autor do programa." #: directorymergewindow.cpp:1884 msgid "Program Error" -msgstr "Erro do Programa" +msgstr "Erro no Programa" #: directorymergewindow.cpp:1895 msgid "" @@ -374,7 +373,7 @@ #: directorymergewindow.cpp:1896 directorymergewindow.cpp:2302 msgid "Merge Error" -msgstr "Erro de Mesclagem" +msgstr "Erro na Mesclagem" #: directorymergewindow.cpp:1901 directorymergewindow.cpp:2307 msgid "Error." @@ -383,7 +382,7 @@ #: directorymergewindow.cpp:1906 directorymergewindow.cpp:2198 #: directorymergewindow.cpp:2238 msgid "Done." -msgstr "Concluído." +msgstr "Terminado." #: directorymergewindow.cpp:1929 msgid "Not saved." @@ -391,11 +390,11 @@ #: directorymergewindow.cpp:1964 msgid "Unknown merge operation. (This must never happen!)" -msgstr "Operação de Mesclagem desconhecida. (Isso nunca deve acontecer!)" +msgstr "Operação de mesclagem desconhecida. (Isto nunca deve acontecer!)" #: directorymergewindow.cpp:1996 msgid "Unknown merge operation." -msgstr "Operação de Mesclagem desconhecida." +msgstr "Operação de mesclagem desconhecida." #: directorymergewindow.cpp:2011 msgid "" @@ -413,12 +412,12 @@ "Escolha \"Faça\" se você leu as instruções e sabe o que está fazendo.\n" "Escolhendo \"Simular\" você verá o que irá acontecer.\n" "\n" -" Saiba que esse programa ainda está em fase beta, e não Hà GARANTIA alguma! " +" Saiba que esse programa ainda está em fase beta, e NÃO Hà GARANTIA alguma! " "Faça backups dos seus dados!" #: directorymergewindow.cpp:2016 msgid "Starting Merge" -msgstr "Iniciando mesclagem" +msgstr "Iniciando Mesclagem" #: directorymergewindow.cpp:2016 msgid "Do It" @@ -433,8 +432,8 @@ "The highlighted item has a different type in the different directories. Select " "what to do." msgstr "" -"O item selecionado tem um tipo diferente em diferentes pastas. Selecione o que " -"fazer." +"O item selecionado tem um tipo diferente nos diferentes diretórios. Selecione o " +"que fazer." #: directorymergewindow.cpp:2051 msgid "" @@ -449,8 +448,8 @@ "This operation is currently not possible because directory merge is currently " "running." msgstr "" -"Essa operação não é possível porque a mesclagem de pastas atualmente está sendo " -"executada." +"Esta operação não é possível no momento porque uma mesclagem de diretório está " +"em execução." #: directorymergewindow.cpp:2162 msgid "" @@ -467,11 +466,11 @@ #: directorymergewindow.cpp:2164 msgid "Continue With Last Item" -msgstr "Continuar com último item" +msgstr "Continuar com o Último Item" #: directorymergewindow.cpp:2164 msgid "Skip Item" -msgstr "Ignorar Item" +msgstr "Pular Item" #: directorymergewindow.cpp:2198 msgid "Skipped." @@ -493,22 +492,22 @@ msgid "" "Simulated merge complete: Check if you agree with the proposed operations." msgstr "" -"Simulação da Mesclagem completa: Verifique se você concorda com as operações " -"propostas" +"A simulação de mesclagem terminou: Verifique se concorda com as operações " +"propostas." #: directorymergewindow.cpp:2301 msgid "" "An error occurred. Press OK to see detailed information.\n" msgstr "" -"Ocorreu um erro. Pressione OK para visualizar mais informações.\n" +"Ocorreu um erro. Pressione OK para ver informações detalhadas.\n" #: directorymergewindow.cpp:2344 msgid "Error: While deleting %1: Creating backup failed." -msgstr "Erro: Ao apagar %1: Criação do backup falhou." +msgstr "Erro: Ao tentar apagar %1: Criação da cópia de segurança falhou." #: directorymergewindow.cpp:2351 msgid "delete directory recursively( %1 )" -msgstr "apagar pasta recursivamente( %1 )" +msgstr "apagar diretório recursivamente( %1 )" #: directorymergewindow.cpp:2353 msgid "delete( %1 )" @@ -516,29 +515,30 @@ #: directorymergewindow.cpp:2368 msgid "Error: delete dir operation failed while trying to read the directory." -msgstr "Erro: operação de exclusão falhou ao tentar ler a pasta." +msgstr "" +"Erro: a operação de remoção de diretório falhou quando tentava ler o diretório." #: directorymergewindow.cpp:2387 msgid "Error: rmdir( %1 ) operation failed." -msgstr "Erro: rmdir( %1 ) falhou." +msgstr "Erro: rmdir( %1 ) operação falhou." #: directorymergewindow.cpp:2397 msgid "Error: delete operation failed." -msgstr "Erro: Operação de exclusão falhou." +msgstr "Erro: a operação de remoção falhou." #: directorymergewindow.cpp:2423 msgid "manual merge( %1, %2, %3 -> %4)" -msgstr "mesclagem manual( %1, %2,%3 -> %4)" +msgstr "mesclagem manual( %1, %2, %3 -> %4)" #: directorymergewindow.cpp:2426 msgid "" " Note: After a manual merge the user should continue by pressing F7." msgstr "" -" Nota: Após uma mesclagem manual o usuário deverá continuar via F7." +" Nota: Após uma mesclagem manual o usuário deve continuar pressionando F7." #: directorymergewindow.cpp:2449 msgid "Error: copy( %1 -> %2 ) failed.Deleting existing destination failed." -msgstr "Erro: cópia( %1 -> %2 ) falhou. Remoção do destino falhou." +msgstr "Erro: cópia( %1 -> %2 ) falhou. Remoção do destino existente falhou." #: directorymergewindow.cpp:2459 msgid "copyLink( %1 -> %2 )" @@ -546,11 +546,11 @@ #: directorymergewindow.cpp:2470 msgid "Error: copyLink failed: Remote links are not yet supported." -msgstr "Erro: copyLink falhou: Ligações remotas não são suportadas." +msgstr "Erro: copyLink falhou: Ligações remotas ainda não são suportadas." #: directorymergewindow.cpp:2476 msgid "Error: copyLink failed." -msgstr "Erro: copyLink falhou" +msgstr "Erro: copyLink falhou." #: directorymergewindow.cpp:2496 msgid "copy( %1 -> %2 )" @@ -559,7 +559,7 @@ #: directorymergewindow.cpp:2522 msgid "Error during rename( %1 -> %2 ): Cannot delete existing destination." msgstr "" -"Erro durante renomear( %1 -> %2): Não foi possível apagar destino existente." +"Erro durante renomear( %1 -> %2 ): Não é possível remover o destino existente." #: directorymergewindow.cpp:2528 msgid "rename( %1 -> %2 )" @@ -567,12 +567,12 @@ #: directorymergewindow.cpp:2537 msgid "Error: Rename failed." -msgstr "Erro: renomear falhou." +msgstr "Erro: Renomear falhou." #: directorymergewindow.cpp:2555 msgid "Error during makeDir of %1. Cannot delete existing file." msgstr "" -"Erro durante makeDir of %1. Não foi possível apagar o arquivo existente." +"Erro durante makeDir de %1. Não foi possível remover o arquivo existente." #: directorymergewindow.cpp:2571 msgid "makeDir( %1 )" @@ -580,7 +580,7 @@ #: directorymergewindow.cpp:2581 msgid "Error while creating directory." -msgstr "Erro ao criar a pasta." +msgstr "Erro ao criar diretório." #: directorymergewindow.cpp:2604 directorymergewindow.cpp:2721 msgid "Dest" @@ -612,7 +612,7 @@ #: directorymergewindow.cpp:2663 msgid "not available" -msgstr "Não disponível" +msgstr "não disponível" #: directorymergewindow.cpp:2683 msgid "A (Dest): " @@ -635,17 +635,16 @@ msgstr "Destino: " #: directorymergewindow.cpp:2771 -#, fuzzy msgid "Save Directory Merge State As..." -msgstr "Mesclagem de Pastas" +msgstr "Salvar o Estado da Mesclagem de Diretório Como..." #: directorymergewindow.cpp:2858 msgid "Start/Continue Directory Merge" -msgstr "Inicia/Continua Mesclagem de Pastas" +msgstr "Iniciar/Continuar Mesclagem de Diretório" #: directorymergewindow.cpp:2859 msgid "Run Operation for Current Item" -msgstr "Executar operação para o Item Atual" +msgstr "Executar Operação para o Item Atual" #: directorymergewindow.cpp:2860 msgid "Compare Selected File" @@ -653,80 +652,67 @@ #: directorymergewindow.cpp:2861 msgid "Merge Current File" -msgstr "Mesclar arquivo atual" +msgstr "Mesclar Arquivo Atual" #: directorymergewindow.cpp:2862 msgid "Fold All Subdirs" -msgstr "Agrupar todas as Sub-pastas" +msgstr "Fechar Todos Sub-diretórios" #: directorymergewindow.cpp:2863 msgid "Unfold All Subdirs" -msgstr "Desagrupar todos as Sub-pastas" - -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Mesclagem de Pastas" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Mesclagem de Pastas" +msgstr "Expandir Todos Sub-diretórios" #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" -msgstr "Escolha A para Todos os Itens" +msgstr "Selecionar Todos os Itens de A" #: directorymergewindow.cpp:2868 msgid "Choose B for All Items" -msgstr "Escolha B para todos os Itens" +msgstr "Selecionar Todos os Itens de B" #: directorymergewindow.cpp:2869 msgid "Choose C for All Items" -msgstr "Escolha C para todos os Itens" +msgstr "Selecionar Todos os Itens de C" #: directorymergewindow.cpp:2870 msgid "Auto-Choose Operation for All Items" -msgstr "Auto-Escolhes Operação para todos os Itens" +msgstr "Escolher Automaticamente a Operação para Todos os Itens" #: directorymergewindow.cpp:2871 msgid "No Operation for All Items" -msgstr "Nenhuma operação para Todos os Itens" +msgstr "Nenhuma Operação para Todos os Itens" #: directorymergewindow.cpp:2876 msgid "Show Identical Files" -msgstr "" +msgstr "Mostrar Arquivos Idênticos" #: directorymergewindow.cpp:2877 -#, fuzzy msgid "Show Different Files" -msgstr "Número de arquivos diferentes:" +msgstr "Mostrar os Arquivos Diferentes" #: directorymergewindow.cpp:2878 msgid "Show Files only in A" -msgstr "" +msgstr "Mostrar Arquivos apenas em A" #: directorymergewindow.cpp:2879 msgid "Show Files only in B" -msgstr "" +msgstr "Mostrar Arquivos apenas em B" #: directorymergewindow.cpp:2880 msgid "Show Files only in C" -msgstr "" +msgstr "Mostrar Arquivos apenas em C" #: directorymergewindow.cpp:2884 -#, fuzzy msgid "Compare Explicitly Selected Files" -msgstr "Comparar Arquivo Selecionado" +msgstr "Comparar Explicitamente os Arquivos Selecionados" #: directorymergewindow.cpp:2885 -#, fuzzy msgid "Merge Explicitly Selected Files" -msgstr "Comparar Arquivo Selecionado" +msgstr "Mesclar Explicitamente os Arquivos Selecionados" #: directorymergewindow.cpp:2887 directorymergewindow.cpp:2894 msgid "Do Nothing" -msgstr "Não faça nada" +msgstr "Não Faça Nada" #: directorymergewindow.cpp:2888 msgid "A" @@ -741,86 +727,85 @@ msgstr "C" #: directorymergewindow.cpp:2899 -#, fuzzy msgid "Delete A && B" -msgstr "Apagar A & B" +msgstr "Apagar A e B" #: directorymergewindow.cpp:2902 -#, fuzzy msgid "Merge to A && B" -msgstr "Mesclar para A & B" - -#: fileaccess.cpp:563 +msgstr "Mesclar para A e B" + +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " msgstr "" -"Ao tentar fazer um backup, remoção de um backup antigo falhou. \n" -" Nome do Arquivo: " - -#: fileaccess.cpp:570 +"Ao tentar fazer uma cópia de segurança, a remoção de uma cópia anterior falhou. " +"\n" +"Nome do Arquivo: " + +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " msgstr "" -"Ao tentar fazer backup, renomeação falhou. \n" -" Nomes de Arquivos: " - -#: fileaccess.cpp:592 +"Ao tentar fazer uma cópia de segurança, a mudança de nome falhou. \n" +"Nome dos Arquivos: " + +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" -msgstr "Obter status do arquivo: %1" - -#: fileaccess.cpp:635 +msgstr "Obtendo status do arquivo: %1" + +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Lendo arquivo:%1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Gravando arquivo: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Memória insuficiente" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" -msgstr "Criando pasta: %1" - -#: fileaccess.cpp:754 +msgstr "Criando diretório: %1" + +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" -msgstr "Removendo pasta: %1" - -#: fileaccess.cpp:769 +msgstr "Removendo diretório: %1" + +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Removendo arquivo: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Criando link simbólico: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Renomeando arquivo: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Copiando arquivo: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" -"Erro durante a operação de cópia de arquivos: Abertura de arquivos para leitura " -"falhou. Nome do Arquivos: %1" - -#: fileaccess.cpp:867 +"Erro durante a operação de cópia de arquivo: Abertura de arquivo para leitura " +"falhou. Nome do Arquivo: %1" + +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -828,36 +813,34 @@ "Erro durante operação de cópia de arquivo: Abertura do arquivo para escrita " "falhou. Nome do Arquivo: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Erro durante operação de cópia de arquivo: Leitura falhou. Nome do Arquivo: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Erro durante operação de cópia de arquivo: Escrita falhou. Nome do Arquivo: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " -msgstr "Lendo pasta: " - -#: fileaccess.cpp:1316 +msgstr "Lendo diretório: " + +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" -msgstr "Listando pasta: %1" +msgstr "Listando diretório: %1" #: kdiff3.cpp:142 -#, fuzzy msgid "Current Configuration:" -msgstr "Operação de Sincronismo no item atual" +msgstr "Configuração Atual:" #: kdiff3.cpp:147 -#, fuzzy msgid "Config Option Error:" -msgstr "Erro na abertura do arquivo" +msgstr "Erro da Opção de Configuração:" #: kdiff3.cpp:187 msgid "Option --auto used, but no output file specified." @@ -865,7 +848,7 @@ #: kdiff3.cpp:318 msgid "Option --auto ignored for directory comparison." -msgstr "Opção --auto ignorada para comparação de pastas." +msgstr "Opção --auto ignorada para comparação de diretórios." #: kdiff3.cpp:354 msgid "Saving failed." @@ -894,7 +877,7 @@ #: kdiff3.cpp:422 msgid "Print the differences" -msgstr "" +msgstr "Imprimir as diferenças" #: kdiff3.cpp:424 msgid "Quits the application" @@ -902,7 +885,7 @@ #: kdiff3.cpp:426 msgid "Cuts the selected section and puts it to the clipboard" -msgstr "Recorta a seção selecionada e insera na Ãrea de Transferência" +msgstr "Recorta a seção selecionada e a coloca na Ãrea de Transferência" #: kdiff3.cpp:428 msgid "Copies the selected section to the clipboard" @@ -910,19 +893,19 @@ #: kdiff3.cpp:430 msgid "Pastes the clipboard contents to actual position" -msgstr "Cola o conteúdo da Ãrea de Transferência para a posição atual" +msgstr "Cola o conteúdo da área de transferência na posição atual" #: kdiff3.cpp:432 msgid "Select everything in current window" -msgstr "" +msgstr "Seleciona tudo na janela atual" #: kdiff3.cpp:434 msgid "Search for a string" -msgstr "Pesquisar por uma string" +msgstr "Procura por um texto" #: kdiff3.cpp:436 msgid "Search again for the string" -msgstr "Pesquisar novamente pela string" +msgstr "Procura de novo pelo texto" #: kdiff3.cpp:438 msgid "Enables/disables the toolbar" @@ -938,11 +921,11 @@ #: kdiff3.cpp:465 msgid "Go to Current Delta" -msgstr "Vá para o Delta atual" +msgstr "Vá para o Delta Atual" #: kdiff3.cpp:466 msgid "Go to First Delta" -msgstr "Vá para o primeiro Delta" +msgstr "Vá para o Primeiro Delta" #: kdiff3.cpp:467 msgid "Go to Last Delta" @@ -951,12 +934,16 @@ #: kdiff3.cpp:468 msgid "(Skips white space differences when \"Show White Space\" is disabled.)" msgstr "" +"(Ignora as diferenças de espaço em branco quando \"Mostrar os Espaços em " +"Branco\" está desativado.)" #: kdiff3.cpp:469 msgid "" "(Does not skip white space differences even when \"Show White Space\" is " "disabled.)" msgstr "" +"(Não ignora as diferenças de espaço em branco mesmo quando \"Mostrar os Espaços " +"em Branco\" está desativado.)" #: kdiff3.cpp:470 msgid "Go to Previous Delta" @@ -964,15 +951,15 @@ #: kdiff3.cpp:472 msgid "Go to Next Delta" -msgstr "Vá para o próximo Delta" +msgstr "Vá para o Próximo Delta" #: kdiff3.cpp:474 msgid "Go to Previous Conflict" -msgstr "Vá para o conflito anterior" +msgstr "Vá para o Conflito Anterior" #: kdiff3.cpp:476 msgid "Go to Next Conflict" -msgstr "Vá para o próximo conflito" +msgstr "Vá para o Próximo Conflito" #: kdiff3.cpp:478 msgid "Go to Previous Unsolved Conflict" @@ -997,20 +984,20 @@ #: kdiff3.cpp:485 msgid "Automatically Go to Next Unsolved Conflict After Source Selection" msgstr "" -"Automaticamente Vá para o Próximo Conflito Não-Resolvido Após a seleção da " -"fonte." +"Ir Automaticamente para o Próximo Conflito Não-Resolvido Após a Seleção da " +"Fonte." #: kdiff3.cpp:487 msgid "Show Space && Tabulator Characters for Differences" -msgstr "Mostrar caracteres de Espaço && Tabuladores para diferenças." +msgstr "Mostrar as Diferenças de Espaços e Tabulações" #: kdiff3.cpp:488 msgid "Show White Space" -msgstr "Mostrar espaços em branco" +msgstr "Mostrar Espaços em Branco" #: kdiff3.cpp:490 msgid "Show Line Numbers" -msgstr "Mostrar Números das linhas" +msgstr "Mostrar Números de Linha" #: kdiff3.cpp:491 msgid "Choose A Everywhere" @@ -1025,38 +1012,32 @@ msgstr "Escolher C em qualquer lugar" #: kdiff3.cpp:494 -#, fuzzy msgid "Choose A for All Unsolved Conflicts" -msgstr "Escolha A para conflitos não-resolvidos" +msgstr "Escolha A em Todos os Conflitos Não-Resolvidos" #: kdiff3.cpp:495 -#, fuzzy msgid "Choose B for All Unsolved Conflicts" -msgstr "Escolha B para conflitos não-resolvidos" +msgstr "Escolha B em Todos os Conflitos Não-Resolvidos" #: kdiff3.cpp:496 -#, fuzzy msgid "Choose C for All Unsolved Conflicts" -msgstr "Escolha C para conflitos não-resolvidos" +msgstr "Escolha C em Todos os Conflitos Não-Resolvidos" #: kdiff3.cpp:497 -#, fuzzy msgid "Choose A for All Unsolved Whitespace Conflicts" -msgstr "Escolha A para todos os conflitos de espaço em branco não-resolvidos" +msgstr "Escolha A em Todos os Conflitos de Espaço em Branco Não-Resolvidos" #: kdiff3.cpp:498 -#, fuzzy msgid "Choose B for All Unsolved Whitespace Conflicts" -msgstr "Escolha B para todos os conflitos de espaço em branco não-resolvidos" +msgstr "Escolha B em Todos os Conflitos de Espaço em Branco Não-Resolvidos" #: kdiff3.cpp:499 -#, fuzzy msgid "Choose C for All Unsolved Whitespace Conflicts" -msgstr "Escolha C para todos os conflitos de espaço em branco não-resolvidos" +msgstr "Escolha C em Todos os Conflitos de Espaço em Branco Não-Resolvidos" #: kdiff3.cpp:500 msgid "Automatically Solve Simple Conflicts" -msgstr "Automaticamente resolva conflitos simples" +msgstr "Resolva Conflitos Simples Automaticamente" #: kdiff3.cpp:501 msgid "Set Deltas to Conflicts" @@ -1064,33 +1045,31 @@ #: kdiff3.cpp:502 msgid "Run Regular Expression Auto Merge" -msgstr "" +msgstr "Executar Mesclagem Automática de Expressões Regulares" #: kdiff3.cpp:503 -#, fuzzy msgid "Automatically Solve History Conflicts" -msgstr "Automaticamente resolva conflitos simples" +msgstr "Resolva Conflitos de Histórico Automaticamente" #: kdiff3.cpp:504 msgid "Split Diff At Selection" -msgstr "" +msgstr "Dividir Diferenças ao Selecionar" #: kdiff3.cpp:505 -#, fuzzy msgid "Join Selected Diffs" -msgstr "Comparar Arquivo Selecionado" +msgstr "Juntar Diferenças Selecionadas" #: kdiff3.cpp:507 msgid "Show Window A" -msgstr "Exibir Janela A" +msgstr "Mostrar Janela A" #: kdiff3.cpp:508 msgid "Show Window B" -msgstr "Exibir Janela B" +msgstr "Mostrar Janela B" #: kdiff3.cpp:509 msgid "Show Window C" -msgstr "Exibir Janela C" +msgstr "Mostrar Janela C" #: kdiff3.cpp:510 kdiff3.cpp:521 msgid "Focus Next Window" @@ -1098,31 +1077,31 @@ #: kdiff3.cpp:512 msgid "Normal Overview" -msgstr "Revisão Normal" +msgstr "Visão Normal" #: kdiff3.cpp:513 msgid "A vs. B Overview" -msgstr "Revisão A vs. B" +msgstr "Visão A vs. B" #: kdiff3.cpp:514 msgid "A vs. C Overview" -msgstr "Revisão A vs. C" +msgstr "Visão A vs. C" #: kdiff3.cpp:515 msgid "B vs. C Overview" -msgstr "Revisão B vs. C" +msgstr "Visão B vs. C" #: kdiff3.cpp:516 msgid "Word Wrap Diff Windows" -msgstr "Janelas de Diferença de Quebra de Linha" +msgstr "Quebrar Linha nas Janelas de Diferenças" #: kdiff3.cpp:517 msgid "Add Manual Diff Alignment" -msgstr "" +msgstr "Adicionar Alinhamento Manual das Diferenças" #: kdiff3.cpp:518 msgid "Clear All Manual Diff Alignments" -msgstr "" +msgstr "Limpar Todos Alinhamentos de Diferenças Manuais" #: kdiff3.cpp:523 msgid "Focus Prev Window" @@ -1134,11 +1113,11 @@ #: kdiff3.cpp:526 msgid "Dir && Text Split Screen View" -msgstr "Tela de Visualização de Pasta && Texto" +msgstr "Janela Dividida de Diretórios e Texto" #: kdiff3.cpp:528 msgid "Toggle Between Dir && Text View" -msgstr "Alterar entre visualização de Pasta e Texto" +msgstr "Alternar entre visualização de Diretório e Texto" #: kdiff3.cpp:573 pdiff.cpp:1698 msgid "The merge result hasn't been saved." @@ -1146,11 +1125,11 @@ #: kdiff3.cpp:574 msgid "Save && Quit" -msgstr "Salvar && Encerrar" +msgstr "Salvar e Sair" #: kdiff3.cpp:574 msgid "Quit Without Saving" -msgstr "Encerrar sem Salvar" +msgstr "Sair sem Salvar" #: kdiff3.cpp:582 pdiff.cpp:1707 msgid "Saving the merge result failed." @@ -1160,7 +1139,8 @@ msgid "" "You are currently doing a directory merge. Are you sure, you want to abort?" msgstr "" -"Você está fazendo uma mesclagem de pastas. Tem certeza de que deseja cancelar?" +"Você está fazendo uma mesclagem de diretórios. Tem certeza de que deseja " +"cancelar?" #: kdiff3.cpp:616 msgid "Saving file..." @@ -1171,22 +1151,20 @@ msgstr "Salvando arquivo com um novo nome..." #: kdiff3.cpp:722 -#, fuzzy msgid "Printing..." -msgstr "Saindo..." +msgstr "Imprimindo..." #: kdiff3.cpp:728 kdiff3.cpp:890 msgid "Printing aborted." -msgstr "" +msgstr "Impressão cancelada." #: kdiff3.cpp:860 msgid "Selection" -msgstr "" +msgstr "Seleção" #: kdiff3.cpp:886 -#, fuzzy msgid "Printing completed." -msgstr "Operação de mesclagem completa." +msgstr "A impressão terminou." #: kdiff3.cpp:896 msgid "Exiting..." @@ -1200,11 +1178,11 @@ msgid "Toggle the statusbar..." msgstr "Mudar a Barra de Status..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Não encontrou arquivos para comparação." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1214,12 +1192,13 @@ "This usually happens due to an installation problem. Please read the " "README-file in the source package for details." msgstr "" -"Não foi possível encontrar nossa parte! Isso normalmente acontece por problemas " -"na instalação. Leia nosso arquivo de LEIAME no pacote de fontes para detalhes." +"Não foi possível encontrar componente!\n" +"Isso normalmente acontece por problemas na instalação. Leia nosso arquivo de " +"LEIAME no pacote de fontes para detalhes." #: main.cpp:35 msgid "Tool for Comparison and Merge of Files and Directories" -msgstr "" +msgstr "Ferramenta para Comparação e Mesclagem de Arquivos e Diretórios" #: main.cpp:40 msgid "Merge the input." @@ -1231,7 +1210,7 @@ #: main.cpp:44 msgid "Output file. Implies -m. E.g.: -o newfile.txt" -msgstr "Arquivo de Saída. Implica -m. Ex.: -o novoarquivo.txt" +msgstr "Arquivo de Saída. Implica -m. P.ex.: -o novoarquivo.txt" #: main.cpp:45 msgid "Output file, again. (For compatibility with certain tools.)" @@ -1249,51 +1228,52 @@ #: main.cpp:48 msgid "Visible name replacement for input file 1 (base)." -msgstr "Recolocação do nome vísivel para o arquivo de entrada (base)." +msgstr "Substituição do nome vísivel para o arquivo de entrada 1 (base)." #: main.cpp:49 msgid "Visible name replacement for input file 2." -msgstr "Recolocação do nome vísivel para o arquivo de entrada 2." +msgstr "Substituição do nome vísivel para o arquivo de entrada 2." #: main.cpp:50 msgid "Visible name replacement for input file 3." -msgstr "Recolocação do nome vísivel para o arquivo de entrada 3." +msgstr "Substituição do nome vísivel para o arquivo de entrada 3." #: main.cpp:52 msgid "Alternative visible name replacement. Supply this once for every input." msgstr "" -"Recolocação do nome vísivel alternativo. Coloque apenas um para cada entrada." +"Substituição alternativa do nome vísivel. Coloque apenas um para cada entrada." #: main.cpp:53 msgid "" "Override a config setting. Use once for every setting. E.g.: --cs " "\"AutoAdvance=1\"" msgstr "" +"Substitui uma opção de configuração. Use uma vez para todas as opções. P.ex.: " +"--cs \"AutoAdvance=1\"" #: main.cpp:54 msgid "Show list of config settings and current values." -msgstr "" +msgstr "Mostra uma lista das opções de configuração e os valores atuais." #: main.cpp:55 -#, fuzzy msgid "Use a different config file." -msgstr "Número de arquivos diferentes:" +msgstr "Usar um arquivo de configuração diferente." #: main.cpp:59 msgid "file1 to open (base, if not specified via --base)" -msgstr "file1 abrindo (base, se não especificado via --base)" +msgstr "arquivo 1 abrindo (base, se não especificado via --base)" #: main.cpp:60 msgid "file2 to open" -msgstr "file2 abrindo" +msgstr "arquivo 2 abrindo" #: main.cpp:61 msgid "file3 to open" -msgstr "file3 abrindo" +msgstr "arquivo 3 abrindo" #: main.cpp:93 msgid "Ignored. (User defined.)" -msgstr "" +msgstr "Ignorado. (Definido pelo usuário.)" #. i18n: file kdiff3_part.rc line 16 #: main.cpp:171 rc.cpp:9 @@ -1306,111 +1286,110 @@ msgstr "" "Muito obrigada para aqueles que relataram bugs e contribuíram com idéias!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 -#, fuzzy +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" -msgstr "Número de conflitos não resolvidos restantes: %1" - -#: mergeresultwindow.cpp:282 +msgstr "" +"Número de conflitos não resolvidos: %1 (dos quais %2 são espaços em branco)" + +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" "A saída foi modificada.\n" -" Se você continuar suas mudanças serão perdidas." - -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +"Se você continuar suas mudanças serão perdidas." + +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." -msgstr "Todos os arquivos de entrada são binariamente iguais." - -#: mergeresultwindow.cpp:796 +msgstr "Todos os arquivos de entrada são iguais em nível binário." + +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Todos os arquivos de entrada contém o mesmo texto." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -"Arquivos A e B são binariamente iguais.\n" - -#: mergeresultwindow.cpp:799 +"Arquivos A e B são iguais em nível binário.\n" + +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Arquivos A e B possuem texto igual. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -"Arquivos A e C são binariamente iguais. \n" - -#: mergeresultwindow.cpp:801 +"Arquivos A e C são iguais em nível binário. \n" + +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -"Arquivos A e C possuem textos semelhantes. \n" - -#: mergeresultwindow.cpp:802 +"Arquivos A e C possuem texto igual. \n" + +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -"Arquivos B e C são binariamente iguais. \n" - -#: mergeresultwindow.cpp:803 +"Arquivos B e C são iguais em nível binário. \n" + +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -"Arquivos B e C possuem textos semelhantes. \n" - -#: mergeresultwindow.cpp:809 +"Arquivos B e C possuem texto igual. \n" + +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Número total de conflitos:" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "" "\n" -" Nr. de conflitos resolvidos automaticamente: " - -#: mergeresultwindow.cpp:811 +"Número de conflitos resolvidos automaticamente: " + +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " msgstr "" "\n" -" Nr. de conflitos não resolvidos: " - -#: mergeresultwindow.cpp:813 +"Número de conflitos não resolvidos: " + +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Conflitos" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" -msgstr "" - -#: mergeresultwindow.cpp:1657 -#, fuzzy +msgstr "" + +#: mergeresultwindow.cpp:1658 msgid "" -msgstr "" - -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +msgstr "" + +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Saída" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Modificado]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1418,36 +1397,39 @@ "Nem todos os conflitos foram resolvidos.\n" "Arquivo não foi salvo.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" -msgstr "Conflitos Deixados" - -#: mergeresultwindow.cpp:2669 +msgstr "Conflitos Restantes" + +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" - -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +"\n" +"\n" +"Criação do 'backup' falhou. Arquivo não salvo." + +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Erro ao salvar arquivo" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." -msgstr "Erro ao escrever." +msgstr "Erro ao gravar." #: optiondialog.cpp:361 msgid "Unicode, 8 bit" -msgstr "" +msgstr "Unicode, 8 bit" #: optiondialog.cpp:362 msgid "Unicode" -msgstr "" +msgstr "Unicode" #: optiondialog.cpp:363 msgid "Latin1" -msgstr "" +msgstr "Latin1" #: optiondialog.cpp:382 msgid "Change this if non-ASCII characters are not displayed correctly." @@ -1475,13 +1457,12 @@ msgstr "Cor" #: optiondialog.cpp:539 -#, fuzzy msgid "Colors Settings" -msgstr "Configurações Regionais" +msgstr "Configuração de Cores" #: optiondialog.cpp:553 msgid "Editor and Diff Views:" -msgstr "" +msgstr "Ãreas do Editor e das Diferenças:" #: optiondialog.cpp:561 msgid "Foreground color:" @@ -1521,41 +1502,41 @@ #: optiondialog.cpp:622 msgid "Color for manually aligned difference ranges:" -msgstr "" +msgstr "Cor dos intervalos de diferenças alinhados manualmente:" #: optiondialog.cpp:627 -#, fuzzy msgid "Directory Comparison View:" -msgstr "Estado da Comparação de Pastas" +msgstr "Ãrea de Comparação de Diretório:" #: optiondialog.cpp:633 msgid "Newest file color:" -msgstr "" +msgstr "Cor do arquivo mais recente:" #: optiondialog.cpp:636 msgid "" "Changing this color will only be effective when starting the next directory " "comparison." msgstr "" +"Mudar esta cor, só terá efeito quando iniciar a próxima comparação de " +"diretório." #: optiondialog.cpp:641 msgid "Oldest file color:" -msgstr "" +msgstr "Cor do arquivo mais antigo:" #: optiondialog.cpp:648 msgid "Middle age file color:" -msgstr "" +msgstr "Cor dos arquivos intermediários:" #: optiondialog.cpp:655 msgid "Color for missing files:" -msgstr "" +msgstr "Cor dos arquivos faltantes:" #: optiondialog.cpp:667 msgid "Editor" msgstr "Editor" #: optiondialog.cpp:667 -#, fuzzy msgid "Editor Behavior" msgstr "Comportamento do Editor" @@ -1568,8 +1549,8 @@ "On: Pressing tab generates the appropriate number of spaces.\n" "Off: A Tab-character will be inserted." msgstr "" -"Ligado: Ao pressionar Tab um número apropriado de espaços é gerado.\n" -" Desligado: Um caracter de Tab será inserido." +"Ligado: Ao pressionar Tab o número apropriado de espaços é gerado.\n" +"Desligado: Um caracter de Tab será inserido." #: optiondialog.cpp:686 msgid "Tab size:" @@ -1595,15 +1576,13 @@ "Off: You must explicitely copy e.g. via Ctrl-C." msgstr "" "Ligado: Qualquer seleção é imediatamente enviada para a Ãrea de Transferência.\n" -"Desligado: Você deve explicitamente copiar, por exemplo, via Ctrl+C." +"Desligado: Você deve explicitamente copiar, p.ex. via Ctrl+C." #: optiondialog.cpp:706 -#, fuzzy msgid "Line end style:" msgstr "Estilo de fim de linha:" #: optiondialog.cpp:718 -#, fuzzy msgid "" "Sets the line endings for when an edited file is saved.\n" "DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A" @@ -1612,14 +1591,12 @@ "DOS/Windows: CR+LF; Unix: LF; com CR=0D, LF=0A" #: optiondialog.cpp:729 -#, fuzzy msgid "Diff and Merge" -msgstr "Diff & Mesclagem" +msgstr "Diff e Mesclagem" #: optiondialog.cpp:729 -#, fuzzy msgid "Diff and Merge Settings" -msgstr "Configurações de Diff & Mesclagem" +msgstr "Configurações de Diff e Mesclagem" #: optiondialog.cpp:740 msgid "Preserve carriage return" @@ -1630,7 +1607,7 @@ "Show carriage return characters '\\r' if they exist.\n" "Helps to compare files that were modified under different operating systems." msgstr "" -"Exibir caracteres de retorno do carro '\\r' se existirem.\n" +"Exibir caracteres de retorno de carro '\\r' se existirem.\n" "Ajuda a comparar arquivos que foram modificados em diferentes sistemas " "operacionais." @@ -1644,14 +1621,13 @@ "space.)\n" "Might help to compare files with numeric data." msgstr "" -"Ignonar caracteres numéricos durante fase de combinação de linhas. (Similar a " +"Ignorar caracteres numéricos durante fase de combinação de linhas. (Similar a " "Ignorar espaços em branco.)\n" "Pode ajudar a comparar arquivos com dados numéricos." #: optiondialog.cpp:756 -#, fuzzy msgid "Ignore C/C++ comments" -msgstr "Ignorar Comentários de C/C++" +msgstr "Ignorar comentários de C/C++" #: optiondialog.cpp:758 msgid "Treat C/C++ comments like white space." @@ -1667,28 +1643,28 @@ #: optiondialog.cpp:769 msgid "Preprocessor command:" -msgstr "Comando do Preprocessador:" +msgstr "Comando do Pré-processador:" #: optiondialog.cpp:773 msgid "User defined pre-processing. (See the docs for details.)" msgstr "" -"Pré-processamento definido pelo usuário. (Veja os documentos para detalhes.)" +"Pré-processamento definido pelo usuário. (Veja a documentação para detalhes.)" #: optiondialog.cpp:776 msgid "Line-matching preprocessor command:" -msgstr "Comando do Preprocessador compatível com linha:" +msgstr "Comando do Pré-processador para correspondência de linhas:" #: optiondialog.cpp:780 msgid "" "This pre-processor is only used during line matching.\n" "(See the docs for details.)" msgstr "" -"Esse pré-processador é usado somente durante combinação de linhas.\n" -" (Veja os documentos para detalhes.)" +"Esse pré-processador é usado somente durante correspondência de linhas.\n" +"(Veja a documentação para detalhes.)" #: optiondialog.cpp:783 msgid "Try hard (slower)" -msgstr "Tentar duramente (lento)" +msgstr "Tentar com persistência (lento)" #: optiondialog.cpp:786 msgid "" @@ -1696,19 +1672,20 @@ "The analysis of big files will be much slower." msgstr "" "Habilita a opção --minimal para o diff externo.\n" -" A análise dos arquivos grandes será muito mais lenta." +"A análise dos arquivos grandes será muito mais lenta." #: optiondialog.cpp:791 msgid "Auto advance delay (ms):" -msgstr "Atraso do auto avanço (ms):" +msgstr "Atraso no avanço automático (ms):" #: optiondialog.cpp:796 msgid "" "When in Auto-Advance mode the result of the current selection is shown \n" "for the specified time, before jumping to the next conflict. Range: 0-2000 ms" msgstr "" -"Quando em modo de Auto Avanço o resultado da seleção atual é mostrado \n" -" pelo tempo especificado, antes de pular para o próximo conflito. Alcance: " +"Quando estiver no modo de Avanço Automático, o resultado da seleção atual é " +"mostrado\n" +"durante o período indicado, antes de saltar para o próximo conflito. Intervalo: " "0-2000 ms" #: optiondialog.cpp:801 @@ -1716,9 +1693,8 @@ msgstr "Mesclagem padrão de 2 arquivos com espaços em branco:" #: optiondialog.cpp:805 optiondialog.cpp:818 -#, fuzzy msgid "Manual Choice" -msgstr "Escolha manual" +msgstr "Escolha Manual" #: optiondialog.cpp:809 optiondialog.cpp:823 msgid "" @@ -1734,11 +1710,11 @@ #: optiondialog.cpp:828 msgid "Automatic Merge Regular Expression" -msgstr "" +msgstr "Expressão Regular de Mesclagem Automática" #: optiondialog.cpp:837 smalldialogs.cpp:379 msgid "Auto merge regular expression:" -msgstr "" +msgstr "Expressão regular de mesclagem automática:" #: optiondialog.cpp:841 msgid "" @@ -1747,24 +1723,31 @@ "When a line with a conflict matches the regular expression then\n" "- if available - C, otherwise B will be chosen." msgstr "" +"A expressão regular para linhas em que o KDiff3 deverá escolher automaticamente " +"umaorigem.\n" +"Quando uma linha com um conflito corresponder à expressão regular então\n" +"- se possível - será C, caso contrário B será escolhido." #: optiondialog.cpp:847 msgid "Run regular expression auto merge on merge start" msgstr "" +"Executar a mesclagem automática da expressão regular ao iniciar a mesclagem" #: optiondialog.cpp:849 msgid "" "Run the merge for auto merge regular expressions\n" "immediately when a merge starts.\n" msgstr "" +"Executa a mesclagem para as expressões regulares de mesclagem automática\n" +"imediatamente após o início de uma mesclagem.\n" #: optiondialog.cpp:854 msgid "Version Control History Merging" -msgstr "" +msgstr "Mesclagem do Histórico de Controle de Versões" #: optiondialog.cpp:863 smalldialogs.cpp:406 msgid "History start regular expression:" -msgstr "" +msgstr "Expressão regular do início do histórico:" #: optiondialog.cpp:867 msgid "" @@ -1772,10 +1755,13 @@ "Usually this line contains the \"$Log$\"-keyword.\n" "Default value: \".*\\$Log.*\\$.*\"" msgstr "" +"A expressão regular para o início do item de histórico da mesclagem.\n" +"Normalmente este valor contém a palavra-chave \"$Log$\".\n" +"Valor padrão: \".*\\$Log.*\\$.*\"" #: optiondialog.cpp:873 smalldialogs.cpp:435 msgid "History entry start regular expression:" -msgstr "" +msgstr "Expressão regular do início do item de histórico:" #: optiondialog.cpp:885 msgid "" @@ -1786,18 +1772,25 @@ "If left empty, then KDiff3 assumes that empty lines separate history entries.\n" "See the documentation for details." msgstr "" +"Um item de histórico da mesclagem consiste em várias linhas.\n" +"Indique a expressão regular usada para detectar a primeira linha (sem o " +"comentário inicial).\n" +"Use os parênteses para agrupar as chaves que deseja usar na ordenação.\n" +"Se for deixado em branco, o KDiff3 assume que as linhas em branco separam os " +"itens de histórico.\n" +"Veja a documentação para detalhes." #: optiondialog.cpp:893 msgid "History merge sorting" -msgstr "" +msgstr "Ordenação da mesclagem do histórico" #: optiondialog.cpp:895 msgid "Sort version control history by a key." -msgstr "" +msgstr "Ordenar o histórico do controle de versões por uma chave." #: optiondialog.cpp:905 msgid "History entry start sort key order:" -msgstr "" +msgstr "Ordem da chave de ordenação do início do item de histórico:" #: optiondialog.cpp:909 msgid "" @@ -1808,22 +1801,31 @@ "If left empty, then no sorting will be done.\n" "See the documentation for details." msgstr "" +"Cada um dos parênteses usados na expressão regular no item inicial do " +"histórico\n" +"agrupa uma chave que poderá ser usada na ordenação.\n" +"Indique a lista de chaves (que são numeradas por ordem de ocorrência,\n" +"começando com 1), usando ',' como separador (p.ex., \"4,5,6,1,2,3,7\").\n" +"Se for deixado em branco, não será feita nenhuma ordenação.\n" +"Veja a documentação para detalhes." #: optiondialog.cpp:920 msgid "Merge version control history on merge start" -msgstr "" +msgstr "Mesclar o histórico do controle de versões ao iniciar a mesclagem" #: optiondialog.cpp:922 msgid "Run version control history automerge on merge start." msgstr "" +"Executar mesclagem automática do histórico de controlo de versões ao iniciar a " +"mesclagem." #: optiondialog.cpp:926 msgid "Test your regular expressions" -msgstr "" +msgstr "Testar suas expressões regulares" #: optiondialog.cpp:931 msgid "Irrelevant merge command:" -msgstr "" +msgstr "Comando de mesclagem irrelevante:" #: optiondialog.cpp:935 msgid "" @@ -1831,22 +1833,25 @@ "when no other relevant changes were detected.\n" "Called with the parameters: filename1 filename2 filename3" msgstr "" +"Se for indicado, este script é executado após a mesclagem automática\n" +"quando não forem detectadas mais alterações relevantes.\n" +"É invocado com os parâmetros: arquivo1 arquivo2 arquivo3" #: optiondialog.cpp:945 msgid "Directory Merge" -msgstr "Mesclagem de Pastas" +msgstr "Mesclagem de Diretório" #: optiondialog.cpp:954 msgid "Recursive directories" -msgstr "Pastas Recursivas" +msgstr "Diretórios Recursivos" #: optiondialog.cpp:956 msgid "Whether to analyze subdirectories or not." -msgstr "Decide analisar sub-pastas ou não." +msgstr "Decide analisar sub-diretórios ou não." #: optiondialog.cpp:958 msgid "File pattern(s):" -msgstr "Padrão(ões) de Arquivo(s):" +msgstr "Padrão(ões) de Arquivo:" #: optiondialog.cpp:963 msgid "" @@ -1854,13 +1859,13 @@ "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" msgstr "" -"Padrão(ões) de arquivos a ser analisados. \n" -"Curingas: '*' e '?'\n" -"Vários padrões podem ser especificados usando o separador: ';'" +"Padrão(ões) de arquivos a analisar.\n" +"Caracteres especiais: '*' e '?'\n" +"Podem ser indicados vários padrões usando o separador: ';'" #: optiondialog.cpp:969 msgid "File-anti-pattern(s):" -msgstr "Arquivo anti-padrão(ões):" +msgstr "Anti-padrão(ões) de arquivo:" #: optiondialog.cpp:974 msgid "" @@ -1868,13 +1873,13 @@ "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" msgstr "" -"Padrão(ões) de arquivos a serem excluidos da análise. \n" -"Curingas: '*' e '?'\n" -"Vários padrões podem ser especificados usando o separador: ';'" +"Padrão(ões) de arquivos a excluir da análise.\n" +"Caracteres especiais: '*' e '?'\n" +"Podem ser indicados vários padrões usando o separador: ';'" #: optiondialog.cpp:980 msgid "Dir-anti-pattern(s):" -msgstr "Dir-anti-padrão(ões):" +msgstr "Anti-padrão(ões) de diretório:" #: optiondialog.cpp:985 msgid "" @@ -1882,9 +1887,9 @@ "Wildcards: '*' and '?'\n" "Several Patterns can be specified by using the separator: ';'" msgstr "" -"Padrão(ões) de pastas a serem excluídas da análise. \n" -"Curingas: '*' e '?'\n" -"Vários padrões podem ser especificados usando o separador: ';'" +"Padrão(ões) de diretórios a excluir da análise.\n" +"Caracteres especiais: '*' e '?'\n" +"Podem ser indicados vários padrões usando o separador: ';'" #: optiondialog.cpp:991 msgid "Use .cvsignore" @@ -1896,19 +1901,20 @@ "Via local \".cvsignore\"-files this can be directory specific." msgstr "" "Extende o antipadrão para qualquer coisa que possa ser ignorada pelo CVS.\n" -"A partir de \".cvsignore\"-arquivos isso pode ser especifico das pastas." +"Através de arquivos \".cvsignore\" locais isso pode ser específico para cada " +"diretório." #: optiondialog.cpp:999 msgid "Find hidden files and directories" -msgstr "Encontrar arquivos e pastas invisíveis" +msgstr "Encontrar arquivos e diretórios ocultos" #: optiondialog.cpp:1002 msgid "Finds files and directories with the hidden attribute." -msgstr "Encontra arquivos e pastas com o atributo invisível." +msgstr "Encontra arquivos e diretórios com o atributo oculto." #: optiondialog.cpp:1004 msgid "Finds files and directories starting with '.'." -msgstr "Encontrar arquivos e pastas começando com '.'." +msgstr "Encontrar arquivos e diretórios começando com '.'." #: optiondialog.cpp:1008 msgid "Follow file links" @@ -1919,24 +1925,24 @@ "On: Compare the file the link points to.\n" "Off: Compare the links." msgstr "" -"Ligado: Compara o arquivo para onde a ligação aponta.\n" +"Ligado: Compara o arquivo para o qual a ligação aponta.\n" "Desligado: Compara as ligações." #: optiondialog.cpp:1016 msgid "Follow directory links" -msgstr "Seguir ligações de pastas" +msgstr "Seguir ligações de diretório" #: optiondialog.cpp:1019 msgid "" "On: Compare the directory the link points to.\n" "Off: Compare the links." msgstr "" -"Ligado: Compara a pasta para onde a ligação aponta.\n" +"Ligado: Compara o diretório para o qual a ligação aponta.\n" "Desligado: Compara as ligações." #: optiondialog.cpp:1035 msgid "Case sensitive filename comparison" -msgstr "" +msgstr "Comparação de nomes de arquivos sensível à caixa" #: optiondialog.cpp:1038 msgid "" @@ -1945,37 +1951,39 @@ "Set this option if the case of the names must match. (Default for Windows is " "off, otherwise on.)" msgstr "" +"A comparação de diretório irá comparar os arquivos ou diretórios quando os seus " +"nomes corresponderem.\n" +"Configure esta opção se a caixa dos nomes deve corresponder. (O padrão para " +"Windows é desligada; caso contrário ligada.)" #: optiondialog.cpp:1042 msgid "File Comparison Mode" msgstr "Modo de Comparação de Arquivo" #: optiondialog.cpp:1046 -#, fuzzy msgid "Binary comparison" -msgstr "Comparação de Binário" +msgstr "Comparação binária" #: optiondialog.cpp:1047 msgid "Binary comparison of each file. (Default)" -msgstr "Comparação de binário de cada arquivo (padrão)." +msgstr "Comparação binária de cada arquivo. (Padrão)" #: optiondialog.cpp:1049 -#, fuzzy msgid "Full analysis" -msgstr "Análise Completa" +msgstr "Análise completa" #: optiondialog.cpp:1050 msgid "" "Do a full analysis and show statistics information in extra columns.\n" "(Slower than a binary comparison, much slower for binary files.)" msgstr "" -"Faz uma análise completa e mostra informações de estatística em colunas " -"extras.\n" -"(mais lento que a comparação binária, e bem mais lento para arquivos binários)." +"Fazer uma análise completa e mostrar informações estatísticas em colunas " +"extra.\n" +"(Mais lento que a comparação binária, muito mais lento para arquivos binários.)" #: optiondialog.cpp:1053 msgid "Trust the modification date (unsafe)" -msgstr "Confia na data de modificação (inseguro)" +msgstr "Confiar na data de modificação (inseguro)" #: optiondialog.cpp:1054 msgid "" @@ -1983,9 +1991,9 @@ "equal.\n" "Useful for big directories or slow networks." msgstr "" -"Assume que arquivos são iguais se a data de modificação e o tamanho forem " -"iguais.\n" -"Útil para pastas grandes ou redes lentas." +"Assumir que os arquivos são iguais se a data de modificação e o tamanho do " +"arquivo são iguais.\n" +"Útil para diretórios grandes ou para redes lentas." #: optiondialog.cpp:1057 msgid "Trust the size (unsafe)" @@ -1997,13 +2005,13 @@ "Useful for big directories or slow networks when the date is modified during " "download." msgstr "" -"Assume que arquivos são iguais se seus comprimentos forem iguais\n" -"Útil para pastas grandes ou redes lentas, quando a data for modificada durante " -"o download." +"Assumir que os arquivos são iguais se o seu tamanho é igual.\n" +"Útil para diretórios grandes ou para redes lentas quando a data é modificada " +"durante o download." #: optiondialog.cpp:1062 msgid "Synchronize directories" -msgstr "Sincronizar pastas" +msgstr "Sincronizar diretórios" #: optiondialog.cpp:1065 msgid "" @@ -2011,20 +2019,21 @@ "both directories are the same afterwards.\n" "Works only when comparing two directories without specifying a destination." msgstr "" -"Oferece-se para guardar arquivos em ambas as pastas, assim\n" -"ambas as pastas serão iguais depois.\n" -"Funciona apenas quando compara duas pastas sem especificar um destino." +"Oferece-se para armazenar arquivos em ambos diretórios\n" +"de modo que ambos fiquem iguais no fim.\n" +"Funciona apenas ao comparar dois diretórios sem indicar um destino." #: optiondialog.cpp:1071 -#, fuzzy msgid "White space differences considered equal" -msgstr "Mesclagem padrão de 3 arquivos com espaços em branco:" +msgstr "Diferenças de espaço em branco consideradas iguais" #: optiondialog.cpp:1074 msgid "" "If files differ only by white space consider them equal.\n" "This is only active when full analysis is chosen." msgstr "" +"Se os arquivos apenas diferem em espaço em branco considerá-los iguais.\n" +"Isto está ativo apenas quando é escolhida a análise completa." #: optiondialog.cpp:1080 msgid "Copy newer instead of merging (unsafe)" @@ -2038,104 +2047,110 @@ msgstr "" "Não analisa, apenas pega o arquivo mais novo.\n" "(Use somente se você sabe o que está fazendo!)\n" -"Só é efetivo quando comparando duas pastas." +"Só é efetivo quando comparando dois diretórios." #: optiondialog.cpp:1088 msgid "Backup files (.orig)" -msgstr "Faça backup dos arquivos (.orig)" +msgstr "Backup dos arquivos (.orig)" #: optiondialog.cpp:1091 msgid "" "When a file would be saved over an old file, then the old file\n" "will be renamed with a '.orig'-extension instead of being deleted." msgstr "" -"Quando um arquivo for salvo sovre um arquivo antigo, o arquivo antigo\n" -"será renomeado com uma extensão '.orig' ao invés de ser deletado." +"Quando um arquivo for salvo sobre um arquivo antigo, o arquivo antigo\n" +"será renomeado com uma extensão '.orig' ao invés de ser removido." #: optiondialog.cpp:1118 msgid "Regional Settings" msgstr "Configurações Regionais" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Idioma (é necessário reiniciar)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -"Escolha o idioma das strings da interface ou escolha \"Automático\".\n" -"Para que a mudança tenha efeito, saia do KDiff3 e inicie-o novamente." - -#: optiondialog.cpp:1261 +"Escolha o idioma dainterface gráfica ou \"Auto\".\n" +"Para que a mudança de idioma tenha efeito, saia e reinicie o KDiff3." + +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" -msgstr "" - -#: optiondialog.cpp:1264 +msgstr "Utilizar a mesma codificação para tudo:" + +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" - -#: optiondialog.cpp:1269 -#, fuzzy +"Ative isto para permitir modificar todas as codificações alterando apenas a " +"primeira.\n" +"Desative se forem necessárias opções individuais." + +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " -msgstr "Usar codificação local" - -#: optiondialog.cpp:1273 +msgstr "Nota: A codificação local é" + +#: optiondialog.cpp:1276 msgid "File Encoding for A:" -msgstr "" - -#: optiondialog.cpp:1278 +msgstr "Codificação de Arquivo para A:" + +#: optiondialog.cpp:1281 msgid "File Encoding for B:" -msgstr "" - -#: optiondialog.cpp:1283 +msgstr "Codificação de Arquivo para B:" + +#: optiondialog.cpp:1286 msgid "File Encoding for C:" -msgstr "" - -#: optiondialog.cpp:1288 +msgstr "Codificação de Arquivo para C:" + +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" -msgstr "" - -#: optiondialog.cpp:1293 +msgstr "Codificação de Arquivo para Mesclagem de Resultado e Gravação:" + +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" -msgstr "" - -#: optiondialog.cpp:1302 +msgstr "Codificação de Arquivo dos Arquivos de Pré-processamento:" + +#: optiondialog.cpp:1305 msgid "Right To Left Language" -msgstr "" - -#: optiondialog.cpp:1305 +msgstr "Idioma da Direita para a Esquerda" + +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" - -#: optiondialog.cpp:1315 -#, fuzzy +"Alguns idiomas são lidos da direita para esquerda.\n" +"Esta opção muda o visualizador e editor apropriadamente." + +#: optiondialog.cpp:1318 msgid "Integration" -msgstr "Operação" - -#: optiondialog.cpp:1315 -#, fuzzy +msgstr "Integração" + +#: optiondialog.cpp:1318 msgid "Integration Settings" -msgstr "Configurações Regionais" - -#: optiondialog.cpp:1325 +msgstr "Configuração de Integração" + +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" -msgstr "" - -#: optiondialog.cpp:1330 +msgstr "Opções da linha de comandos a ignorar:" + +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" "Several values can be specified if separated via ';'\n" "This will suppress the \"Unknown option\"-error." msgstr "" - -#: optiondialog.cpp:1383 +"Uma lista das opções da linha de comandos que deverão ser ignoradas, quando o " +"KDiff3 for usado por outras ferramentas.\n" +"Se desejar indicar vários valores, separe-os por ';'\n" +"Isto irá eliminar o erro de \"Opção desconhecida\"." + +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2144,38 +2159,38 @@ "\n" "Do you want to continue or do you want to select another font." msgstr "" -"Você selecionou uma fonte de comprimento variável.\n" +"Você selecionou um tamanho de letra variável.\n" "\n" -"Como esse programa não trabalha corretamente com fontes de comprimento\n" -" variável, você pode experimentar problemas ao editar.\n" +"Porque este programa não lida corretamente com tipos de letra\n" +"de largura variável, você poderá ter problemas ao editar.\n" "\n" -"Você deseja continuar ou selecionar um nova fonte." - -#: optiondialog.cpp:1387 +"Deseja continuar ou prefere selecionar outro tipo de letra." + +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Fonte Incompatível" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" -msgstr "Continue ao seu próprio risco" - -#: optiondialog.cpp:1388 +msgstr "Continue por sua conta e risco" + +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Selecionar outra fonte" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Reinicia todas as opções. Não somente as desse tópico." #: pdiff.cpp:258 msgid "PreprocessorCmd: " -msgstr "Comando de Pré-processamento:" +msgstr "Comando do pré-processador: " #: pdiff.cpp:263 msgid "" "The following option(s) you selected might change data:\n" msgstr "" -"A(s) seguinte(s) opção(ões) que você selecionou devem modificar os dados:\n" +"A(s) seguinte(s) opção(ões) que você selecionou podem modificar os dados:\n" #: pdiff.cpp:264 msgid "" @@ -2184,23 +2199,20 @@ "Do you want to disable these settings or continue with these settings active?" msgstr "" "\n" -"Muito provavelmente não é desejado durante um merge.\n" -"Deseja desabilitar estas configurações, ou continuar com elas?" +"Muito provavelmente isso não é desejável durante uma mesclagem.\n" +"Deseja desabilitar estas configurações, ou continuar com elas ativas?" #: pdiff.cpp:266 -#, fuzzy msgid "Option Unsafe for Merging" -msgstr "Opções inseguras para a mesclagem (merge)" +msgstr "Opção Insegura para Mesclagem" #: pdiff.cpp:267 -#, fuzzy msgid "Use These Options During Merge" -msgstr "Usar estas opções durante a mesclagem" +msgstr "Usar Estas Opções Durante a Mesclagem" #: pdiff.cpp:267 -#, fuzzy msgid "Disable Unsafe Options" -msgstr "Desabilitar as opções inseguras" +msgstr "Desativar Opções Inseguras" #: pdiff.cpp:297 msgid "Loading A" @@ -2212,11 +2224,11 @@ #: pdiff.cpp:318 pdiff.cpp:344 msgid "Diff: A <-> B" -msgstr "Diff: A <-> B" +msgstr "Diferenças: A <-> B" #: pdiff.cpp:324 pdiff.cpp:366 msgid "Linediff: A <-> B" -msgstr "Linediff: A <-> B" +msgstr "Dif. Linhas: A <-> B" #: pdiff.cpp:335 msgid "Loading C" @@ -2224,38 +2236,37 @@ #: pdiff.cpp:347 msgid "Diff: B <-> C" -msgstr "Diff: B <-> C" +msgstr "Diferenças: B <-> C" #: pdiff.cpp:350 msgid "Diff: A <-> C" -msgstr "Diff: A <-> C" +msgstr "Diferenças: A <-> C" #: pdiff.cpp:369 msgid "Linediff: B <-> C" -msgstr "Linediff: B <-> C" +msgstr "Dif. Linhas: B <-> C" #: pdiff.cpp:372 msgid "Linediff: A <-> C" -msgstr "Linediff: A <-> C" +msgstr "Dif. Linhas: A <-> C" #: pdiff.cpp:509 -#, fuzzy msgid "All input files contain the same text, but are not binary equal." -msgstr "Todos os arquivos de entrada contém o mesmo texto." +msgstr "" +"Todos os arquivos de entrada contêm o mesmo texto, mas não são iguais em nível " +"binário." #: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 -#, fuzzy msgid "" "Files %1 and %2 are binary equal.\n" msgstr "" -"Arquivos B e C são binariamente iguais. \n" +"Os arquivos %1 e %2 são iguais em nível binário.\n" #: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 -#, fuzzy msgid "" "Files %1 and %2 have equal text, but are not binary equal. \n" msgstr "" -"Arquivos A e B são binariamente iguais.\n" +"Os arquivos %1 e %2 têm texto igual, mas não são iguais em nível binário.\n" #: pdiff.cpp:526 msgid "" @@ -2263,9 +2274,9 @@ "Note that the KDiff3-merge was not meant for binary data.\n" "Continue at your own risk." msgstr "" -"Alguns arquivos de entrada não parecem ser arquivos de texto puro.\n" -"Perceba que a mesclagem do KDiff3 não foi feito para arquivos binários.\n" -"Continue por conta e risco." +"Alguns dos arquivos de entrada não parecem ser arquivos de texto puro.\n" +"Lembre-se que a mesclagem do KDiff3 não foi pensada para dados binários.\n" +"Continue por sua conta e risco." #: pdiff.cpp:965 msgid "Abort" @@ -2277,7 +2288,7 @@ #: pdiff.cpp:1036 pdiff.cpp:1107 msgid "File open error" -msgstr "Erro na abertura de Arquivos" +msgstr "Erro ao abrir o arquivo" #: pdiff.cpp:1139 msgid "Cutting selection..." @@ -2285,7 +2296,7 @@ #: pdiff.cpp:1160 msgid "Copying selection to clipboard..." -msgstr "Copiando seleção para a área de trabalho..." +msgstr "Copiando seleção para a área de transferência..." #: pdiff.cpp:1176 msgid "Inserting clipboard contents..." @@ -2293,7 +2304,7 @@ #: pdiff.cpp:1699 msgid "Save && Continue" -msgstr "Salvar && Continuar" +msgstr "Salvar e Continuar" #: pdiff.cpp:1699 msgid "Continue Without Saving" @@ -2301,20 +2312,19 @@ #: pdiff.cpp:1906 msgid "Search complete." -msgstr "Pesquisa concluída" +msgstr "Procura terminada." #: pdiff.cpp:1906 msgid "Search Complete" -msgstr "Pesquisa Concluída" - -#: pdiff.cpp:2129 +msgstr "Procura Terminada" + +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." -msgstr "" - -#: pdiff.cpp:2129 -#, fuzzy +msgstr "Nada foi selecionado em nenhuma janela de entrada de diferenças." + +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" -msgstr "Erro ao criar a pasta." +msgstr "Erro ao adicionar o intervalo manual de diferenças" #. i18n: file kdiff3_part.rc line 4 #: rc.cpp:3 @@ -2332,19 +2342,19 @@ #: rc.cpp:15 #, no-c-format msgid "&Directory" -msgstr "&Pasta" +msgstr "&Diretório" #. i18n: file kdiff3_shell.rc line 30 #: rc.cpp:18 #, no-c-format msgid "Current Item Merge Operation" -msgstr "Operação de Mesclagem (merge) no item atual" +msgstr "Operação de Mesclagem do Item Atual" #. i18n: file kdiff3_shell.rc line 38 #: rc.cpp:21 #, no-c-format msgid "Current Item Sync Operation" -msgstr "Operação de Sincronismo no item atual" +msgstr "Operação de Sincronismo do Item Atual" #. i18n: file kdiff3_shell.rc line 50 #: rc.cpp:24 @@ -2356,7 +2366,7 @@ #: rc.cpp:27 #, no-c-format msgid "D&iffview" -msgstr "Visão das &Diferenças" +msgstr "Visão das D&iferenças" #. i18n: file kdiff3_shell.rc line 73 #: rc.cpp:30 @@ -2382,27 +2392,27 @@ #: smalldialogs.cpp:61 smalldialogs.cpp:77 smalldialogs.cpp:93 #: smalldialogs.cpp:136 msgid "Dir..." -msgstr "Dir..." +msgstr "Diretório..." #: smalldialogs.cpp:86 msgid "C (Optional):" -msgstr "C(Opcional):" +msgstr "C (Opcional):" #: smalldialogs.cpp:108 msgid "Swap/Copy Names ..." -msgstr "" +msgstr "Trocar/Copiar Nomes ..." #: smalldialogs.cpp:114 smalldialogs.cpp:115 smalldialogs.cpp:116 msgid "Swap %1<->%2" -msgstr "" +msgstr "Trocar %1<->%2" #: smalldialogs.cpp:117 smalldialogs.cpp:118 smalldialogs.cpp:119 msgid "Copy %1->Output" -msgstr "" +msgstr "Copiar %1->Saída" #: smalldialogs.cpp:120 smalldialogs.cpp:121 smalldialogs.cpp:122 msgid "Swap %1<->Output" -msgstr "" +msgstr "Trocar %1<->Saída" #: smalldialogs.cpp:129 msgid "Output (optional):" @@ -2410,93 +2420,106 @@ #: smalldialogs.cpp:158 msgid "Configure..." -msgstr "Configurar...." +msgstr "Configurar..." #: smalldialogs.cpp:329 -#, fuzzy msgid "Search text:" -msgstr "Texto de Busca:" +msgstr "Texto da procura:" #: smalldialogs.cpp:336 msgid "Case sensitive" -msgstr "Caso sensitivo" +msgstr "Distinguir capitalização" #: smalldialogs.cpp:339 msgid "Search A" -msgstr "Pesquisa A" +msgstr "Procurar A" #: smalldialogs.cpp:344 msgid "Search B" -msgstr "Pesquisa B" +msgstr "Procurar B" #: smalldialogs.cpp:349 msgid "Search C" -msgstr "Pesquisa C" +msgstr "Procurar C" #: smalldialogs.cpp:354 msgid "Search output" -msgstr "Pesquisa saída" +msgstr "Resultado da procura" #: smalldialogs.cpp:359 msgid "&Search" -msgstr "&Pesquisa" +msgstr "&Procurar" #: smalldialogs.cpp:376 msgid "Regular Expression Tester" -msgstr "" +msgstr "Teste de Expressões Regulares" #: smalldialogs.cpp:387 msgid "Example auto merge line:" -msgstr "" +msgstr "Linha de mesclagem automática do exemplo:" #: smalldialogs.cpp:389 msgid "For auto merge test copy a line as used in your files." msgstr "" +"Para um teste da mesclagem automática, copie uma linha usada nos seus arquivos." #: smalldialogs.cpp:395 smalldialogs.cpp:424 smalldialogs.cpp:461 msgid "Match result:" -msgstr "" +msgstr "Resultado correspondente:" #: smalldialogs.cpp:414 msgid "Example history start line (with leading comment):" -msgstr "" +msgstr "Linha inicial do histórico do exemplo (com o comentário inicial):" #: smalldialogs.cpp:417 msgid "" "Copy a history start line as used in your files,\n" "including the leading comment." msgstr "" +"Copie uma linha inicial do histórico, como a usada nos seus arquivos,\n" +"incluindo o comentário inicial." #: smalldialogs.cpp:443 msgid "History sort key order:" -msgstr "" +msgstr "Ordem da chave do histórico:" #: smalldialogs.cpp:451 msgid "Example history entry start line (without leading comment):" msgstr "" +"Linha inicial do item do histórico do exemplo (sem o comentário inicial):" #: smalldialogs.cpp:453 msgid "" "Copy a history entry start line as used in your files,\n" "but omit the leading comment." msgstr "" +"Copie uma linha inicial do item de histórico, como a usada nos seus arquivos,\n" +"mas omita o comentário inicial." #: smalldialogs.cpp:468 msgid "Sort key result:" -msgstr "" +msgstr "Resultado da chave de ordenação:" #: smalldialogs.cpp:519 smalldialogs.cpp:529 smalldialogs.cpp:550 msgid "Match success." -msgstr "" +msgstr "Sucesso da correspondência." #: smalldialogs.cpp:523 smalldialogs.cpp:533 smalldialogs.cpp:556 -#, fuzzy msgid "Match failed." -msgstr "Falha ao salvar." +msgstr "A correspondência falhou." #: smalldialogs.cpp:541 msgid "Opening and closing parentheses don't match in regular expression." msgstr "" +"Os parênteses de abertura e fechamento não correspondem na expressão regular." + +#, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Mesclagem de Pastas" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Mesclagem de Pastas" #, fuzzy #~ msgid "Synchronize Directories" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/ru.po --- a/kdiff3/po/ru.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/ru.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-02-01 10:56+0200\n" "Last-Translator: Nick Shaforostoff \n" "Language-Team: \n" @@ -52,14 +52,14 @@ "The line-matching-preprocessing command will be disabled now." msgstr "" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" msgstr "" "ÐŸÐ¾Ñ‚ÐµÑ€Ñ Ð´Ð°Ð½Ð½Ñ‹Ñ….\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "ВнутреннÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ°" @@ -244,7 +244,7 @@ msgid "Changing All Merge Operations" msgstr "Изменение вÑех объединений" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Продолжить" @@ -625,16 +625,6 @@ msgid "Unfold All Subdirs" msgstr "ИÑÐºÐ»ÑŽÑ‡Ð°Ñ Ð²Ñе подкаталоги" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Объединение каталогов" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Объединение каталогов" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Выбрать A Ð´Ð»Ñ Ð²Ñех" @@ -710,7 +700,7 @@ msgid "Merge to A && B" msgstr "Объединить в A & B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -718,7 +708,7 @@ "Ðе удалоÑÑŒ удалить Ñтарую резервную копию. \n" "Файл: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -726,79 +716,79 @@ "Ðе удалоÑÑŒ выполнить переименование. \n" "Файлы: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Получение ÑоÑтоÑÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð°: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Чтение файла: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "ЗапиÑÑŒ в файл: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Вне памÑти" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Создание каталога: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Удаление каталога: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Удаление файла: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Создание ÑимволичеÑкой ÑÑылки: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Переименование файла: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Копирование файла: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "Ðе удалоÑÑŒ открыть Ð´Ð»Ñ Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð» %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "Ðе удалоÑÑŒ открыть Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñи файл %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Ðе удалоÑÑŒ прочитать файл %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Ðе удалоÑÑŒ запиÑать в файл %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Чтение каталога: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Вывод Ñодержимого каталога: %1" @@ -1144,11 +1134,11 @@ msgid "Toggle the statusbar..." msgstr "Отображение/Ñкрытие панели ÑоÑтоÑниÑ..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Ðе удалоÑÑŒ найти файлы Ð´Ð»Ñ ÑравнениÑ." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1247,15 +1237,15 @@ msgstr "" "Благодарю вÑех, кто отправлÑÑ… отчёты об ошибках и предлагал новые идеи!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "Ðеразрешённых конфликтов оÑталоÑÑŒ: %1 (%2 из которых - конфликты пуÑтых " "промежутков)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1263,55 +1253,55 @@ "Вывод был изменён.\n" "ЕÑли вы продолжите, Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð±ÑƒÐ´ÑƒÑ‚ утерÑны." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Ð’Ñе входные файлы одинаковы бинарно" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Ð’Ñе входные файлы Ñодержт одинаковый текÑÑ‚" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Файлы A и B бинарно одинаковы.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Файлы A и B Ñодержат одинаковый текÑÑ‚. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Файлы A и C бинарно одинаковы.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Файлы A и C Ñодержат одинаковый текÑÑ‚. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Файлы B и C бинарно одинаковы.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Файлы B и C Ñодержат одинаковый текÑÑ‚. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Общее количеÑтво конфликтов: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1319,7 +1309,7 @@ "\n" "КоличеÑтво разрешённых автоматичеÑки конфликтов: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1327,31 +1317,31 @@ "\n" "КоличеÑтво неразрешённых конфликтов: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Конфликты" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "<Ðет иÑходной Ñтроки>" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "<Конфликт Ð¾Ð±ÑŠÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ (пуÑтые промежутки)>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<Конфликт объединениÑ>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Вывод" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Изменён]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1359,22 +1349,22 @@ "Ðе вÑе конфликты разрешены.\n" "Файл не Ñохранён.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "ОÑталоÑÑŒ конфликтов" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Ошибка ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð°" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Ошибка запиÑи" @@ -1937,75 +1927,75 @@ msgid "Regional Settings" msgstr "Региональные наÑтройки" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Язык (требуетÑÑ Ð¿ÐµÑ€ÐµÐ·Ð°Ð¿ÑƒÑк)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Кодировку локали - " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Кодировка файла A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Кодировка файла B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Кодировка файла C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Кодировка Ð´Ð»Ñ Ð¾Ð±ÑŠÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¸ ÑохранениÑ:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Кодировка препроцеÑÑора:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "ДейÑтвие" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Региональные наÑтройки" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2013,7 +2003,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2023,19 +2013,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "ÐеÑовмеÑтимый шрифт" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Продолжить" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Выбрать другой шрифт" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Это ÑброÑит абÑолютно вÑе параметры, а не только текущей вкладки." @@ -2169,11 +2159,11 @@ msgid "Search Complete" msgstr "ПоиÑк завершён" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Ðе удалоÑÑŒ Ñоздать каталог" @@ -2360,6 +2350,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Объединение каталогов" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Объединение каталогов" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Синхронизировать каталоги" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/rw.po --- a/kdiff3/po/rw.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/rw.po Sat Nov 04 00:05:00 2006 +0000 @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3 3.4\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-05-25 18:07-0600\n" "Last-Translator: Steve Murphy \n" "Language-Team: Kinyarwanda \n" @@ -79,7 +79,7 @@ "\n" "Umurongo: - - command Yahagaritswe NONEAHA . " -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 #, fuzzy msgid "" "Data loss error:\n" @@ -88,7 +88,7 @@ "Ikosa : \n" "ni Umuntu i Umwanditsi: . \n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 #, fuzzy msgid "Severe Internal Error" msgstr "Ikosa " @@ -307,7 +307,7 @@ msgid "Changing All Merge Operations" msgstr "Ibikorerwa Ishusho" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "Komeza" @@ -754,16 +754,6 @@ msgid "Unfold All Subdirs" msgstr "" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Seriveri y'ububiko:" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Seriveri y'ububiko:" - #: directorymergewindow.cpp:2867 #, fuzzy msgid "Choose A for All Items" @@ -846,7 +836,7 @@ msgid "Merge to A && B" msgstr "Kuri A & & " -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 #, fuzzy msgid "" "While trying to make a backup, deleting an older backup failed. \n" @@ -855,7 +845,7 @@ "Kuri Ubwoko A Inyibutsa , Gusiba Inyibutsa Byanze . \n" ": " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 #, fuzzy msgid "" "While trying to make a backup, renaming failed. \n" @@ -864,83 +854,83 @@ "Kuri Ubwoko A Inyibutsa , Guhindura izina Byanze . \n" ": " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, fuzzy, c-format msgid "Getting file status: %1" msgstr "Idosiye Imimerere : %1 " -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, fuzzy, c-format msgid "Reading file: %1" msgstr "Idosiye : %1 " -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, fuzzy, c-format msgid "Writing file: %1" msgstr "Idosiye : %1 " -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Ububiko bwarenzwe" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, fuzzy, c-format msgid "Making directory: %1" msgstr "Ububiko : %1 " -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, fuzzy, c-format msgid "Removing directory: %1" msgstr "Ububiko : %1 " -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, fuzzy, c-format msgid "Removing file: %1" msgstr "Idosiye : %1 " -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 #, fuzzy msgid "Creating symbolic link: %1 -> %2" msgstr "Ihuza : %1 - > %2 " -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 #, fuzzy msgid "Renaming file: %1 -> %2" msgstr "Idosiye : %1 - > %2 " -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 #, fuzzy msgid "Copying file: %1 -> %2" msgstr "Idosiye : %1 - > %2 " -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, fuzzy, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "Ikosa Idosiye Gukoporora Igikorwa : Idosiye ya: Byanze . : %1 " -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, fuzzy, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "Ikosa Idosiye Gukoporora Igikorwa : Idosiye ya: Byanze . : %1 " -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, fuzzy, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Ikosa Idosiye Gukoporora Igikorwa : Byanze . : %1 " -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, fuzzy, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Ikosa Idosiye Gukoporora Igikorwa : Byanze . : %1 " -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 #, fuzzy msgid "Reading directory: " msgstr "Ububiko : " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, fuzzy, c-format msgid "Listing directory: %1" msgstr "Ububiko : %1 " @@ -1354,12 +1344,12 @@ msgid "Toggle the statusbar..." msgstr "i Umurongomiterere ... " -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 #, fuzzy msgid "Couldn't find files for comparison." msgstr "Gushaka Idosiye ya: . " -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "" @@ -1474,14 +1464,14 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "+ Kuri na ! " -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 #, fuzzy msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "Bya : %1 ( Bya %2 ) " -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 #, fuzzy msgid "" "The output has been modified.\n" @@ -1490,64 +1480,64 @@ "Ibisohoka Byahinduwe: . \n" "Gukomeza Amahinduka . " -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 #, fuzzy msgid "All input files are binary equal." msgstr "Iyinjiza Idosiye Nyabibiri bingana . " -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 #, fuzzy msgid "All input files contain the same text." msgstr "Iyinjiza Idosiye i Umwandiko . " -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 #, fuzzy msgid "" "Files A and B are binary equal.\n" msgstr "" "A na Nyabibiri bingana . \n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 #, fuzzy msgid "" "Files A and B have equal text. \n" msgstr "" "A na bingana Umwandiko . \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 #, fuzzy msgid "" "Files A and C are binary equal.\n" msgstr "" "A na Nyabibiri bingana . \n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 #, fuzzy msgid "" "Files A and C have equal text. \n" msgstr "" "A na bingana Umwandiko . \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 #, fuzzy msgid "" "Files B and C are binary equal.\n" msgstr "" "na Nyabibiri bingana . \n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 #, fuzzy msgid "" "Files B and C have equal text. \n" msgstr "" "na bingana Umwandiko . \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 #, fuzzy msgid "Total number of conflicts: " msgstr "Umubare Bya : " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 #, fuzzy msgid "" "\n" @@ -1556,7 +1546,7 @@ "\n" "Bya mu buryo bwikora: : " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 #, fuzzy msgid "" "\n" @@ -1565,35 +1555,35 @@ "\n" "Bya : " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 #, fuzzy msgid "Conflicts" msgstr "Ishyamirana ry'ingenzi" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 #, fuzzy msgid "" msgstr "< Umurongo: > " -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 #, fuzzy msgid "" msgstr "Ishyamirana ry'ingenzi" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Ibisohoka" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 #, fuzzy msgid "[Modified]" msgstr "Byahinduwe" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 #, fuzzy msgid "" "Not all conflicts are solved yet.\n" @@ -1602,12 +1592,12 @@ "Byose . \n" "Idosiye OYA . \n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 #, fuzzy msgid "Conflicts Left" msgstr "Guhitamo Ibumoso" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 #, fuzzy msgid "" "\n" @@ -1618,12 +1608,12 @@ "\n" "Inyibutsa Byanze . Idosiye OYA . " -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 #, fuzzy msgid "File Save Error" msgstr "Idosiye Kubika Ikosa " -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 #, fuzzy msgid "Error while writing." msgstr "Ikosa . " @@ -2308,12 +2298,12 @@ msgid "Regional Settings" msgstr "Amagenamiterere y'Akarere" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 #, fuzzy msgid "Language (restart required)" msgstr "( Ongera utangire Bya ngombwa ) " -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 #, fuzzy msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" @@ -2322,12 +2312,12 @@ "i Ururimi: Bya i - Ikurikiranyanyuguti Cyangwa \" \" . \n" "A Guhindura... Bya Ururimi: Kuri , &Kuvamo na Ongera utangire . " -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 #, fuzzy msgid "Use the same encoding for everything:" msgstr "i Imisobekere: ya: : " -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 #, fuzzy msgid "" "Enable this allows to change all encodings by changing the first only.\n" @@ -2336,42 +2326,42 @@ "iyi Kuri Guhindura... Byose ku i Itangira . \n" "iyi NIBA Igenamiterere . " -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 #, fuzzy msgid "Note: Local Encoding is " msgstr "icyitonderwa : ni " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 #, fuzzy msgid "File Encoding for A:" msgstr "Idosiye ya: A : " -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 #, fuzzy msgid "File Encoding for B:" msgstr "Idosiye ya: : " -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 #, fuzzy msgid "File Encoding for C:" msgstr "Idosiye ya: : " -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 #, fuzzy msgid "File Encoding for Merge Output and Saving:" msgstr "Idosiye ya: na : " -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 #, fuzzy msgid "File Encoding for Preprocessor Files:" msgstr "Idosiye ya: : " -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 #, fuzzy msgid "Right To Left Language" msgstr "Iburyo ku ibumoso" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 #, fuzzy msgid "" "Some languages are read from right to left.\n" @@ -2380,21 +2370,21 @@ "Indimi Soma Kuva: Iburyo: Kuri Ibumoso: . \n" "Igenamiterere Guhindura... i na Muhinduzi . " -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Igikorwa" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Amagenamiterere y'Akarere" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2402,7 +2392,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 #, fuzzy msgid "" "You selected a variable width font.\n" @@ -2418,22 +2408,22 @@ "\n" "Kuri Gukomeza Cyangwa Kuri Guhitamo Imyandikire . " -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 #, fuzzy msgid "Incompatible Font" msgstr "%S Itakorana" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 #, fuzzy msgid "Continue at Own Risk" msgstr "Gukomeza Ku " -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 #, fuzzy msgid "Select Another Font" msgstr "Gutoranya imyandikire" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 #, fuzzy msgid "This resets all options. Not only those of the current topic." msgstr "Byose Amahitamo . Bya i KIGEZWEHO . " @@ -2596,11 +2586,11 @@ msgid "Search Complete" msgstr "Igishushanyombonera cy'Ishakisha" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Ikosa Kurema Ububiko . " @@ -2797,6 +2787,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Seriveri y'ububiko:" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Seriveri y'ububiko:" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "ububiko bw'amaderese " diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/sr.po --- a/kdiff3/po/sr.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/sr.po Sat Nov 04 00:05:00 2006 +0000 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-02-26 19:41+0100\n" "Last-Translator: Chusslove Illich \n" "Language-Team: Serbian\n" @@ -63,7 +63,7 @@ "\n" "Предобрада поклапања линија ће Ñада бити иÑкључена." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -71,7 +71,7 @@ "Грешка, губитак података:\n" "Ðко је можете поновити, контактирајте аутора.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Озбиљна унутрашња грешка" @@ -259,7 +259,7 @@ msgid "Changing All Merge Operations" msgstr "Мењам Ñве операције Ñтапања" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&ÐаÑтави" @@ -651,16 +651,6 @@ msgid "Unfold All Subdirs" msgstr "Рашири Ñве поддиректоријуме" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Стапање директоријума" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Стапање директоријума" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Изабери Рза Ñве Ñтавке" @@ -736,7 +726,7 @@ msgid "Merge to A && B" msgstr "Стопи у Ри Б" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -744,7 +734,7 @@ "У току покушаја да Ñе направи резерва, бриÑање Ñтарије резерве није уÑпело.\n" "Име фајла: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -752,53 +742,53 @@ "У току покушаја да Ñе направи резерва, преименовање није уÑпело.\n" "Имена фајлова: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Добављам ÑÑ‚Ð°Ñ‚ÑƒÑ Ñ„Ð°Ñ˜Ð»Ð°: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Читам фајл: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Пишем фајл: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Ðема меморије" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Правим директоријум: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Уклањам директоријум: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Уклањам фајл: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Правим Ñимболичку везу: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Уклањам фајл: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Копирам фајл: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -806,7 +796,7 @@ "Грешка током операције копирања фајлова: Отварање фајла за читање није уÑпело. " "Име фајла: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -814,23 +804,23 @@ "Грешка током операције копирања фајлова: Отварање фајла за пиÑање није уÑпело. " "Име фајла: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Грешка током операције копирања фајлова: Читање није уÑпело. Име фајла: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Грешка током операције копирања фајлова: ПиÑање није уÑпело. Име фајла: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Читам директоријум: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "ЛиÑтам директоријум: %1" @@ -1179,11 +1169,11 @@ msgid "Toggle the statusbar..." msgstr "Укључи/иÑкључи ÑтатуÑну траку..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "ÐиÑам могао да нађем фајлове за поређење." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1283,13 +1273,13 @@ msgstr "" "+ Много хвала онима који Ñу пријављивали грешке и допринели Ñвојим идејама!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "Број преоÑталих нерешених Ñукоба: %1 (од којих Ñу %2 бели размаци)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1297,55 +1287,55 @@ "Излаз је измењен.\n" "Ðко наÑтавите, ваше измене ће бити изгубљене." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Сви улазни фајлови Ñу бинарно једнаки." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Сви улазни фајлови Ñадрже иÑти текÑÑ‚." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Фајлови Ри Б Ñу бинарно једнаки.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Фајлови Ри Б имају једнак текÑÑ‚.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Фајлови Ри Ц Ñу бинарно једнаки.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Фајлови Ри Ц имају једнак текÑÑ‚.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Фајлови Б и Ц Ñу бинарно једнаки.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Фајлови Б и Ц имају једнак текÑÑ‚.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Укупан број Ñукоба: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1353,7 +1343,7 @@ "\n" "Број аутоматÑки решених Ñукоба: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1361,31 +1351,31 @@ "\n" "Број нерешених Ñукоба: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Сукоби" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "<Ðема изв. линије>" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "<Сукоб у Ñтапању (Ñамо бели размаци)>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<Сукоб у Ñтапању>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Излаз" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Измењен]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1393,11 +1383,11 @@ "Још увек ниÑу решени Ñви Ñукоби.\n" "Фајл није Ñнимљен.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "ПреоÑтали Ñукоби" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1407,11 +1397,11 @@ "\n" "Прављење резерве није уÑпело. Фајл није Ñнимљен." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Грешка у Ñнимању фајла" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Грешка приликом пиÑања." @@ -2024,11 +2014,11 @@ msgid "Regional Settings" msgstr "Регионална подешавања" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Језик (потребно поновно покретање)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2036,11 +2026,11 @@ "Изаберите језик за иÑпиÑе у програму или „Auto“.\n" "Да би измена језика била примењена, затворите и поново покрените KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "КориÑти иÑто кодирање за Ñве:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2048,35 +2038,35 @@ "Укључивањем овог можете променити Ñва кодирања променом Ñамо првог.\n" "ИÑкључите ово ако Ñу потребна различита поједина подешавања." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Ðапомна: Локално кодирање је " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Кодирање фајла за Ð:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Кодирање фајла за Б:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Кодирање фајла за Ц:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Кодирање фајла за Ñтопљени излаз и Ñнимање:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Кодирање фајла за препроцеÑорке фајлове:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Језици Ñ Ð´ÐµÑна у лево" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2084,21 +2074,21 @@ "Ðеки језици Ñе читају Ñ Ð´ÐµÑна у лево.\n" "Ово подешавање ће прилагодити томе приказивач и уређивач." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Операција" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Регионална подешавања" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2106,7 +2096,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2122,19 +2112,19 @@ "\n" "Желите ли да наÑтавите или ћете изабрати други фонт?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Ðекомпатибилан фонт" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "ÐаÑтавите на ÑопÑтвени ризик" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Изаберите други фонт" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Ово реÑетује Ñве опције. Ðе Ñамо оне у текућој теми." @@ -2275,11 +2265,11 @@ msgid "Search Complete" msgstr "Претрага је готова" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Грешка у току прављења директоријума." @@ -2466,6 +2456,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Стапање директоријума" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Стапање директоријума" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Синхронизуј директоријуме" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/sr@Latn.po --- a/kdiff3/po/sr@Latn.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/sr@Latn.po Sat Nov 04 00:05:00 2006 +0000 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-02-26 19:41+0100\n" "Last-Translator: Chusslove Illich \n" "Language-Team: Serbian\n" @@ -63,7 +63,7 @@ "\n" "Predobrada poklapanja linija će sada biti iskljuÄena." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -71,7 +71,7 @@ "GreÅ¡ka, gubitak podataka:\n" "Ako je možete ponoviti, kontaktirajte autora.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Ozbiljna unutraÅ¡nja greÅ¡ka" @@ -259,7 +259,7 @@ msgid "Changing All Merge Operations" msgstr "Menjam sve operacije stapanja" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Nastavi" @@ -652,16 +652,6 @@ msgid "Unfold All Subdirs" msgstr "RaÅ¡iri sve poddirektorijume" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Stapanje direktorijuma" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Stapanje direktorijuma" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Izaberi A za sve stavke" @@ -737,7 +727,7 @@ msgid "Merge to A && B" msgstr "Stopi u A i B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -745,7 +735,7 @@ "U toku pokuÅ¡aja da se napravi rezerva, brisanje starije rezerve nije uspelo.\n" "Ime fajla: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -753,53 +743,53 @@ "U toku pokuÅ¡aja da se napravi rezerva, preimenovanje nije uspelo.\n" "Imena fajlova: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Dobavljam status fajla: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "ÄŒitam fajl: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "PiÅ¡em fajl: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Nema memorije" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Pravim direktorijum: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Uklanjam direktorijum: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Uklanjam fajl: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Pravim simboliÄku vezu: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Uklanjam fajl: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Kopiram fajl: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -807,7 +797,7 @@ "GreÅ¡ka tokom operacije kopiranja fajlova: Otvaranje fajla za Äitanje nije " "uspelo. Ime fajla: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -815,23 +805,23 @@ "GreÅ¡ka tokom operacije kopiranja fajlova: Otvaranje fajla za pisanje nije " "uspelo. Ime fajla: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "GreÅ¡ka tokom operacije kopiranja fajlova: ÄŒitanje nije uspelo. Ime fajla: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "GreÅ¡ka tokom operacije kopiranja fajlova: Pisanje nije uspelo. Ime fajla: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "ÄŒitam direktorijum: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Listam direktorijum: %1" @@ -1180,11 +1170,11 @@ msgid "Toggle the statusbar..." msgstr "UkljuÄi/iskljuÄi statusnu traku..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Nisam mogao da naÄ‘em fajlove za poreÄ‘enje." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1284,13 +1274,13 @@ msgstr "" "+ Mnogo hvala onima koji su prijavljivali greÅ¡ke i doprineli svojim idejama!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "Broj preostalih nereÅ¡enih sukoba: %1 (od kojih su %2 beli razmaci)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1298,55 +1288,55 @@ "Izlaz je izmenjen.\n" "Ako nastavite, vaÅ¡e izmene će biti izgubljene." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Svi ulazni fajlovi su binarno jednaki." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Svi ulazni fajlovi sadrže isti tekst." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Fajlovi A i B su binarno jednaki.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Fajlovi A i B imaju jednak tekst.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Fajlovi A i C su binarno jednaki.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Fajlovi A i C imaju jednak tekst.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Fajlovi B i C su binarno jednaki.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Fajlovi B i C imaju jednak tekst.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Ukupan broj sukoba: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1354,7 +1344,7 @@ "\n" "Broj automatski reÅ¡enih sukoba: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1362,31 +1352,31 @@ "\n" "Broj nereÅ¡enih sukoba: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Sukobi" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Izlaz" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Izmenjen]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1394,11 +1384,11 @@ "JoÅ¡ uvek nisu reÅ¡eni svi sukobi.\n" "Fajl nije snimljen.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Preostali sukobi" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1408,11 +1398,11 @@ "\n" "Pravljenje rezerve nije uspelo. Fajl nije snimljen." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "GreÅ¡ka u snimanju fajla" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "GreÅ¡ka prilikom pisanja." @@ -2025,11 +2015,11 @@ msgid "Regional Settings" msgstr "Regionalna podeÅ¡avanja" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "Jezik (potrebno ponovno pokretanje)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2037,11 +2027,11 @@ "Izaberite jezik za ispise u programu ili „Auto“.\n" "Da bi izmena jezika bila primenjena, zatvorite i ponovo pokrenite KDiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Koristi isto kodiranje za sve:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2049,35 +2039,35 @@ "UkljuÄivanjem ovog možete promeniti sva kodiranja promenom samo prvog.\n" "IskljuÄite ovo ako su potrebna razliÄita pojedina podeÅ¡avanja." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Napomna: Lokalno kodiranje je " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Kodiranje fajla za A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Kodiranje fajla za B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Kodiranje fajla za C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Kodiranje fajla za stopljeni izlaz i snimanje:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Kodiranje fajla za preprocesorke fajlove:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "Jezici s desna u levo" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2085,21 +2075,21 @@ "Neki jezici se Äitaju s desna u levo.\n" "Ovo podeÅ¡avanje će prilagoditi tome prikazivaÄ i ureÄ‘ivaÄ." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Operacija" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "Regionalna podeÅ¡avanja" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2107,7 +2097,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2123,19 +2113,19 @@ "\n" "Želite li da nastavite ili ćete izabrati drugi font?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Nekompatibilan font" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Nastavite na sopstveni rizik" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Izaberite drugi font" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Ovo resetuje sve opcije. Ne samo one u tekućoj temi." @@ -2276,11 +2266,11 @@ msgid "Search Complete" msgstr "Pretraga je gotova" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "GreÅ¡ka u toku pravljenja direktorijuma." @@ -2467,6 +2457,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Stapanje direktorijuma" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Stapanje direktorijuma" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Sinhronizuj direktorijume" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/sv.po --- a/kdiff3/po/sv.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/sv.po Sat Nov 04 00:05:00 2006 +0000 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2006-04-10 19:29+0200\n" "Last-Translator: Stefan Asserhäll \n" "Language-Team: Swedish \n" @@ -62,7 +62,7 @@ "\n" "Preprocessingen för radmatchning inaktiveras nu." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -70,7 +70,7 @@ "Dataförlustfel:\n" "Om det gÃ¥r att upprepa, kontakta upphovsmannen.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Allvarligt internt fel" @@ -256,7 +256,7 @@ msgid "Changing All Merge Operations" msgstr "Ändra alla sammanfogningsÃ¥tgärder" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "F&ortsätt" @@ -648,14 +648,6 @@ msgid "Unfold All Subdirs" msgstr "Expandera alla underkataloger" -#: directorymergewindow.cpp:2865 -msgid "Save Directory Merge State ..." -msgstr "Spara tillstÃ¥nd för katalogsammanfogning..." - -#: directorymergewindow.cpp:2866 -msgid "Load Directory Merge State ..." -msgstr "Ladda tillstÃ¥nd för katalogsammanfogning..." - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Välj A för alla objekt" @@ -728,7 +720,7 @@ msgid "Merge to A && B" msgstr "Sammanfoga till A och B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -737,7 +729,7 @@ "säkerhetskopia.\n" "Filnamn: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -745,60 +737,60 @@ "Vid försök att skapa en säkerhetskopia, misslyckades namnbyte.\n" "Filnamn: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Hämtar filstatus: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Läser fil: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Skriver fil: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Slut pÃ¥ minne" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Skapar katalog: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Tar bort katalog: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Tar bort fil: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Skapar symbolisk länk: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Byter namn pÃ¥ fil: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Kopierar fil: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" "Fel under filkopieringsÃ¥tgärd: Öppna fil för läsning misslyckades. Filnamn: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -806,21 +798,21 @@ "Fel under filkopieringsÃ¥tgärd: Öppna fil för skrivning misslyckades. Filnamn: " "%1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Fel under filkopieringsÃ¥tgärd: Läsning misslyckades. Filnamn: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Fel under filkopieringsÃ¥tgärd: Skrivning misslyckades. Filnamn: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Läser katalog: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Listar katalog: %1" @@ -1165,11 +1157,11 @@ msgid "Toggle the statusbar..." msgstr "Växla statusraden..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Kunde inte hitta filer för jämförelse." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "Kdiff3-del" @@ -1273,13 +1265,13 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "Samt stort tack till de som rapporterade fel och bidrog med idéer!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "Antal Ã¥terstÃ¥ende olösta konflikter: %1 (av vilka %2 är blanktecken)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1287,55 +1279,55 @@ "Utdata har ändrats.\n" "Om du fortsätter kommer dina ändringar att gÃ¥ förlorade." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "Alla indatafiler är binärt lika." -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Alla indatafiler innehÃ¥ller samma text." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "Filerna A och B är binärt lika.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "Filerna A och B innehÃ¥ller samma text.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "Filerna A och C är binärt lika.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "Filerna A och C innehÃ¥ller samma text.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "Filerna B och C är binärt lika.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "Filerna B och C innehÃ¥ller samma text.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Totalt antal konflikter: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1343,7 +1335,7 @@ "\n" "Antal automatiskt lösta konflikter: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1351,31 +1343,31 @@ "\n" "Antal olösta konflikter: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Konflikter" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "Utmatning" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[Ändrad]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1383,11 +1375,11 @@ "Alla konflikter har inte lösts ännu.\n" "Filen sparas inte.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Konflikter kvar" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1397,11 +1389,11 @@ "\n" "Misslyckades skapa säkerhetskopia. Filen sparades inte." -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Fel vid spara fil" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Fel vid skrivning." @@ -2041,11 +2033,11 @@ msgid "Regional Settings" msgstr "Regionsinställningar" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "SprÃ¥k (omstart krävs)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2053,11 +2045,11 @@ "Välj sprÃ¥k för strängarna i det grafiska gränssnittet eller \"Automatisk\".\n" "För att sprÃ¥kbytet ska ske, avsluta och starta om Kdiff3." -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "Använd samma kodning för allt:" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2066,35 +2058,35 @@ "första.\n" "Inaktivera det om olika individuella inställningar behövs." -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "Observera: Lokal kodning är " -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "Filkodning för A:" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "Filkodning för B:" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "Filkodning för C:" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "Filkodning för sammanfogad utdata och vid spara:" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "Filkodning för preprocessorfiler:" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "SprÃ¥k som läses frÃ¥n höger till vänster" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2102,19 +2094,19 @@ "Vissa sprÃ¥k läses frÃ¥n höger till vänster.\n" "Inställningen ändrar visningen och editorn pÃ¥ motsvarande sätt." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration" msgstr "Integrering" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "Integreringsinställningar" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "Kommandoradsväljare att ignorera:" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2126,7 +2118,7 @@ "Flera värden kan anges om de Ã¥tskiljs av ';'\n" "Detta undertrycker felmeddelandet \"Okänd väljare\"." -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2142,19 +2134,19 @@ "\n" "Vill du fortsätta, eller vill du välja ett annat teckensnitt?" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Olämpligt teckensnitt" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Fortsätt pÃ¥ egen risk" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "Välj ett annat teckensnitt" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Det här Ã¥terställer alla alternativ, inte bara de i nuvarande ämne." @@ -2292,11 +2284,11 @@ msgid "Search Complete" msgstr "Sökning färdig" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "Ingenting är markerad i nÃ¥got indatafönster med jämförelse." -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Error while adding manual diff range" msgstr "Fel vid tillägg av manuellt jämförelseintervall" @@ -2485,3 +2477,9 @@ #: smalldialogs.cpp:541 msgid "Opening and closing parentheses don't match in regular expression." msgstr "Inledande och avslutande parenteser matchar inte i reguljärt uttryck." + +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Spara tillstÃ¥nd för katalogsammanfogning..." + +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Ladda tillstÃ¥nd för katalogsammanfogning..." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/ta.po --- a/kdiff3/po/ta.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/ta.po Sat Nov 04 00:05:00 2006 +0000 @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2004-08-24 04:28+0530\n" "Last-Translator: I. Felix \n" "Language-Team: \n" @@ -80,7 +80,7 @@ "\n" "வரிசெலà¯à®•ளின௠கடà¯à®Ÿà®³à¯ˆà®¯à¯ˆ இபà¯à®ªà¯Šà®´à¯à®¤à¯‡ à®®à¯à®Ÿà®•à¯à®•à¯," -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -88,7 +88,7 @@ "தகவல௠தவறானதà¯.\n" "மீணà¯à®Ÿà¯à®®à¯ உறà¯à®ªà®¤à¯à®¤à®¿à®¯à®¾à®©à®¾à®²à¯ ஆசிரியரை அணà¯à®•வà¯à®®à¯.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "கடà¯à®®à¯ˆà®¯à®¾à®© உளà¯à®šà®¾à®°à¯à®¨à¯à®¤ தவறà¯." @@ -279,7 +279,7 @@ msgid "Changing All Merge Operations" msgstr "அனைதà¯à®¤à¯ ஒனà¯à®±à¯à®šà¯‡à®°à¯ இயகà¯à®•à®™à¯à®•ளை மாறà¯à®±à®¿à®•à¯à®•ொணà¯à®Ÿà®¿à®°à¯à®•à¯à®•ிறதà¯" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "தொடரà¯à®¤à®²à¯" @@ -674,16 +674,6 @@ msgid "Unfold All Subdirs" msgstr "அனைதà¯à®¤à¯ உபஅடைவà¯à®•ளையà¯à®®à¯ பிரி" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "அடைவà¯à®šà¯ சேரà¯à®•à¯à®•ை" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "அடைவà¯à®šà¯ சேரà¯à®•à¯à®•ை" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "எலà¯à®²à®¾ விவரஙà¯à®•ளà¯à®•à¯à®•à¯à®®à¯ Aவைத௠தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯" @@ -761,7 +751,7 @@ msgid "Merge to A && B" msgstr "A & B ஠ஒனà¯à®±à®¾à®•ச௠சேரà¯." -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -770,7 +760,7 @@ "à®®à¯à®Ÿà®¿à®¯à®µà®¿à®²à¯à®²à¯ˆ.\n" "கோபà¯à®ªà¯à®ªà¯ பெயரà¯à®•ளà¯:" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -778,53 +768,53 @@ "ஒர௠பினà¯à®•ோபà¯à®ªà®¿à®©à¯ˆ உரà¯à®µà®¾à®•à¯à®• à®®à¯à®¯à®±à¯à®šà®¿à®•à¯à®•à¯à®®à¯ போதà¯, பெயர௠மாறà¯à®±à®®à¯ செயà¯à®¯à®ªà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ.\n" "கோபà¯à®ªà¯à®ªà¯ பெயரà¯à®•ளà¯:" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "கோபà¯à®ªà¯ நிலைமை வாஙà¯à®•à¯: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "கோபà¯à®ªà¯à®•ளை படிதà¯à®¤à®²à¯: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "எழà¯à®¤à¯à®®à¯ கோபà¯à®ªà¯: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "நினைவில௠இலà¯à®²à¯ˆ" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "அடைவ௠அமை: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "அடைவ௠அகறà¯à®±à¯: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "அழிதà¯à®¤à®²à¯ கோபà¯à®ªà¯:%1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "கà¯à®±à®¿à®¯à¯€à®Ÿà¯à®Ÿà¯ இணைபà¯à®ªà¯ உரà¯à®µà®¾à®•à¯à®•à¯à®¤à®²à¯: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "மறà¯à®ªà¯†à®¯à®°à¯:( %1 -> %2 )" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "கோபà¯à®ªà¯ நகலெடà¯à®¤à¯à®¤à®²à¯: %1 -> %2 " -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -832,7 +822,7 @@ "கோபà¯à®ªà¯à®ªà¯ படிவின௠போத௠பிழை à®à®±à¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯. படிபà¯à®ªà®¤à®±à¯à®•ான கோபà¯à®ªà¯à®¤à¯ " "திறகà¯à®•பà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ.கோபà¯à®ªà®¿à®©à¯ பெயரà¯:%1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -840,25 +830,25 @@ "கோபà¯à®ªà¯à®ªà¯ படிவின௠போத௠பிழை à®à®±à¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯. எழà¯à®¤à¯à®µà®¤à®±à¯à®•ான கோபà¯à®ªà¯à®¤à¯ " "திறகà¯à®•பà¯à®ªà®Ÿà®µà®¿à®²à¯à®²à¯ˆ. கோபà¯à®ªà®¿à®©à¯ பெயரà¯:%1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "கோபà¯à®ªà¯à®ªà¯ படிவின௠போத௠பிழை à®à®±à¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯ கோபà¯à®ªà®¿à®©à¯ˆ படிகà¯à®• இயலவிலà¯à®²à¯ˆ.கோபà¯à®ªà®¿à®©à¯ " "பெயரà¯:%1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "கோபà¯à®ªà¯à®ªà¯ படிவினà¯à®ªà¯‹à®¤à¯ பிழை à®à®±à¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯. கோபà¯à®ªà®¿à®²à¯ எழà¯à®¤ இயலவிலà¯à®²à¯ˆ.கோபà¯à®ªà®¿à®©à¯ " "பெயரà¯:%1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "அடைவை படிதà¯à®¤à®²à¯:" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "அடைவை படà¯à®Ÿà®¿à®¯à®²à®¿à®Ÿà®²à¯: %1" @@ -1214,11 +1204,11 @@ msgid "Toggle the statusbar..." msgstr "நிலைபà¯à®ªà®Ÿà¯à®Ÿà®¿à®¯à¯ˆ மாறà¯à®±à¯" -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "ஒபà¯à®ªà®¿à®Ÿà¯à®¤à®²à¯à®•à¯à®•௠கோபà¯à®ªà¯à®•ள௠கிடைகà¯à®•விலà¯à®²à¯ˆ." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1318,69 +1308,69 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "+ Many thanks to those who reported bugs and contributed ideas!" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 #, fuzzy msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "இனà¯à®©à¯à®®à¯ தீரà¯à®•à¯à®•பà¯à®ªà®Ÿà®¾à®¤ கà¯à®´à®ªà¯à®ªà®™à¯à®•ளின௠எணà¯à®£à®¿à®•ை: %1" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" "வெளீயிட௠மாறà¯à®±à®ªà¯à®ªà®Ÿà¯à®Ÿà¯à®³à¯à®³à®¤à¯. நீஙà¯à®•ள௠தொடரà¯à®¨à¯à®¤à®¾à®²à¯ மாறà¯à®±à®™à¯à®•ளை இழநà¯à®¤à¯ விடà¯à®µà¯€à®°à¯à®•ளà¯" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "அனைதà¯à®¤à¯ உளà¯à®³à®¿à®Ÿà¯ கோபà¯à®ªà¯à®•ளà¯à®®à¯ இரà¯à®¨à®¿à®²à¯ˆ சமமà¯" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "அனைதà¯à®¤à¯ உளà¯à®³à¯€à®Ÿà¯à®Ÿà¯à®•௠கோபà¯à®ªà¯à®•ளà¯à®®à¯ ஒரே உரையைக௠கொணà¯à®Ÿà®©." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "கோபà¯à®ªà¯à®•ள௠A மறà¯à®±à¯à®®à¯ B இரà¯à®¨à®¿à®²à¯ˆ சமம௠உடையன.\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "கோபà¯à®ªà¯à®•ள௠A மறà¯à®±à¯à®®à¯ B சம உரை உடையன.\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "கோபà¯à®ªà¯à®•ள௠A மறà¯à®±à¯à®®à¯ C இரà¯à®¨à®¿à®²à¯ˆ சமம௠உடையன.\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "கோபà¯à®ªà¯à®•ள௠A மறà¯à®±à¯à®®à¯ C சம உரை உடையன.\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "கோபà¯à®ªà¯à®•ள௠B மறà¯à®±à¯à®®à¯ C இரà¯à®¨à®¿à®²à¯ˆ சமம௠உடையன.\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "கோபà¯à®ªà¯à®•ள௠B மறà¯à®±à¯à®®à¯ C சம உரை உடையன.\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "மொதà¯à®¤ கà¯à®´à®ªà¯à®ªà®™à¯à®•ளின௠எணà¯à®£à®¿à®•à¯à®•ை:" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1388,7 +1378,7 @@ "\n" "தாமாகவே தீரà¯à®¨à¯à®¤ கà¯à®´à®ªà¯à®ªà®™à¯à®•ளின௠எணà¯à®£à®¿à®•à¯à®•ை" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1396,32 +1386,32 @@ "\n" "தீரà¯à®•à¯à®•பà¯à®ªà®Ÿà®¾à®¤ கà¯à®´à®ªà¯à®ªà®™à¯à®•ளின௠எணà¯à®£à®¿à®•à¯à®•ை" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "கà¯à®´à®ªà¯à®ªà®™à¯à®•ளà¯" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 #, fuzzy msgid "" msgstr "<ஒனà¯à®±à¯à®šà¯‡à®°à¯ கà¯à®´à®ªà¯à®ªà®®à¯>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<ஒனà¯à®±à¯à®šà¯‡à®°à¯ கà¯à®´à®ªà¯à®ªà®®à¯>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr " வெளியீடà¯" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[திரà¯à®¤à¯à®¤à®ªà¯à®ªà®Ÿà¯à®Ÿà®¤à¯]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1429,22 +1419,22 @@ "அனைதà¯à®¤à¯ கà¯à®´à®ªà¯à®ªà®™à¯à®•ளà¯à®®à¯ இனà¯à®©à¯à®®à¯ தீரவிலà¯à®²à¯ˆ.\n" "கோபà¯à®ªà®¿à®©à¯ˆ சேமிகà¯à®•விலà¯à®²à¯ˆ \n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "கà¯à®´à®ªà¯à®ªà®®à®¾à®© இடதà¯" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "கோபà¯à®ªà®¿à®© சேமிபà¯à®ªà¯ பிழை" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "எழà¯à®¤à¯à®®à¯ பொழà¯à®¤à¯ பிழை" @@ -2048,11 +2038,11 @@ msgid "Regional Settings" msgstr "இதர அமைபà¯à®ªà¯à®•ளை உளà¯à®³à®Ÿà®•à¯à®•ியதà¯" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "மொழி " -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -2060,66 +2050,66 @@ "கீழà¯à®•ணà¯à®Ÿ மொழிகளில௠GUI- எழà¯à®¤à¯à®¤à¯à®•à¯à®•ளைத௠தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯ மொழிகளை மாறà¯à®± KDiff3யை " "தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 #, fuzzy msgid "Note: Local Encoding is " msgstr "லொகல௠கà¯à®±à®¿à®®à¯à®±à¯ˆà®¯à®¾à®•à¯à®•ம௠உபயோகி" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "இயகà¯à®•à®®à¯." -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "இதர அமைபà¯à®ªà¯à®•ளை உளà¯à®³à®Ÿà®•à¯à®•ியதà¯" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2127,7 +2117,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2141,19 +2131,19 @@ "திரà¯à®¤à¯à®¤à®™à¯à®•ள௠செயà¯à®¯à¯à®®à¯ பொழà¯à®¤à¯à®ªà¯ பிரசà¯à®šà®©à¯ˆà®•ளை சநà¯à®¤à®¿à®¤à¯à®°à¯à®•à¯à®•லாமà¯, சரியாக நீஙà¯à®•ள௠" "தொடர வேணà¯à®Ÿà¯à®®à®¾ அலà¯à®²à®¤à¯, வேற௠எழà¯à®¤à¯à®¤à¯à®°à¯à®µà¯ˆ தேரà¯à®¨à¯à®¤à¯†à®Ÿà¯à®•à¯à®•ிறீரà¯à®•ளா." -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "கசà¯à®šà®¿à®¤à®®à®¿à®²à¯à®²à®¾à®¤ எழà¯à®¤à¯à®¤à¯à®°à¯" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "உஙà¯à®•ளà¯à®Ÿà¯ˆà®¯ சொநà¯à®¤ ஆபதà¯à®¤à®¿à®²à¯ தொடரவà¯à®®à¯" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "மறà¯à®±à¯Šà®°à¯ எழà¯à®¤à¯à®¤à¯à®°à¯à®µà¯ˆ தேரà¯à®¤à¯†à®Ÿà¯" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" "இத௠அனைதà¯à®¤à¯ தேரà¯à®µà¯à®•ளையà¯à®®à¯ மாறà¯à®±à®¿à®¯à®®à¯ˆà®•à¯à®•à¯à®®à¯. தறà¯à®ªà¯Šà®´à¯à®¤à¯à®³à¯à®³ தலைபà¯à®ªà¯ மடà¯à®Ÿà¯à®®à®²à¯à®²" @@ -2298,11 +2288,11 @@ msgid "Search Complete" msgstr "தேடல௠மà¯à®Ÿà®¿à®µà®Ÿà¯ˆà®¨à¯à®¤à®¤à¯" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "அடைவை உரà¯à®µà®¾à®•à¯à®•à¯à®®à¯ போத௠பிழை" @@ -2490,6 +2480,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "அடைவà¯à®šà¯ சேரà¯à®•à¯à®•ை" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "அடைவà¯à®šà¯ சேரà¯à®•à¯à®•ை" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "ஒதà¯à®¤à®¿à®¯à®•à¯à®•௠அடைவை" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/tg.po --- a/kdiff3/po/tg.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/tg.po Sat Nov 04 00:05:00 2006 +0000 @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-09-17 13:29+0500\n" "Last-Translator: Victor Ibragimov \n" "Language-Team: Tajik\n" @@ -70,7 +70,7 @@ "\n" "Хати-ҷамъ кунии- пешкоркардкунии фармон ҳоло аз кор мемонад." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -78,7 +78,7 @@ "Маълумотҳои гумкарда:\n" "Ðгар ин зиёд карда шавад Ð¸Ð»Ñ‚Ð¸Ð¼Ð¾Ñ Ð±Ð¾ муаллиф алоқа кунед.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Хатогии даруни" @@ -268,7 +268,7 @@ msgid "Changing All Merge Operations" msgstr "Тағйироти ҳамаи Ñкҷошавиҳо" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "&Давом додан" @@ -653,16 +653,6 @@ msgid "Unfold All Subdirs" msgstr "Дохилнашудаи ҳамаи зеркаталогҳо" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Хатогӣ дар вақти хониши каталог" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Хатогӣ дар вақти хониши каталог" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Интихоби A барои ҳама" @@ -740,7 +730,7 @@ msgid "Merge to A && B" msgstr "ПайваÑÑ‚ кардан ба A & Ð’" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -748,7 +738,7 @@ "Ðаметавонам нуÑхаи кӯҳнаи захираро неÑÑ‚ кунам. \n" "Ðоми файл: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -756,53 +746,53 @@ "Ðаметавонам номгузориро ҳал кунам. \n" "Ðоми файлҳо: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Гирифтани ҳолати файл: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Хониши файл: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Ðавишти файл: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Ðз хотира" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Эҷоди каталогҳо : %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Дур кардани директориÑ: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Дур кардани файл: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Сохтани пайваÑти рамзӣ: %1-> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Ðз нав номгузории файл: %1-> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "ÐуÑха бардошатани: %1-> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" @@ -810,7 +800,7 @@ "Хато дар вақти амалиёти нуÑхабардории файл: Кушодани файл барои хондан " "нашуд.Ðоми Файл: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" @@ -818,23 +808,23 @@ "Хато дар вақти амалиёти нуÑхабардории файл: Кушодани файл барои хондан " "нашуд.Ðоми Файл: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "" "Хато дар вақти амалиёти нуÑхабардории файл: Хондани нашуд.Ðоми Файл: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "" "Хато дар вақти амалиёти нуÑхабардории файл: Ðавиштан нашуд.Ðоми Файл: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Хондани директориÑ: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Ðигоҳ кардани директориÑ: %1" @@ -1187,11 +1177,11 @@ msgid "Toggle the statusbar..." msgstr "ТаÑвир кардан/вазъиÑти панели пинҳонӣ..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "Файл барои муқоиÑа ёфт нашуд." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1291,123 +1281,123 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." msgstr "" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 #, fuzzy msgid "" "\n" "Nr of automatically solved conflicts: " msgstr "Зуд ҳал мекунад ҷанҷолҳои оддиро" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 #, fuzzy msgid "" "\n" "Nr of unsolved conflicts: " msgstr "Равед ба Ҷанҷоли Дар пеш интизори Ҳалнашуда" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 #, fuzzy msgid "" msgstr "ЯкҷоÑшавӣ ба анҷом раÑид" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 #, fuzzy msgid "" msgstr "ЯкҷоÑшавӣ ба анҷом раÑид" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" msgstr "" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 #, fuzzy msgid "File Save Error" msgstr "Хатогӣ дар кушодани файл" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 #, fuzzy msgid "Error while writing." msgstr "Хатогӣ дар вақти Ñҷод кардани каталог." @@ -1969,74 +1959,74 @@ msgid "Regional Settings" msgstr "" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "Ðмал" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2044,7 +2034,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2054,20 +2044,20 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 #, fuzzy msgid "Select Another Font" msgstr "Интихоб кунед Рах(ҳо)-ро Ðз С" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "" @@ -2203,11 +2193,11 @@ msgid "Search Complete" msgstr "ЯкҷоÑшавӣ ба анҷом раÑид" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Хатогӣ дар вақти Ñҷод кардани каталог." @@ -2398,6 +2388,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Хатогӣ дар вақти хониши каталог" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Хатогӣ дар вақти хониши каталог" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Мушоҳидакунии каталогҳо..." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/tr.po --- a/kdiff3/po/tr.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/tr.po Sat Nov 04 00:05:00 2006 +0000 @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-07-12 10:50+0300\n" "Last-Translator: Alper Sen \n" "Language-Team: Türkçe \n" @@ -68,7 +68,7 @@ "\n" "Satır-eÅŸleme-öniÅŸleme komutu devre dışı bırakılacak." -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -76,7 +76,7 @@ "Veri kaybı hatası:\n" "Bu durum tekrarlanabilir bir durumsa lütfen yazarla iletiÅŸim kurun.\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "Ciddi Dahili Hata" @@ -263,7 +263,7 @@ msgid "Changing All Merge Operations" msgstr "Tüm BirleÅŸtirme İşlemleri DeÄŸiÅŸtiriliyor" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "D&evam Et" @@ -654,16 +654,6 @@ msgid "Unfold All Subdirs" msgstr "Tüm Alt Dizinleri Aç" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "Dizin BirleÅŸtirmesi" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "Dizin BirleÅŸtirmesi" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "Tüm Nesneler için A'yı Seç" @@ -739,7 +729,7 @@ msgid "Merge to A && B" msgstr "A && B ile BirleÅŸtir" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -747,7 +737,7 @@ "Yedekleme yapılırken, eski bir yedeÄŸin silinmesi baÅŸarısız oldu.\n" "Dosya adı: " -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -755,81 +745,81 @@ "Yedekleme yapılırken, yeniden isimlendirme baÅŸarısız oldu.\n" "Dosya adları: " -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "Dosya durumu okunuyor: %1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "Dosya okunuyor: %1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "Dosya yazılıyor: %1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "Hafıza yetersizliÄŸi" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "Dizin oluÅŸturuluyor: %1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "Dizin siliniyor: %1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "Dosya siliniyor: %1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "Sembolik baÄŸ oluÅŸturuluyor: %1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "Dosya yeniden isimlendiriliyor: %1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "Dosya kopyalanıyor: %1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "" "Dosya kopyalanırken hata oluÅŸtu: Dosya okunmak için açılamadı. Dosya adı: %1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "" "Dosya kopyalanırken hata oluÅŸtu: Dosya yazılmak için açılamadı. Dosya adı: %1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "Dosya kopyalanırken hata oluÅŸtu: Okunamadı. Dosya adı: %1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "Dosya kopyalanırken hata oluÅŸtu: Yazılamadı. Dosya adı: %1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "Okuma dizini: " -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "Listeleme dizini: %1" @@ -1187,11 +1177,11 @@ msgid "Toggle the statusbar..." msgstr "" -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "KarşılaÅŸtırılacak dosya bulunamadı." -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1287,16 +1277,16 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 #, fuzzy msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "" "\n" "Çözülmeyen çakışmaların sayısı: " -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1304,52 +1294,52 @@ "Çıktı üzerinde deÄŸiÅŸiklik yapıldı.\n" "Devam ederseniz deÄŸiÅŸiklikleri kaybedeceksiniz." -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "Tüm girdi dosyaları aynı metni içeriyor." -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "A ve B dosyaları aynı metne sahip. \n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "A ve C dosyaları aynı metne sahip. \n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "B ve C dosyaları aynı metne sahip. \n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "Toplam çakışma sayısı: " -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1357,7 +1347,7 @@ "\n" "Otomatik çözülen çakışmaların sayısı: " -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1365,32 +1355,32 @@ "\n" "Çözülmeyen çakışmaların sayısı: " -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "Çakışmalar" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 #, fuzzy msgid "" msgstr "" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[DeÄŸiÅŸiklik Yapıldı]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1398,22 +1388,22 @@ "Daha tüm çakışmalar çözülmedi.\n" "Dosya kaydedilmedi.\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "Çakışmalar Var" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" "Creating backup failed. File not saved." msgstr "" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "Dosya Kaydetme Hatası" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "Yazılırken hata oluÅŸtu." @@ -1988,74 +1978,74 @@ msgid "Regional Settings" msgstr "" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." msgstr "" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." msgstr "" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." msgstr "" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "İşlem" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 msgid "Integration Settings" msgstr "" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2063,7 +2053,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2073,19 +2063,19 @@ "Do you want to continue or do you want to select another font." msgstr "" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "Uyumsuz Yazıtipi" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "Riski Göze Alarak Devam Et" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "BaÅŸka Bir Yazıtipi Seç" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "Bu, sadece bu bölümdekileri deÄŸil, tüm seçenekleri sıfırlar." @@ -2219,11 +2209,11 @@ msgid "Search Complete" msgstr "Arama Tamamlandı" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "Dizin oluÅŸturulması sırasında hata oluÅŸtu." @@ -2411,6 +2401,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "Dizin BirleÅŸtirmesi" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "Dizin BirleÅŸtirmesi" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "Dizinler taranıyor..." diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/uk.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/po/uk.po Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2500 @@ +# Translation of kdiff3.po to Ukrainian +# +# Ivan Petrouchtchak , 2006. +msgid "" +msgstr "" +"Project-Id-Version: kdiff3\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" +"PO-Revision-Date: 2006-06-14 23:20-0700\n" +"Last-Translator: Ivan Petrouchtchak \n" +"Language-Team: Ukrainian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.2\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>" +"=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: _translatorinfo.cpp:1 +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Іван Петрущак" + +#: _translatorinfo.cpp:3 +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "ivanpetrouchtchak@yahoo.com" + +#: diff.cpp:245 +msgid "Writing clipboard data to temp file failed." +msgstr "Помилка запиÑу даних кишені у тимчаÑовий файл." + +#: diff.cpp:249 +msgid "From Clipboard" +msgstr "З кишені" + +#: diff.cpp:451 +msgid "" +"Preprocessing possibly failed. Check this command:\n" +"\n" +" %1\n" +"\n" +"The preprocessing command will be disabled now." +msgstr "" + +#: diff.cpp:486 +msgid "" +"The line-matching-preprocessing possibly failed. Check this command:\n" +"\n" +" %1\n" +"\n" +"The line-matching-preprocessing command will be disabled now." +msgstr "" + +#: diff.cpp:1587 diff.cpp:1601 +msgid "" +"Data loss error:\n" +"If it is reproducable please contact the author.\n" +msgstr "" + +#: diff.cpp:1589 diff.cpp:1603 +msgid "Severe Internal Error" +msgstr "Критична Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ°" + +#: difftextwindow.cpp:1637 kdiff3.cpp:743 +msgid "Top line" +msgstr "Верхній Ñ€Ñдок" + +#: difftextwindow.cpp:1647 +msgid "End" +msgstr "Кінець" + +#: directorymergewindow.cpp:142 +msgid "Mix of links and normal files." +msgstr "Суміш поÑилань Ñ– звичайних файлів." + +#: directorymergewindow.cpp:149 +msgid "Link: " +msgstr "ПоÑиланнÑ: " + +#: directorymergewindow.cpp:157 +msgid "Size. " +msgstr "Розмір. " + +#: directorymergewindow.cpp:170 +msgid "Date & Size: " +msgstr "Дата Ñ– розмір: " + +#: directorymergewindow.cpp:179 directorymergewindow.cpp:185 +msgid "Creating temp copy of %1 failed." +msgstr "Помилка ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ‚Ð¸Ð¼Ñ‡Ð°Ñової копії %1." + +#: directorymergewindow.cpp:196 directorymergewindow.cpp:204 +msgid "Opening %1 failed." +msgstr "Помилка Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ %1." + +#: directorymergewindow.cpp:208 +msgid "Comparing file..." +msgstr "ПорівнÑÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð°..." + +#: directorymergewindow.cpp:218 directorymergewindow.cpp:224 +#, c-format +msgid "Error reading from %1" +msgstr "Помилка Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ð· %1" + +#: directorymergewindow.cpp:282 +msgid "Name" +msgstr "Ðазва" + +#: directorymergewindow.cpp:286 +msgid "Operation" +msgstr "ДіÑ" + +#: directorymergewindow.cpp:287 +msgid "Status" +msgstr "Стан" + +#: directorymergewindow.cpp:288 +msgid "Unsolved" +msgstr "Ðе розв'Ñзано" + +#: directorymergewindow.cpp:289 +msgid "Solved" +msgstr "Розв'Ñзано" + +#: directorymergewindow.cpp:290 +msgid "Nonwhite" +msgstr "Ðе-білий" + +#: directorymergewindow.cpp:291 +msgid "White" +msgstr "Білий" + +#: directorymergewindow.cpp:319 +#, fuzzy +msgid "" +"You are currently doing a directory merge. Are you sure, you want to abort the " +"merge and rescan the directory?" +msgstr "" +"Ви дійÑно хочете цілковито відновити Pilot з резервної копії (%1" +")? Ð¦Ñ Ð´Ñ–Ñ Ð¿Ñ€Ð¸Ð²ÐµÐ´Ðµ до повного ÑÑ‚Ð¸Ñ€Ð°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ… на Pilot." + +#: directorymergewindow.cpp:320 directorymergewindow.cpp:2864 +msgid "Rescan" +msgstr "ПереÑканувати" + +#: directorymergewindow.cpp:320 kdiff3.cpp:594 pdiff.cpp:965 +msgid "Continue Merging" +msgstr "Продовжити об'єднаннÑ" + +#: directorymergewindow.cpp:462 +msgid "Opening of directories failed:" +msgstr "Помилка Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñ–Ð²:" + +#: directorymergewindow.cpp:465 +msgid "" +"Dir A \"%1\" does not exist or is not a directory.\n" +msgstr "" +"Каталог Ð \"%1\" не Ñ–Ñнує або це не каталог.\n" + +#: directorymergewindow.cpp:468 +msgid "" +"Dir B \"%1\" does not exist or is not a directory.\n" +msgstr "" +"Каталог Ð’ \"%1\" не Ñ–Ñнує або це не каталог.\n" + +#: directorymergewindow.cpp:471 +msgid "" +"Dir C \"%1\" does not exist or is not a directory.\n" +msgstr "" +"Каталог С \"%1\" не Ñ–Ñнує або це не каталог.\n" + +#: directorymergewindow.cpp:473 +msgid "Directory Open Error" +msgstr "Помилка Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñƒ" + +#: directorymergewindow.cpp:481 +msgid "" +"The destination directory must not be the same as A or B when three directories " +"are merged.\n" +"Check again before continuing." +msgstr "" + +#: directorymergewindow.cpp:483 +#, fuzzy +msgid "Parameter Warning" +msgstr "" +" Параметр %1 %2=\"%3\"\n" + +#: directorymergewindow.cpp:488 +msgid "Scanning directories..." +msgstr "Ð¡ÐºÐ°Ð½ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñ–Ð²..." + +#: directorymergewindow.cpp:537 +msgid "Reading Directory A" +msgstr "Ð§Ð¸Ñ‚Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñƒ A" + +#: directorymergewindow.cpp:559 +msgid "Reading Directory B" +msgstr "Ð§Ð¸Ñ‚Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñƒ B" + +#: directorymergewindow.cpp:581 +msgid "Reading Directory C" +msgstr "Ð§Ð¸Ñ‚Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñƒ C" + +#: directorymergewindow.cpp:607 +msgid "Some subdirectories were not readable in" +msgstr "" + +#: directorymergewindow.cpp:612 +#, fuzzy +msgid "Check the permissions of the subdirectories." +msgstr "" +"У каталог\n" +"%1\n" +" не можливо запиÑати;\n" +"перевірте, будь лаÑка, права доÑтупу." + +#: directorymergewindow.cpp:646 kdiff3.cpp:547 kdiff3.cpp:627 kdiff3.cpp:651 +#: kdiff3.cpp:924 kdiff3.cpp:945 pdiff.cpp:1045 pdiff.cpp:1117 pdiff.cpp:1155 +#: pdiff.cpp:1171 pdiff.cpp:1201 pdiff.cpp:1212 +msgid "Ready." +msgstr "Готове." + +#: directorymergewindow.cpp:660 +msgid "Directory Comparison Status" +msgstr "Стан порівнÑÐ½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñ–Ð²" + +#: directorymergewindow.cpp:661 +msgid "Number of subdirectories:" +msgstr "КількіÑть підкаталогів:" + +#: directorymergewindow.cpp:662 +#, fuzzy +msgid "Number of equal files:" +msgstr "&КількіÑть wav файлів Ð´Ð»Ñ Ð¾Ð´Ð½Ð¾Ñ‡Ð°Ñного кодуваннÑ:" + +#: directorymergewindow.cpp:663 +#, fuzzy +msgid "Number of different files:" +msgstr "&КількіÑть недавніх файлів у ÑпиÑку:" + +#: directorymergewindow.cpp:666 +#, fuzzy +msgid "Number of manual merges:" +msgstr "" +"КількіÑть фраз: %1\n" + +#: directorymergewindow.cpp:802 +msgid "This affects all merge operations." +msgstr "" + +#: directorymergewindow.cpp:803 +msgid "Changing All Merge Operations" +msgstr "" + +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 +#, fuzzy +msgid "C&ontinue" +msgstr "Пр&одовжити" + +#: directorymergewindow.cpp:1169 +#, fuzzy +msgid "Processing " +msgstr "Пакетна обробка" + +#: directorymergewindow.cpp:1644 directorymergewindow.cpp:1650 +msgid "To do." +msgstr "" + +#: directorymergewindow.cpp:1752 directorymergewindow.cpp:2895 +#, fuzzy +msgid "Copy A to B" +msgstr "%1: Ñкопіювати у проект" + +#: directorymergewindow.cpp:1753 directorymergewindow.cpp:2896 +#, fuzzy +msgid "Copy B to A" +msgstr "%1: Ñкопіювати у проект" + +#: directorymergewindow.cpp:1754 directorymergewindow.cpp:2897 +#, fuzzy +msgid "Delete A" +msgstr "&Видалити рахунок" + +#: directorymergewindow.cpp:1755 directorymergewindow.cpp:2898 +#, fuzzy +msgid "Delete B" +msgstr "Витерти кни&гу" + +#: directorymergewindow.cpp:1756 +#, fuzzy +msgid "Delete A & B" +msgstr "&Видалити рахунок" + +#: directorymergewindow.cpp:1757 directorymergewindow.cpp:2900 +#, fuzzy +msgid "Merge to A" +msgstr "Виберіть Ñке Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð´Ð¾Ð´Ð°Ñ‚Ð¸" + +#: directorymergewindow.cpp:1758 directorymergewindow.cpp:2901 +#, fuzzy +msgid "Merge to B" +msgstr "Штамп Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñу" + +#: directorymergewindow.cpp:1759 +msgid "Merge to A & B" +msgstr "" + +#: directorymergewindow.cpp:1763 directorymergewindow.cpp:2892 +#, fuzzy +msgid "Delete (if exists)" +msgstr "Видалити вÑÑ– Ñ–Ñнуючі заÑтарілі нагадуваннÑ." + +#: directorymergewindow.cpp:1764 directorymergewindow.cpp:1765 +#: directorymergewindow.cpp:2891 smalldialogs.cpp:102 +#, fuzzy +msgid "Merge" +msgstr "Об'єднати" + +#: directorymergewindow.cpp:1764 directorymergewindow.cpp:1765 +msgid "Merge (manual)" +msgstr "" + +#: directorymergewindow.cpp:1766 +msgid "Error: Conflicting File Types" +msgstr "" + +#: directorymergewindow.cpp:1767 +msgid "Error: Dates are equal but files are not." +msgstr "" + +#: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 +#: directorymergewindow.cpp:1845 +#, fuzzy +msgid "This operation is currently not possible." +msgstr "" +"Ð¦Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð° в даний Ñ‡Ð°Ñ Ð¿Ñ€Ð°Ñ†ÑŽÑ” в автономному режимі. Хочете з'єднатиÑÑŒ?" + +#: directorymergewindow.cpp:1791 directorymergewindow.cpp:1820 +#: directorymergewindow.cpp:1845 directorymergewindow.cpp:2102 +#, fuzzy +msgid "Operation Not Possible" +msgstr "Зворотне траÑÑƒÐ²Ð°Ð½Ð½Ñ Ð½ÐµÐ¼Ð¾Ð¶Ð»Ð¸Ð²Ðµ" + +#: directorymergewindow.cpp:1884 +msgid "" +"This should never happen: \n" +"\n" +"mergeResultSaved: m_pMFI=0\n" +"\n" +"If you know how to reproduce this, please contact the program author." +msgstr "" + +#: directorymergewindow.cpp:1884 +#, fuzzy +msgid "Program Error" +msgstr "Помилка програми" + +#: directorymergewindow.cpp:1895 +#, fuzzy +msgid "" +"An error occurred while copying.\n" +msgstr "" +"" +"

Помилка під Ñ‡Ð°Ñ Ñпроби Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ñертифіката:

" +"

%1" +"

" + +#: directorymergewindow.cpp:1896 directorymergewindow.cpp:2302 +#, fuzzy +msgid "Merge Error" +msgstr "&Сховати помилки" + +#: directorymergewindow.cpp:1901 directorymergewindow.cpp:2307 +#, fuzzy +msgid "Error." +msgstr "Помилка." + +#: directorymergewindow.cpp:1906 directorymergewindow.cpp:2198 +#: directorymergewindow.cpp:2238 +#, fuzzy +msgid "Done." +msgstr "Завершено." + +#: directorymergewindow.cpp:1929 +#, fuzzy +msgid "Not saved." +msgstr "Файл не збережено." + +#: directorymergewindow.cpp:1964 +msgid "Unknown merge operation. (This must never happen!)" +msgstr "" + +#: directorymergewindow.cpp:1996 +msgid "Unknown merge operation." +msgstr "" + +#: directorymergewindow.cpp:2011 +msgid "" +"The merge is about to begin.\n" +"\n" +"Choose \"Do it\" if you have read the instructions and know what you are " +"doing.\n" +"Choosing \"Simulate it\" will tell you what would happen.\n" +"\n" +"Be aware that this program still has beta status and there is NO WARRANTY " +"whatsoever! Make backups of your vital data!" +msgstr "" + +#: directorymergewindow.cpp:2016 +#, fuzzy +msgid "Starting Merge" +msgstr "" +"\n" +"ЗапуÑк таблиці Ñтилів\n" +"\n" + +#: directorymergewindow.cpp:2016 +#, fuzzy +msgid "Do It" +msgstr "Зробити це" + +#: directorymergewindow.cpp:2016 +#, fuzzy +msgid "Simulate It" +msgstr "Симулювати помилку" + +#: directorymergewindow.cpp:2042 +msgid "" +"The highlighted item has a different type in the different directories. Select " +"what to do." +msgstr "" + +#: directorymergewindow.cpp:2051 +#, fuzzy +msgid "" +"The modification dates of the file are equal but the files are not. Select what " +"to do." +msgstr "" +"Типово GnuPG викориÑтовує файл ~/.gnupg/policies.txt Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€ÐºÐ¸ чи дозволені " +"правила Ñертифікатів. Якщо цей параметр ввімкнено, правила не перевірÑютьÑÑ." + +#: directorymergewindow.cpp:2102 +#, fuzzy +msgid "" +"This operation is currently not possible because directory merge is currently " +"running." +msgstr "" +"Програму інфрачервоного диÑтанційного ÐºÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ð½Ðµ запущено. Без неї цей модуль " +"конфігурації не працюватиме правильно. Хочете Ñ—Ñ— зараз запуÑтити?" + +#: directorymergewindow.cpp:2162 +#, fuzzy +msgid "" +"There was an error in the last step.\n" +"Do you want to continue with the item that caused the error or do you want to " +"skip this item?" +msgstr "" +"Цей документ було Ñтворено за допомогою OpenOffice.org верÑÑ–Ñ— \"%1\". Цей " +"фільтр напиÑано Ð´Ð»Ñ Ð²ÐµÑ€ÑÑ–Ñ— 1.0. Ð§Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ†ÑŒÐ¾Ð³Ð¾ файла може Ñпричинити хаотичну " +"поведінку, крах або неправильне Ð²Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ…. Хочете продовжити " +"Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°?" + +#: directorymergewindow.cpp:2164 +msgid "Continue merge after an error" +msgstr "" + +#: directorymergewindow.cpp:2164 +msgid "Continue With Last Item" +msgstr "" + +#: directorymergewindow.cpp:2164 +#, fuzzy +msgid "Skip Item" +msgstr "Кинути елемент" + +#: directorymergewindow.cpp:2198 +#, fuzzy +msgid "Skipped." +msgstr "Пропущено %1." + +#: directorymergewindow.cpp:2205 directorymergewindow.cpp:2431 +#, fuzzy +msgid "In progress..." +msgstr "ВідбуваєтьÑÑ Ñ€ÐµÐ·ÐµÑ€Ð²ÑƒÐ²Ð°Ð½Ð½Ñ..." + +#: directorymergewindow.cpp:2253 +#, fuzzy +msgid "Merge operation complete." +msgstr "Запитану дію не може бути завершено." + +#: directorymergewindow.cpp:2253 directorymergewindow.cpp:2256 +#, fuzzy +msgid "Merge Complete" +msgstr "Пере&микнути Ð²Ñ–Ð´Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ… завдань" + +#: directorymergewindow.cpp:2265 +msgid "" +"Simulated merge complete: Check if you agree with the proposed operations." +msgstr "" + +#: directorymergewindow.cpp:2301 +msgid "" +"An error occurred. Press OK to see detailed information.\n" +msgstr "" + +#: directorymergewindow.cpp:2344 +msgid "Error: While deleting %1: Creating backup failed." +msgstr "" + +#: directorymergewindow.cpp:2351 +#, fuzzy +msgid "delete directory recursively( %1 )" +msgstr "Увімкнути/вимкнути рекурÑивне Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñ–Ð² у ÑпиÑок композицій." + +#: directorymergewindow.cpp:2353 +msgid "delete( %1 )" +msgstr "" + +#: directorymergewindow.cpp:2368 +msgid "Error: delete dir operation failed while trying to read the directory." +msgstr "" + +#: directorymergewindow.cpp:2387 +msgid "Error: rmdir( %1 ) operation failed." +msgstr "" + +#: directorymergewindow.cpp:2397 +#, fuzzy +msgid "Error: delete operation failed." +msgstr "Ð”Ñ–Ñ Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð·Ð°Ð·Ð½Ð°Ð»Ð° невдачі." + +#: directorymergewindow.cpp:2423 +msgid "manual merge( %1, %2, %3 -> %4)" +msgstr "" + +#: directorymergewindow.cpp:2426 +msgid "" +" Note: After a manual merge the user should continue by pressing F7." +msgstr "" + +#: directorymergewindow.cpp:2449 +msgid "Error: copy( %1 -> %2 ) failed.Deleting existing destination failed." +msgstr "" + +#: directorymergewindow.cpp:2459 +msgid "copyLink( %1 -> %2 )" +msgstr "" + +#: directorymergewindow.cpp:2470 +msgid "Error: copyLink failed: Remote links are not yet supported." +msgstr "" + +#: directorymergewindow.cpp:2476 +#, fuzzy +msgid "Error: copyLink failed." +msgstr "" +"Виклик \"stat\" на %1 зазнав невдачі.\n" +"Помилка: %2" + +#: directorymergewindow.cpp:2496 +msgid "copy( %1 -> %2 )" +msgstr "" + +#: directorymergewindow.cpp:2522 +msgid "Error during rename( %1 -> %2 ): Cannot delete existing destination." +msgstr "" + +#: directorymergewindow.cpp:2528 +msgid "rename( %1 -> %2 )" +msgstr "" + +#: directorymergewindow.cpp:2537 +#, fuzzy +msgid "Error: Rename failed." +msgstr "" +"Виклик \"stat\" на %1 зазнав невдачі.\n" +"Помилка: %2" + +#: directorymergewindow.cpp:2555 +msgid "Error during makeDir of %1. Cannot delete existing file." +msgstr "" + +#: directorymergewindow.cpp:2571 +msgid "makeDir( %1 )" +msgstr "" + +#: directorymergewindow.cpp:2581 +#, fuzzy +msgid "Error while creating directory." +msgstr "Помилка ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° %1:
%2
" + +#: directorymergewindow.cpp:2604 directorymergewindow.cpp:2721 +msgid "Dest" +msgstr "" + +#: directorymergewindow.cpp:2608 directorymergewindow.cpp:2646 +#, fuzzy +msgid "Dir" +msgstr "Каталог" + +#: directorymergewindow.cpp:2609 +#, fuzzy +msgid "Type" +msgstr "Тип" + +#: directorymergewindow.cpp:2610 +#, fuzzy +msgid "Size" +msgstr "Розмір" + +#: directorymergewindow.cpp:2611 +msgid "Attr" +msgstr "" + +#: directorymergewindow.cpp:2612 +#, fuzzy +msgid "Last Modification" +msgstr "Ð§Ð°Ñ Ð¾Ñтанньої модифікації" + +#: directorymergewindow.cpp:2613 +#, fuzzy +msgid "Link-Destination" +msgstr "Сховати міÑце Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ &поÑиланнÑ" + +#: directorymergewindow.cpp:2663 +#, fuzzy +msgid "not available" +msgstr "не доÑтупне" + +#: directorymergewindow.cpp:2683 +msgid "A (Dest): " +msgstr "" + +#: directorymergewindow.cpp:2686 +msgid "A (Base): " +msgstr "" + +#: directorymergewindow.cpp:2692 +msgid "B (Dest): " +msgstr "" + +#: directorymergewindow.cpp:2700 +msgid "C (Dest): " +msgstr "" + +#: directorymergewindow.cpp:2706 +#, fuzzy +msgid "Dest: " +msgstr "Схід-захід:" + +#: directorymergewindow.cpp:2771 +msgid "Save Directory Merge State As..." +msgstr "" + +#: directorymergewindow.cpp:2858 +msgid "Start/Continue Directory Merge" +msgstr "" + +#: directorymergewindow.cpp:2859 +#, fuzzy +msgid "Run Operation for Current Item" +msgstr "Припинити поточну дію" + +#: directorymergewindow.cpp:2860 +#, fuzzy +msgid "Compare Selected File" +msgstr "&Видалити вибрані файли" + +#: directorymergewindow.cpp:2861 +#, fuzzy +msgid "Merge Current File" +msgstr "Перезавантажити поточний файл з диÑка" + +#: directorymergewindow.cpp:2862 +msgid "Fold All Subdirs" +msgstr "" + +#: directorymergewindow.cpp:2863 +msgid "Unfold All Subdirs" +msgstr "" + +#: directorymergewindow.cpp:2867 +msgid "Choose A for All Items" +msgstr "" + +#: directorymergewindow.cpp:2868 +msgid "Choose B for All Items" +msgstr "" + +#: directorymergewindow.cpp:2869 +msgid "Choose C for All Items" +msgstr "" + +#: directorymergewindow.cpp:2870 +msgid "Auto-Choose Operation for All Items" +msgstr "" + +#: directorymergewindow.cpp:2871 +msgid "No Operation for All Items" +msgstr "" + +#: directorymergewindow.cpp:2876 +#, fuzzy +msgid "Show Identical Files" +msgstr "Вихідний файл та файл Ð¿Ñ€Ð¸Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñпівпадають" + +#: directorymergewindow.cpp:2877 +#, fuzzy +msgid "Show Different Files" +msgstr "Зберегти в інший файл" + +#: directorymergewindow.cpp:2878 +#, fuzzy +msgid "Show Files only in A" +msgstr "Відображати файли, що закінчуютьÑÑ Ð½Ð°: " + +#: directorymergewindow.cpp:2879 +#, fuzzy +msgid "Show Files only in B" +msgstr "Відображати файли, що закінчуютьÑÑ Ð½Ð°: " + +#: directorymergewindow.cpp:2880 +#, fuzzy +msgid "Show Files only in C" +msgstr "Відображати файли, що закінчуютьÑÑ Ð½Ð°: " + +#: directorymergewindow.cpp:2884 +msgid "Compare Explicitly Selected Files" +msgstr "" + +#: directorymergewindow.cpp:2885 +msgid "Merge Explicitly Selected Files" +msgstr "" + +#: directorymergewindow.cpp:2887 directorymergewindow.cpp:2894 +#, fuzzy +msgid "Do Nothing" +msgstr "Ðічого не робити" + +#: directorymergewindow.cpp:2888 +#, fuzzy +msgid "A" +msgstr "A" + +#: directorymergewindow.cpp:2889 +#, fuzzy +msgid "B" +msgstr "Б" + +#: directorymergewindow.cpp:2890 +#, fuzzy +msgid "C" +msgstr "Сі" + +#: directorymergewindow.cpp:2899 +#, fuzzy +msgid "Delete A && B" +msgstr "&Видалити рахунок" + +#: directorymergewindow.cpp:2902 +msgid "Merge to A && B" +msgstr "" + +#: fileaccess.cpp:581 +msgid "" +"While trying to make a backup, deleting an older backup failed. \n" +"Filename: " +msgstr "" + +#: fileaccess.cpp:588 +msgid "" +"While trying to make a backup, renaming failed. \n" +"Filenames: " +msgstr "" + +#: fileaccess.cpp:610 +#, fuzzy, c-format +msgid "Getting file status: %1" +msgstr "ДізнатиÑÑŒ про віддалений Ñтан наÑтупних файлів:" + +#: fileaccess.cpp:653 +#, fuzzy, c-format +msgid "Reading file: %1" +msgstr "Помилка при розборі файла: %1" + +#: fileaccess.cpp:689 +#, fuzzy, c-format +msgid "Writing file: %1" +msgstr "Помилка при розборі файла: %1" + +#: fileaccess.cpp:717 +#, fuzzy +msgid "Out of memory" +msgstr "Ðе виÑтачає пам'Ñті" + +#: fileaccess.cpp:752 +#, fuzzy, c-format +msgid "Making directory: %1" +msgstr "Каталог резервних копій: %1." + +#: fileaccess.cpp:772 +#, fuzzy, c-format +msgid "Removing directory: %1" +msgstr "Каталог резервних копій: %1." + +#: fileaccess.cpp:787 +#, fuzzy, c-format +msgid "Removing file: %1" +msgstr "Ð’Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð´Ð²Ñ–Ð¹ÐºÐ¾Ð²Ð¾Ð³Ð¾ файла %1" + +#: fileaccess.cpp:803 +#, fuzzy +msgid "Creating symbolic link: %1 -> %2" +msgstr "Віддалена машина не підтримує ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñимволічних поÑилань." + +#: fileaccess.cpp:829 +#, fuzzy +msgid "Renaming file: %1 -> %2" +msgstr "ÐŸÐµÑ€ÐµÐ¹Ð¼ÐµÐ½ÑƒÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð²..." + +#: fileaccess.cpp:865 +#, fuzzy +msgid "Copying file: %1 -> %2" +msgstr "ÐšÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² у межах %1 не підтримуєтьÑÑ." + +#: fileaccess.cpp:879 +#, c-format +msgid "" +"Error during file copy operation: Opening file for reading failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:885 +#, c-format +msgid "" +"Error during file copy operation: Opening file for writing failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:900 +#, c-format +msgid "Error during file copy operation: Reading failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:909 +#, c-format +msgid "Error during file copy operation: Writing failed. Filename: %1" +msgstr "" + +#: fileaccess.cpp:1205 +#, fuzzy +msgid "Reading directory: " +msgstr "Ð§Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñтруктури каталогів" + +#: fileaccess.cpp:1334 +#, fuzzy, c-format +msgid "Listing directory: %1" +msgstr "Вільне міÑце в каталозі призначеннÑ: %1" + +#: kdiff3.cpp:142 +#, fuzzy +msgid "Current Configuration:" +msgstr "Comment=ÐšÐ¾Ð½Ñ„Ñ–Ð³ÑƒÑ€Ð°Ñ†Ñ–Ñ ÐºÐ»Ñ–Ñ”Ð½Ñ‚Ð° Citrix ICA" + +#: kdiff3.cpp:147 +#, fuzzy +msgid "Config Option Error:" +msgstr "Помилка конфігурації CUPS" + +#: kdiff3.cpp:187 +msgid "Option --auto used, but no output file specified." +msgstr "" + +#: kdiff3.cpp:318 +msgid "Option --auto ignored for directory comparison." +msgstr "" + +#: kdiff3.cpp:354 +#, fuzzy +msgid "Saving failed." +msgstr "Ðе вдалоÑÑŒ зберегти об'єкт \"%1\"." + +#: kdiff3.cpp:381 pdiff.cpp:1027 pdiff.cpp:1098 +#, fuzzy +msgid "Opening of these files failed:" +msgstr "Виникла помилка при аналізі файла результатів ОРС:" + +#: kdiff3.cpp:390 +#, fuzzy +msgid "File Open Error" +msgstr "Помилка Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ð°" + +#: kdiff3.cpp:413 +#, fuzzy +msgid "Opens documents for comparison..." +msgstr "КількіÑть речень, Ñлів та літер в документі" + +#: kdiff3.cpp:418 +msgid "Saves the merge result. All conflicts must be solved!" +msgstr "" + +#: kdiff3.cpp:420 +#, fuzzy +msgid "Saves the current document as..." +msgstr "Зберігає документ Ñк..." + +#: kdiff3.cpp:422 +#, fuzzy +msgid "Print the differences" +msgstr "Ðемає відмінноÑті від Ñховища." + +#: kdiff3.cpp:424 +#, fuzzy +msgid "Quits the application" +msgstr "ЗупинÑÑ” програму" + +#: kdiff3.cpp:426 +#, fuzzy +msgid "Cuts the selected section and puts it to the clipboard" +msgstr "Вирізає вибране та кладе його у кишеню" + +#: kdiff3.cpp:428 +#, fuzzy +msgid "Copies the selected section to the clipboard" +msgstr "Копіює вибране до кишені" + +#: kdiff3.cpp:430 +#, fuzzy +msgid "Pastes the clipboard contents to actual position" +msgstr "Ð’ÑтавлÑÑ” зміÑÑ‚ кишені в поточну позицію" + +#: kdiff3.cpp:432 +msgid "Select everything in current window" +msgstr "" + +#: kdiff3.cpp:434 +#, fuzzy +msgid "Search for a string" +msgstr "Шукати Ñ€Ñдок" + +#: kdiff3.cpp:436 +#, fuzzy +msgid "Search again for the string" +msgstr "РозглÑдати Ñ€Ñдок пошуку Ñк формальний вираз" + +#: kdiff3.cpp:438 +#, fuzzy +msgid "Enables/disables the toolbar" +msgstr "Вмикає/вимикає пенал" + +#: kdiff3.cpp:440 +#, fuzzy +msgid "Enables/disables the statusbar" +msgstr "Вмикає/вимикає Ñмужку Ñтану" + +#: kdiff3.cpp:444 +#, fuzzy +msgid "Configure KDiff3..." +msgstr "Ðалаштувати KDat..." + +#: kdiff3.cpp:465 +#, fuzzy +msgid "Go to Current Delta" +msgstr "Ð’ÑÑ– &до поточної Ñтільниці" + +#: kdiff3.cpp:466 +msgid "Go to First Delta" +msgstr "" + +#: kdiff3.cpp:467 +msgid "Go to Last Delta" +msgstr "" + +#: kdiff3.cpp:468 +msgid "(Skips white space differences when \"Show White Space\" is disabled.)" +msgstr "" + +#: kdiff3.cpp:469 +msgid "" +"(Does not skip white space differences even when \"Show White Space\" is " +"disabled.)" +msgstr "" + +#: kdiff3.cpp:470 +#, fuzzy +msgid "Go to Previous Delta" +msgstr "Перейти до попереднього ÑеанÑу" + +#: kdiff3.cpp:472 +#, fuzzy +msgid "Go to Next Delta" +msgstr "Перейти до наÑтупного ÑеанÑу" + +#: kdiff3.cpp:474 +#, fuzzy +msgid "Go to Previous Conflict" +msgstr "&ПовернутиÑÑ Ð´Ð¾ попередньої конфігурації" + +#: kdiff3.cpp:476 +#, fuzzy +msgid "Go to Next Conflict" +msgstr "Перейти до наÑтупного ÑеанÑу" + +#: kdiff3.cpp:478 +msgid "Go to Previous Unsolved Conflict" +msgstr "" + +#: kdiff3.cpp:480 +msgid "Go to Next Unsolved Conflict" +msgstr "" + +#: kdiff3.cpp:482 +#, fuzzy +msgid "Select Line(s) From A" +msgstr "Виберіть Ñервер зі ÑпиÑку..." + +#: kdiff3.cpp:483 +#, fuzzy +msgid "Select Line(s) From B" +msgstr "Виберіть Ñервер зі ÑпиÑку..." + +#: kdiff3.cpp:484 +#, fuzzy +msgid "Select Line(s) From C" +msgstr "Виберіть Ñервер зі ÑпиÑку..." + +#: kdiff3.cpp:485 +msgid "Automatically Go to Next Unsolved Conflict After Source Selection" +msgstr "" + +#: kdiff3.cpp:487 +msgid "Show Space && Tabulator Characters for Differences" +msgstr "" + +#: kdiff3.cpp:488 +msgid "Show White Space" +msgstr "" + +#: kdiff3.cpp:490 +#, fuzzy +msgid "Show Line Numbers" +msgstr "Разом з номерами Ñ€Ñдків" + +#: kdiff3.cpp:491 +msgid "Choose A Everywhere" +msgstr "" + +#: kdiff3.cpp:492 +msgid "Choose B Everywhere" +msgstr "" + +#: kdiff3.cpp:493 +msgid "Choose C Everywhere" +msgstr "" + +#: kdiff3.cpp:494 +msgid "Choose A for All Unsolved Conflicts" +msgstr "" + +#: kdiff3.cpp:495 +msgid "Choose B for All Unsolved Conflicts" +msgstr "" + +#: kdiff3.cpp:496 +msgid "Choose C for All Unsolved Conflicts" +msgstr "" + +#: kdiff3.cpp:497 +msgid "Choose A for All Unsolved Whitespace Conflicts" +msgstr "" + +#: kdiff3.cpp:498 +msgid "Choose B for All Unsolved Whitespace Conflicts" +msgstr "" + +#: kdiff3.cpp:499 +msgid "Choose C for All Unsolved Whitespace Conflicts" +msgstr "" + +#: kdiff3.cpp:500 +msgid "Automatically Solve Simple Conflicts" +msgstr "" + +#: kdiff3.cpp:501 +#, fuzzy +msgid "Set Deltas to Conflicts" +msgstr "ЗаÑтоÑувати до вÑÑ–Ñ… конфліктів даної Ñинхронізації" + +#: kdiff3.cpp:502 +#, fuzzy +msgid "Run Regular Expression Auto Merge" +msgstr "Формальні вирази Ð´Ð»Ñ Ð½Ð°Ð·Ð² файлів" + +#: kdiff3.cpp:503 +msgid "Automatically Solve History Conflicts" +msgstr "" + +#: kdiff3.cpp:504 +msgid "Split Diff At Selection" +msgstr "" + +#: kdiff3.cpp:505 +#, fuzzy +msgid "Join Selected Diffs" +msgstr "&Відкрити вибрану таблицю/запит" + +#: kdiff3.cpp:507 +#, fuzzy +msgid "Show Window A" +msgstr "Показувати вÑÑ– &вікна" + +#: kdiff3.cpp:508 +#, fuzzy +msgid "Show Window B" +msgstr "Показувати вÑÑ– &вікна" + +#: kdiff3.cpp:509 +#, fuzzy +msgid "Show Window C" +msgstr "Створене нове вікно" + +#: kdiff3.cpp:510 kdiff3.cpp:521 +#, fuzzy +msgid "Focus Next Window" +msgstr "Ð¤Ð¾ÐºÑƒÑ Ð´Ð¾ наÑтупної Ñтатті" + +#: kdiff3.cpp:512 +#, fuzzy +msgid "Normal Overview" +msgstr "ПереглÑд &флоту" + +#: kdiff3.cpp:513 +msgid "A vs. B Overview" +msgstr "" + +#: kdiff3.cpp:514 +msgid "A vs. C Overview" +msgstr "" + +#: kdiff3.cpp:515 +msgid "B vs. C Overview" +msgstr "" + +#: kdiff3.cpp:516 +msgid "Word Wrap Diff Windows" +msgstr "" + +#: kdiff3.cpp:517 +msgid "Add Manual Diff Alignment" +msgstr "" + +#: kdiff3.cpp:518 +msgid "Clear All Manual Diff Alignments" +msgstr "" + +#: kdiff3.cpp:523 +msgid "Focus Prev Window" +msgstr "" + +#: kdiff3.cpp:524 +#, fuzzy +msgid "Toggle Split Orientation" +msgstr "&ÐžÑ€Ñ–Ñ”Ð½Ñ‚Ð°Ñ†Ñ–Ñ Ñ€Ð¾Ð·Ð±Ð¸Ñ‚Ñ‚Ñ" + +#: kdiff3.cpp:526 +msgid "Dir && Text Split Screen View" +msgstr "" + +#: kdiff3.cpp:528 +msgid "Toggle Between Dir && Text View" +msgstr "" + +#: kdiff3.cpp:573 pdiff.cpp:1698 +msgid "The merge result hasn't been saved." +msgstr "" + +#: kdiff3.cpp:574 +#, fuzzy +msgid "Save && Quit" +msgstr "Зберегти Ñ– з'&єднатиÑÑŒ" + +#: kdiff3.cpp:574 +msgid "Quit Without Saving" +msgstr "" + +#: kdiff3.cpp:582 pdiff.cpp:1707 +#, fuzzy +msgid "Saving the merge result failed." +msgstr "Помилка Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ñ€ÐµÐ·ÑƒÐ»ÑŒÑ‚Ð°Ñ‚Ñ–Ð² %1." + +#: kdiff3.cpp:593 pdiff.cpp:964 +#, fuzzy +msgid "" +"You are currently doing a directory merge. Are you sure, you want to abort?" +msgstr "" +"Ви в даний Ñ‡Ð°Ñ Ð¿Ñ€Ð¸Ð¹Ð¼Ð°Ñ”Ñ‚Ðµ учаÑть у грі. Ви дійÑно хочете закрити Atlantik? Якщо " +"ви вийдете з гри, ви програли." + +#: kdiff3.cpp:616 +#, fuzzy +msgid "Saving file..." +msgstr "Ð—Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð°..." + +#: kdiff3.cpp:633 +#, fuzzy +msgid "Saving file with a new filename..." +msgstr "Зберігаю файл з новим ім'Ñм..." + +#: kdiff3.cpp:722 +#, fuzzy +msgid "Printing..." +msgstr "Друкую..." + +#: kdiff3.cpp:728 kdiff3.cpp:890 +#, fuzzy +msgid "Printing aborted." +msgstr "Друк перервано" + +#: kdiff3.cpp:860 +#, fuzzy +msgid "Selection" +msgstr "Вибір" + +#: kdiff3.cpp:886 +#, fuzzy +msgid "Printing completed." +msgstr "Друк закінчено." + +#: kdiff3.cpp:896 +#, fuzzy +msgid "Exiting..." +msgstr "Вихід..." + +#: kdiff3.cpp:908 +#, fuzzy +msgid "Toggling toolbar..." +msgstr "Перемикаю пенал..." + +#: kdiff3.cpp:929 +#, fuzzy +msgid "Toggle the statusbar..." +msgstr "Перемикаю Ñмужку Ñтану..." + +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 +msgid "Couldn't find files for comparison." +msgstr "" + +#: kdiff3_part.cpp:291 +msgid "KDiff3Part" +msgstr "" + +#: kdiff3_shell.cpp:78 +msgid "" +"Could not find our part!\n" +"This usually happens due to an installation problem. Please read the " +"README-file in the source package for details." +msgstr "" + +#: main.cpp:35 +msgid "Tool for Comparison and Merge of Files and Directories" +msgstr "" + +#: main.cpp:40 +msgid "Merge the input." +msgstr "" + +#: main.cpp:42 +msgid "Explicit base file. For compatibility with certain tools." +msgstr "" + +#: main.cpp:44 +msgid "Output file. Implies -m. E.g.: -o newfile.txt" +msgstr "" + +#: main.cpp:45 +msgid "Output file, again. (For compatibility with certain tools.)" +msgstr "" + +#: main.cpp:46 +msgid "No GUI if all conflicts are auto-solvable. (Needs -o file)" +msgstr "" + +#: main.cpp:47 +msgid "Don't solve conflicts automatically. (For compatibility...)" +msgstr "" + +#: main.cpp:48 +msgid "Visible name replacement for input file 1 (base)." +msgstr "" + +#: main.cpp:49 +msgid "Visible name replacement for input file 2." +msgstr "" + +#: main.cpp:50 +msgid "Visible name replacement for input file 3." +msgstr "" + +#: main.cpp:52 +msgid "Alternative visible name replacement. Supply this once for every input." +msgstr "" + +#: main.cpp:53 +msgid "" +"Override a config setting. Use once for every setting. E.g.: --cs " +"\"AutoAdvance=1\"" +msgstr "" + +#: main.cpp:54 +msgid "Show list of config settings and current values." +msgstr "" + +#: main.cpp:55 +#, fuzzy +msgid "Use a different config file." +msgstr "Виберіть іншу назву Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð° призначеннÑ." + +#: main.cpp:59 +msgid "file1 to open (base, if not specified via --base)" +msgstr "" + +#: main.cpp:60 +#, fuzzy +msgid "file2 to open" +msgstr "Відкрити файл документа" + +#: main.cpp:61 +#, fuzzy +msgid "file3 to open" +msgstr "Відкрити файл документа" + +#: main.cpp:93 +msgid "Ignored. (User defined.)" +msgstr "" + +#. i18n: file kdiff3_part.rc line 16 +#: main.cpp:171 rc.cpp:9 +#, fuzzy, no-c-format +msgid "KDiff3" +msgstr "Diff3" + +#: main.cpp:184 +msgid "+ Many thanks to those who reported bugs and contributed ideas!" +msgstr "" + +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 +msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" +msgstr "" + +#: mergeresultwindow.cpp:283 +#, fuzzy +msgid "" +"The output has been modified.\n" +"If you continue your changes will be lost." +msgstr "" +"Поточний документ було змінено на диÑку Ñ– міÑтить незбережені зміни.\n" +"Якщо ви його перезавантажите, вÑÑ– зміни буде втрачено." + +#: mergeresultwindow.cpp:795 pdiff.cpp:507 +#, fuzzy +msgid "All input files are binary equal." +msgstr "ЗдаєтьÑÑ, вÑÑ– файли однакові." + +#: mergeresultwindow.cpp:797 +msgid "All input files contain the same text." +msgstr "" + +#: mergeresultwindow.cpp:799 +msgid "" +"Files A and B are binary equal.\n" +msgstr "" + +#: mergeresultwindow.cpp:800 +msgid "" +"Files A and B have equal text. \n" +msgstr "" + +#: mergeresultwindow.cpp:801 +msgid "" +"Files A and C are binary equal.\n" +msgstr "" + +#: mergeresultwindow.cpp:802 +msgid "" +"Files A and C have equal text. \n" +msgstr "" + +#: mergeresultwindow.cpp:803 +msgid "" +"Files B and C are binary equal.\n" +msgstr "" + +#: mergeresultwindow.cpp:804 +msgid "" +"Files B and C have equal text. \n" +msgstr "" + +#: mergeresultwindow.cpp:810 +#, fuzzy +msgid "Total number of conflicts: " +msgstr "Друкувати деÑкі контакти." + +#: mergeresultwindow.cpp:811 +msgid "" +"\n" +"Nr of automatically solved conflicts: " +msgstr "" + +#: mergeresultwindow.cpp:812 +#, fuzzy +msgid "" +"\n" +"Nr of unsolved conflicts: " +msgstr "Розв'Ñзано конфлікт Ð´Ð»Ñ %1." + +#: mergeresultwindow.cpp:814 +#, fuzzy +msgid "Conflicts" +msgstr "Конфлікти" + +#: mergeresultwindow.cpp:1650 +msgid "" +msgstr "" + +#: mergeresultwindow.cpp:1658 +msgid "" +msgstr "" + +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 +msgid "" +msgstr "" + +#: mergeresultwindow.cpp:1730 +#, fuzzy +msgid "Output" +msgstr "Вивід" + +#: mergeresultwindow.cpp:1732 +#, fuzzy +msgid "[Modified]" +msgstr "З&мінено" + +#: mergeresultwindow.cpp:2656 +msgid "" +"Not all conflicts are solved yet.\n" +"File not saved.\n" +msgstr "" + +#: mergeresultwindow.cpp:2658 +#, fuzzy +msgid "Conflicts Left" +msgstr "Конфлікти й дублікати" + +#: mergeresultwindow.cpp:2670 +msgid "" +"\n" +"\n" +"Creating backup failed. File not saved." +msgstr "" + +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 +#, fuzzy +msgid "File Save Error" +msgstr "Помилка Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ð´Ñ–Ð°Ð³Ñ€Ð°Ð¼Ð¸." + +#: mergeresultwindow.cpp:2710 +#, fuzzy +msgid "Error while writing." +msgstr "Помилка Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ‚ÐµÐºÑту %1." + +#: optiondialog.cpp:361 +msgid "Unicode, 8 bit" +msgstr "" + +#: optiondialog.cpp:362 +#, fuzzy +msgid "Unicode" +msgstr "Юнікод" + +#: optiondialog.cpp:363 +#, fuzzy +msgid "Latin1" +msgstr "Latin1" + +#: optiondialog.cpp:382 +msgid "Change this if non-ASCII characters are not displayed correctly." +msgstr "" + +#: optiondialog.cpp:507 +msgid "Editor & Diff Output Font" +msgstr "" + +#: optiondialog.cpp:528 +msgid "Italic font for deltas" +msgstr "" + +#: optiondialog.cpp:531 +msgid "" +"Selects the italic version of the font for differences.\n" +"If the font doesn't support italic characters, then this does nothing." +msgstr "" + +#: optiondialog.cpp:539 +#, fuzzy +msgid "Color" +msgstr "Ð’ кольорі" + +#: optiondialog.cpp:539 +#, fuzzy +msgid "Colors Settings" +msgstr "Параметри кольору HTML" + +#: optiondialog.cpp:553 +msgid "Editor and Diff Views:" +msgstr "" + +#: optiondialog.cpp:561 +#, fuzzy +msgid "Foreground color:" +msgstr "Колір переднього плану:" + +#: optiondialog.cpp:567 +#, fuzzy +msgid "Background color:" +msgstr "Колір тла:" + +#: optiondialog.cpp:575 +#, fuzzy +msgid "Diff background color:" +msgstr "&Колір тла текÑту:" + +#: optiondialog.cpp:582 +#, fuzzy +msgid "Color A:" +msgstr "ÐšÐ¾Ñ€ÐµÐºÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ñƒ" + +#: optiondialog.cpp:589 +#, fuzzy +msgid "Color B:" +msgstr "Пенал кольорів" + +#: optiondialog.cpp:596 +#, fuzzy +msgid "Color C:" +msgstr "Вибір кольорів" + +#: optiondialog.cpp:602 +#, fuzzy +msgid "Conflict color:" +msgstr "&Виберіть колір:" + +#: optiondialog.cpp:609 +#, fuzzy +msgid "Current range background color:" +msgstr "Змінити колір тла вибраного текÑту." + +#: optiondialog.cpp:616 +#, fuzzy +msgid "Current range diff background color:" +msgstr "Змінити колір тла вибраного текÑту." + +#: optiondialog.cpp:622 +msgid "Color for manually aligned difference ranges:" +msgstr "" + +#: optiondialog.cpp:627 +msgid "Directory Comparison View:" +msgstr "" + +#: optiondialog.cpp:633 +msgid "Newest file color:" +msgstr "" + +#: optiondialog.cpp:636 +msgid "" +"Changing this color will only be effective when starting the next directory " +"comparison." +msgstr "" + +#: optiondialog.cpp:641 +msgid "Oldest file color:" +msgstr "" + +#: optiondialog.cpp:648 +msgid "Middle age file color:" +msgstr "" + +#: optiondialog.cpp:655 +#, fuzzy +msgid "Color for missing files:" +msgstr "\"require\" відÑÑƒÑ‚Ð½Ñ Ð´Ð»Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸ \"%1\"" + +#: optiondialog.cpp:667 +#, fuzzy +msgid "Editor" +msgstr "Редактор" + +#: optiondialog.cpp:667 +#, fuzzy +msgid "Editor Behavior" +msgstr "Режим роботи редактора" + +#: optiondialog.cpp:677 +#, fuzzy +msgid "Tab inserts spaces" +msgstr "Вживати &пробіли заміÑть табулÑції" + +#: optiondialog.cpp:680 +msgid "" +"On: Pressing tab generates the appropriate number of spaces.\n" +"Off: A Tab-character will be inserted." +msgstr "" + +#: optiondialog.cpp:686 +#, fuzzy +msgid "Tab size:" +msgstr "Розмір табулÑції:" + +#: optiondialog.cpp:691 +#, fuzzy +msgid "Auto indentation" +msgstr "ÐвтовідÑтуп" + +#: optiondialog.cpp:694 +msgid "" +"On: The indentation of the previous line is used for a new line.\n" +msgstr "" + +#: optiondialog.cpp:698 +#, fuzzy +msgid "Auto copy selection" +msgstr "Щоб вибрати, потÑгніть при натиÑнутій лівій кнопці." + +#: optiondialog.cpp:701 +msgid "" +"On: Any selection is immediately written to the clipboard.\n" +"Off: You must explicitely copy e.g. via Ctrl-C." +msgstr "" + +#: optiondialog.cpp:706 +#, fuzzy +msgid "Line end style:" +msgstr "Стиль кін&ців лінії:" + +#: optiondialog.cpp:718 +msgid "" +"Sets the line endings for when an edited file is saved.\n" +"DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A" +msgstr "" + +#: optiondialog.cpp:729 +msgid "Diff and Merge" +msgstr "" + +#: optiondialog.cpp:729 +#, fuzzy +msgid "Diff and Merge Settings" +msgstr "Зберегти параметри Ñ– закрити" + +#: optiondialog.cpp:740 +#, fuzzy +msgid "Preserve carriage return" +msgstr "Стиль &MacOS (тільки Ð¿Ð¾Ð²ÐµÑ€Ð½ÐµÐ½Ð½Ñ ÐºÐ°Ñ€ÐµÑ‚ÐºÐ¸)" + +#: optiondialog.cpp:743 +msgid "" +"Show carriage return characters '\\r' if they exist.\n" +"Helps to compare files that were modified under different operating systems." +msgstr "" + +#: optiondialog.cpp:748 +#, fuzzy +msgid "Ignore numbers" +msgstr "Додати номери Ñторінок" + +#: optiondialog.cpp:751 +msgid "" +"Ignore number characters during line matching phase. (Similar to Ignore white " +"space.)\n" +"Might help to compare files with numeric data." +msgstr "" + +#: optiondialog.cpp:756 +msgid "Ignore C/C++ comments" +msgstr "" + +#: optiondialog.cpp:758 +msgid "Treat C/C++ comments like white space." +msgstr "" + +#: optiondialog.cpp:762 +#, fuzzy +msgid "Ignore case" +msgstr "Без ÑƒÑ€Ð°Ñ…ÑƒÐ²Ð°Ð½Ð½Ñ Ñ€ÐµÐ³Ñ–Ñтру" + +#: optiondialog.cpp:765 +msgid "Treat case differences like white space changes. ('a'<=>'A')" +msgstr "" + +#: optiondialog.cpp:769 +#, fuzzy +msgid "Preprocessor command:" +msgstr "Попередню підготовку звуку закінчено." + +#: optiondialog.cpp:773 +msgid "User defined pre-processing. (See the docs for details.)" +msgstr "" + +#: optiondialog.cpp:776 +msgid "Line-matching preprocessor command:" +msgstr "" + +#: optiondialog.cpp:780 +msgid "" +"This pre-processor is only used during line matching.\n" +"(See the docs for details.)" +msgstr "" + +#: optiondialog.cpp:783 +msgid "Try hard (slower)" +msgstr "" + +#: optiondialog.cpp:786 +msgid "" +"Enables the --minimal option for the external diff.\n" +"The analysis of big files will be much slower." +msgstr "" + +#: optiondialog.cpp:791 +msgid "Auto advance delay (ms):" +msgstr "" + +#: optiondialog.cpp:796 +msgid "" +"When in Auto-Advance mode the result of the current selection is shown \n" +"for the specified time, before jumping to the next conflict. Range: 0-2000 ms" +msgstr "" + +#: optiondialog.cpp:801 +msgid "White space 2-file merge default:" +msgstr "" + +#: optiondialog.cpp:805 optiondialog.cpp:818 +#, fuzzy +msgid "Manual Choice" +msgstr "при перевірці пошти вручну" + +#: optiondialog.cpp:809 optiondialog.cpp:823 +msgid "" +"Allow the merge algorithm to automatically select an input for white-space-only " +"changes." +msgstr "" + +#: optiondialog.cpp:814 +msgid "White space 3-file merge default:" +msgstr "" + +#: optiondialog.cpp:828 +#, fuzzy +msgid "Automatic Merge Regular Expression" +msgstr "&Зберегти формальний вираз..." + +#: optiondialog.cpp:837 smalldialogs.cpp:379 +#, fuzzy +msgid "Auto merge regular expression:" +msgstr "&Формальний вираз меж речень:" + +#: optiondialog.cpp:841 +msgid "" +"Regular expression for lines where KDiff3 should automatically choose one " +"source.\n" +"When a line with a conflict matches the regular expression then\n" +"- if available - C, otherwise B will be chosen." +msgstr "" + +#: optiondialog.cpp:847 +#, fuzzy +msgid "Run regular expression auto merge on merge start" +msgstr "" +"Ваш формальний вираз неправильний, оÑкільки щоÑÑŒ передує \"початок Ñ€Ñдка\"." + +#: optiondialog.cpp:849 +msgid "" +"Run the merge for auto merge regular expressions\n" +"immediately when a merge starts.\n" +msgstr "" + +#: optiondialog.cpp:854 +msgid "Version Control History Merging" +msgstr "" + +#: optiondialog.cpp:863 smalldialogs.cpp:406 +#, fuzzy +msgid "History start regular expression:" +msgstr "&Формальний вираз меж речень:" + +#: optiondialog.cpp:867 +msgid "" +"Regular expression for the start of the version control history entry.\n" +"Usually this line contains the \"$Log$\"-keyword.\n" +"Default value: \".*\\$Log.*\\$.*\"" +msgstr "" + +#: optiondialog.cpp:873 smalldialogs.cpp:435 +#, fuzzy +msgid "History entry start regular expression:" +msgstr "&Формальний вираз меж речень:" + +#: optiondialog.cpp:885 +msgid "" +"A version control history entry consists of several lines.\n" +"Specify the regular expression to detect the first line (without the leading " +"comment).\n" +"Use parentheses to group the keys you want to use for sorting.\n" +"If left empty, then KDiff3 assumes that empty lines separate history entries.\n" +"See the documentation for details." +msgstr "" + +#: optiondialog.cpp:893 +msgid "History merge sorting" +msgstr "" + +#: optiondialog.cpp:895 +msgid "Sort version control history by a key." +msgstr "" + +#: optiondialog.cpp:905 +msgid "History entry start sort key order:" +msgstr "" + +#: optiondialog.cpp:909 +msgid "" +"Each parentheses used in the regular expression for the history start entry\n" +"groups a key that can be used for sorting.\n" +"Specify the list of keys (that are numbered in order of occurrence\n" +"starting with 1) using ',' as separator (e.g. \"4,5,6,1,2,3,7\").\n" +"If left empty, then no sorting will be done.\n" +"See the documentation for details." +msgstr "" + +#: optiondialog.cpp:920 +msgid "Merge version control history on merge start" +msgstr "" + +#: optiondialog.cpp:922 +msgid "Run version control history automerge on merge start." +msgstr "" + +#: optiondialog.cpp:926 +#, fuzzy +msgid "Test your regular expressions" +msgstr "Локальні Ñимволи Ð´Ð»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ð»ÑŒÐ½Ð¸Ñ… виразів:" + +#: optiondialog.cpp:931 +msgid "Irrelevant merge command:" +msgstr "" + +#: optiondialog.cpp:935 +msgid "" +"If specified this script is run after automerge\n" +"when no other relevant changes were detected.\n" +"Called with the parameters: filename1 filename2 filename3" +msgstr "" + +#: optiondialog.cpp:945 +#, fuzzy +msgid "Directory Merge" +msgstr "ПрипиÑÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñ–Ð²" + +#: optiondialog.cpp:954 +#, fuzzy +msgid "Recursive directories" +msgstr "ÐŸÑ–Ð´Ñ€Ð°Ñ…ÑƒÐ²Ð°Ð½Ð½Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ñ–Ð²..." + +#: optiondialog.cpp:956 +#, fuzzy +msgid "Whether to analyze subdirectories or not." +msgstr "Чи додавати каталоги до ÑпиÑку композицій рекурÑивно" + +#: optiondialog.cpp:958 +#, fuzzy +msgid "File pattern(s):" +msgstr "Виберіть Ñтиль або шаблон." + +#: optiondialog.cpp:963 +msgid "" +"Pattern(s) of files to be analyzed. \n" +"Wildcards: '*' and '?'\n" +"Several Patterns can be specified by using the separator: ';'" +msgstr "" + +#: optiondialog.cpp:969 +msgid "File-anti-pattern(s):" +msgstr "" + +#: optiondialog.cpp:974 +msgid "" +"Pattern(s) of files to be excluded from analysis. \n" +"Wildcards: '*' and '?'\n" +"Several Patterns can be specified by using the separator: ';'" +msgstr "" + +#: optiondialog.cpp:980 +msgid "Dir-anti-pattern(s):" +msgstr "" + +#: optiondialog.cpp:985 +msgid "" +"Pattern(s) of directories to be excluded from analysis. \n" +"Wildcards: '*' and '?'\n" +"Several Patterns can be specified by using the separator: ';'" +msgstr "" + +#: optiondialog.cpp:991 +msgid "Use .cvsignore" +msgstr "" + +#: optiondialog.cpp:994 +msgid "" +"Extends the antipattern to anything that would be ignored by CVS.\n" +"Via local \".cvsignore\"-files this can be directory specific." +msgstr "" + +#: optiondialog.cpp:999 +#, fuzzy +msgid "Find hidden files and directories" +msgstr "Ігнорувати приховані файли та теки" + +#: optiondialog.cpp:1002 +msgid "Finds files and directories with the hidden attribute." +msgstr "" + +#: optiondialog.cpp:1004 +msgid "Finds files and directories starting with '.'." +msgstr "" + +#: optiondialog.cpp:1008 +#, fuzzy +msgid "Follow file links" +msgstr "&Йти за Ñимволічними поÑиланнÑми" + +#: optiondialog.cpp:1011 +msgid "" +"On: Compare the file the link points to.\n" +"Off: Compare the links." +msgstr "" + +#: optiondialog.cpp:1016 +msgid "Follow directory links" +msgstr "" + +#: optiondialog.cpp:1019 +#, fuzzy +msgid "" +"On: Compare the directory the link points to.\n" +"Off: Compare the links." +msgstr "" +"ДозволÑти навігацію по Ñимволічних поÑиланнÑÑ…, Ñкі вка&зують на ділÑнки поза " +"деревом каталогу" + +#: optiondialog.cpp:1035 +msgid "Case sensitive filename comparison" +msgstr "" + +#: optiondialog.cpp:1038 +msgid "" +"The directory comparison will compare files or directories when their names " +"match.\n" +"Set this option if the case of the names must match. (Default for Windows is " +"off, otherwise on.)" +msgstr "" + +#: optiondialog.cpp:1042 +msgid "File Comparison Mode" +msgstr "" + +#: optiondialog.cpp:1046 +msgid "Binary comparison" +msgstr "" + +#: optiondialog.cpp:1047 +msgid "Binary comparison of each file. (Default)" +msgstr "" + +#: optiondialog.cpp:1049 +msgid "Full analysis" +msgstr "" + +#: optiondialog.cpp:1050 +msgid "" +"Do a full analysis and show statistics information in extra columns.\n" +"(Slower than a binary comparison, much slower for binary files.)" +msgstr "" + +#: optiondialog.cpp:1053 +#, fuzzy +msgid "Trust the modification date (unsafe)" +msgstr "Модифіковано:%1" + +#: optiondialog.cpp:1054 +msgid "" +"Assume that files are equal if the modification date and file length are " +"equal.\n" +"Useful for big directories or slow networks." +msgstr "" + +#: optiondialog.cpp:1057 +msgid "Trust the size (unsafe)" +msgstr "" + +#: optiondialog.cpp:1058 +msgid "" +"Assume that files are equal if their file lengths are equal.\n" +"Useful for big directories or slow networks when the date is modified during " +"download." +msgstr "" + +#: optiondialog.cpp:1062 +#, fuzzy +msgid "Synchronize directories" +msgstr "Ðе вдаєтьÑÑ Ñ€Ð¾Ð·Ð¼Ñ–Ñтити файл; неможливо Ñтворювати теки." + +#: optiondialog.cpp:1065 +msgid "" +"Offers to store files in both directories so that\n" +"both directories are the same afterwards.\n" +"Works only when comparing two directories without specifying a destination." +msgstr "" + +#: optiondialog.cpp:1071 +msgid "White space differences considered equal" +msgstr "" + +#: optiondialog.cpp:1074 +msgid "" +"If files differ only by white space consider them equal.\n" +"This is only active when full analysis is chosen." +msgstr "" + +#: optiondialog.cpp:1080 +msgid "Copy newer instead of merging (unsafe)" +msgstr "" + +#: optiondialog.cpp:1083 +msgid "" +"Don't look inside, just take the newer file.\n" +"(Use this only if you know what you are doing!)\n" +"Only effective when comparing two directories." +msgstr "" + +#: optiondialog.cpp:1088 +#, fuzzy +msgid "Backup files (.orig)" +msgstr "Файли резерву:" + +#: optiondialog.cpp:1091 +msgid "" +"When a file would be saved over an old file, then the old file\n" +"will be renamed with a '.orig'-extension instead of being deleted." +msgstr "" + +#: optiondialog.cpp:1118 +#, fuzzy +msgid "Regional Settings" +msgstr "Регіональні параметри" + +#: optiondialog.cpp:1214 +msgid "Language (restart required)" +msgstr "" + +#: optiondialog.cpp:1246 +msgid "" +"Choose the language of the GUI-strings or \"Auto\".\n" +"For a change of language to take place, quit and restart KDiff3." +msgstr "" + +#: optiondialog.cpp:1264 +msgid "Use the same encoding for everything:" +msgstr "" + +#: optiondialog.cpp:1267 +msgid "" +"Enable this allows to change all encodings by changing the first only.\n" +"Disable this if different individual settings are needed." +msgstr "" + +#: optiondialog.cpp:1272 +msgid "Note: Local Encoding is " +msgstr "" + +#: optiondialog.cpp:1276 +#, fuzzy +msgid "File Encoding for A:" +msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ кодуваннÑ" + +#: optiondialog.cpp:1281 +#, fuzzy +msgid "File Encoding for B:" +msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ кодуваннÑ" + +#: optiondialog.cpp:1286 +#, fuzzy +msgid "File Encoding for C:" +msgstr "ÐŸÐ¾Ð¿ÐµÑ€ÐµÐ´Ð¶ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ кодуваннÑ" + +#: optiondialog.cpp:1291 +msgid "File Encoding for Merge Output and Saving:" +msgstr "" + +#: optiondialog.cpp:1296 +msgid "File Encoding for Preprocessor Files:" +msgstr "" + +#: optiondialog.cpp:1305 +msgid "Right To Left Language" +msgstr "" + +#: optiondialog.cpp:1308 +msgid "" +"Some languages are read from right to left.\n" +"This setting will change the viewer and editor accordingly." +msgstr "" + +#: optiondialog.cpp:1318 +msgid "Integration" +msgstr "ІнтеграціÑ" + +#: optiondialog.cpp:1318 +msgid "Integration Settings" +msgstr "Параметри інтеграції" + +#: optiondialog.cpp:1328 +#, fuzzy +msgid "Command line options to ignore:" +msgstr "" +"ВикориÑтовуйте --help щоб отримати ÑпиÑок можливих опцій командної Ñтроки." + +#: optiondialog.cpp:1333 +msgid "" +"List of command line options that should be ignored when KDiff3 is used by " +"other tools.\n" +"Several values can be specified if separated via ';'\n" +"This will suppress the \"Unknown option\"-error." +msgstr "" + +#: optiondialog.cpp:1386 +msgid "" +"You selected a variable width font.\n" +"\n" +"Because this program doesn't handle variable width fonts\n" +"correctly, you might experience problems while editing.\n" +"\n" +"Do you want to continue or do you want to select another font." +msgstr "" + +#: optiondialog.cpp:1390 +#, fuzzy +msgid "Incompatible Font" +msgstr "%1 неÑуміÑне з %2" + +#: optiondialog.cpp:1391 +msgid "Continue at Own Risk" +msgstr "" + +#: optiondialog.cpp:1391 +#, fuzzy +msgid "Select Another Font" +msgstr "Виберіть будь-Ñкі інші втулки:" + +#: optiondialog.cpp:1416 +msgid "This resets all options. Not only those of the current topic." +msgstr "" + +#: pdiff.cpp:258 +#, fuzzy +msgid "PreprocessorCmd: " +msgstr "Перед-переглÑд (тип 1)" + +#: pdiff.cpp:263 +msgid "" +"The following option(s) you selected might change data:\n" +msgstr "" + +#: pdiff.cpp:264 +#, fuzzy +msgid "" +"\n" +"Most likely this is not wanted during a merge.\n" +"Do you want to disable these settings or continue with these settings active?" +msgstr "" +"Ввімкніть цей параметр, Ñкщо не хочете щоб при з'єднанні з машиною Ð’Ð°Ñ " +"запитували про уÑтановки. Ð”Ð»Ñ Ð¼Ð°ÑˆÐ¸Ð½ з Ñ–Ñнуючими профілÑми ці профілі будуть " +"взÑті. Ðові машини будуть налаштовані типовими значеннÑми." + +#: pdiff.cpp:266 +msgid "Option Unsafe for Merging" +msgstr "" + +#: pdiff.cpp:267 +msgid "Use These Options During Merge" +msgstr "" + +#: pdiff.cpp:267 +msgid "Disable Unsafe Options" +msgstr "" + +#: pdiff.cpp:297 +msgid "Loading A" +msgstr "Ð—Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ A" + +#: pdiff.cpp:301 +msgid "Loading B" +msgstr "Ð—Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ B" + +#: pdiff.cpp:318 pdiff.cpp:344 +msgid "Diff: A <-> B" +msgstr "" + +#: pdiff.cpp:324 pdiff.cpp:366 +msgid "Linediff: A <-> B" +msgstr "" + +#: pdiff.cpp:335 +msgid "Loading C" +msgstr "Ð—Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ C" + +#: pdiff.cpp:347 +msgid "Diff: B <-> C" +msgstr "" + +#: pdiff.cpp:350 +msgid "Diff: A <-> C" +msgstr "" + +#: pdiff.cpp:369 +msgid "Linediff: B <-> C" +msgstr "" + +#: pdiff.cpp:372 +msgid "Linediff: A <-> C" +msgstr "" + +#: pdiff.cpp:509 +msgid "All input files contain the same text, but are not binary equal." +msgstr "" + +#: pdiff.cpp:511 pdiff.cpp:513 pdiff.cpp:515 +msgid "" +"Files %1 and %2 are binary equal.\n" +msgstr "" + +#: pdiff.cpp:512 pdiff.cpp:514 pdiff.cpp:516 +msgid "" +"Files %1 and %2 have equal text, but are not binary equal. \n" +msgstr "" + +#: pdiff.cpp:526 +msgid "" +"Some inputfiles don't seem to be pure textfiles.\n" +"Note that the KDiff3-merge was not meant for binary data.\n" +"Continue at your own risk." +msgstr "" + +#: pdiff.cpp:965 +msgid "Abort" +msgstr "Перервати" + +#: pdiff.cpp:971 pdiff.cpp:1059 +msgid "Opening files..." +msgstr "Ð’Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð²..." + +#: pdiff.cpp:1036 pdiff.cpp:1107 +msgid "File open error" +msgstr "Помилка Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ð°" + +#: pdiff.cpp:1139 +msgid "Cutting selection..." +msgstr "Ð’Ð¸Ñ€Ñ–Ð·Ð°Ð½Ð½Ñ Ð²Ð¸Ð±Ñ€Ð°Ð½Ð¾Ð³Ð¾..." + +#: pdiff.cpp:1160 +msgid "Copying selection to clipboard..." +msgstr "ÐšÐ¾Ð¿Ñ–ÑŽÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ð±Ñ€Ð°Ð½Ð¾Ð³Ð¾ до кишені..." + +#: pdiff.cpp:1176 +msgid "Inserting clipboard contents..." +msgstr "Ð’ÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð²Ð¼Ñ–Ñту кишені..." + +#: pdiff.cpp:1699 +msgid "Save && Continue" +msgstr "Зберегти й продовжити" + +#: pdiff.cpp:1699 +msgid "Continue Without Saving" +msgstr "Продовжити без збереженнÑ" + +#: pdiff.cpp:1906 +msgid "Search complete." +msgstr "Пошук завершено." + +#: pdiff.cpp:1906 +msgid "Search Complete" +msgstr "Пошук завершено" + +#: pdiff.cpp:2130 +msgid "Nothing is selected in either diff input window." +msgstr "" + +#: pdiff.cpp:2130 +#, fuzzy +msgid "Error while adding manual diff range" +msgstr "Помилка Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð´Ð¾ теки %1 в KMail" + +#. i18n: file kdiff3_part.rc line 4 +#: rc.cpp:3 +#, no-c-format +msgid "&KDiff3" +msgstr "&KDiff3" + +#. i18n: file kdiff3_part.rc line 13 +#: rc.cpp:6 +#, no-c-format +msgid "Configure KDiff3" +msgstr "Ðалаштувати KDiff3" + +#. i18n: file kdiff3_shell.rc line 7 +#: rc.cpp:15 +#, no-c-format +msgid "&Directory" +msgstr "&Каталог" + +#. i18n: file kdiff3_shell.rc line 30 +#: rc.cpp:18 +#, fuzzy, no-c-format +msgid "Current Item Merge Operation" +msgstr "Припинити поточну дію" + +#. i18n: file kdiff3_shell.rc line 38 +#: rc.cpp:21 +#, fuzzy, no-c-format +msgid "Current Item Sync Operation" +msgstr "Припинити поточну дію" + +#. i18n: file kdiff3_shell.rc line 50 +#: rc.cpp:24 +#, fuzzy, no-c-format +msgid "&Movement" +msgstr "&Мінімальний рух:" + +#. i18n: file kdiff3_shell.rc line 61 +#: rc.cpp:27 +#, no-c-format +msgid "D&iffview" +msgstr "" + +#. i18n: file kdiff3_shell.rc line 73 +#: rc.cpp:30 +#, no-c-format +msgid "&Merge" +msgstr "&Об'єднати" + +#. i18n: file kdiff3_shell.rc line 95 +#: rc.cpp:33 +#, no-c-format +msgid "&Window" +msgstr "&Вікно" + +#: smalldialogs.cpp:53 +msgid "A (Base):" +msgstr "" + +#: smalldialogs.cpp:59 smalldialogs.cpp:75 smalldialogs.cpp:91 +#: smalldialogs.cpp:134 +msgid "File..." +msgstr "Файл..." + +#: smalldialogs.cpp:61 smalldialogs.cpp:77 smalldialogs.cpp:93 +#: smalldialogs.cpp:136 +msgid "Dir..." +msgstr "Каталог..." + +#: smalldialogs.cpp:86 +#, fuzzy +msgid "C (Optional):" +msgstr "Лоток 3 (додатковий)" + +#: smalldialogs.cpp:108 +msgid "Swap/Copy Names ..." +msgstr "" + +#: smalldialogs.cpp:114 smalldialogs.cpp:115 smalldialogs.cpp:116 +msgid "Swap %1<->%2" +msgstr "" + +#: smalldialogs.cpp:117 smalldialogs.cpp:118 smalldialogs.cpp:119 +msgid "Copy %1->Output" +msgstr "" + +#: smalldialogs.cpp:120 smalldialogs.cpp:121 smalldialogs.cpp:122 +msgid "Swap %1<->Output" +msgstr "" + +#: smalldialogs.cpp:129 +#, fuzzy +msgid "Output (optional):" +msgstr "Коментар (не обов'Ñзковий):" + +#: smalldialogs.cpp:158 +msgid "Configure..." +msgstr "Ðалаштувати..." + +#: smalldialogs.cpp:329 +msgid "Search text:" +msgstr "Знайти текÑÑ‚:" + +#: smalldialogs.cpp:336 +#, fuzzy +msgid "Case sensitive" +msgstr "РегіÑтрова чутливіÑть" + +#: smalldialogs.cpp:339 +msgid "Search A" +msgstr "Пошук в A" + +#: smalldialogs.cpp:344 +msgid "Search B" +msgstr "Пошук в B" + +#: smalldialogs.cpp:349 +msgid "Search C" +msgstr "Пошук в C" + +#: smalldialogs.cpp:354 +msgid "Search output" +msgstr "Пошук у виводі" + +#: smalldialogs.cpp:359 +msgid "&Search" +msgstr "&Пошук" + +#: smalldialogs.cpp:376 +#, fuzzy +msgid "Regular Expression Tester" +msgstr "Помилка Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ð»ÑŒÐ½Ð¾Ð³Ð¾ виразу з XML" + +#: smalldialogs.cpp:387 +msgid "Example auto merge line:" +msgstr "" + +#: smalldialogs.cpp:389 +msgid "For auto merge test copy a line as used in your files." +msgstr "" + +#: smalldialogs.cpp:395 smalldialogs.cpp:424 smalldialogs.cpp:461 +#, fuzzy +msgid "Match result:" +msgstr "Результат пошуку: %1" + +#: smalldialogs.cpp:414 +msgid "Example history start line (with leading comment):" +msgstr "" + +#: smalldialogs.cpp:417 +msgid "" +"Copy a history start line as used in your files,\n" +"including the leading comment." +msgstr "" + +#: smalldialogs.cpp:443 +msgid "History sort key order:" +msgstr "" + +#: smalldialogs.cpp:451 +msgid "Example history entry start line (without leading comment):" +msgstr "" + +#: smalldialogs.cpp:453 +msgid "" +"Copy a history entry start line as used in your files,\n" +"but omit the leading comment." +msgstr "" + +#: smalldialogs.cpp:468 +msgid "Sort key result:" +msgstr "" + +#: smalldialogs.cpp:519 smalldialogs.cpp:529 smalldialogs.cpp:550 +msgid "Match success." +msgstr "" + +#: smalldialogs.cpp:523 smalldialogs.cpp:533 smalldialogs.cpp:556 +#, fuzzy +msgid "Match failed." +msgstr "

Ð”Ñ–Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐ¸Ð»Ð°ÑÑŒ невдало.

%1

" + +#: smalldialogs.cpp:541 +msgid "Opening and closing parentheses don't match in regular expression." +msgstr "" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/po/zh_CN.po --- a/kdiff3/po/zh_CN.po Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/po/zh_CN.po Sat Nov 04 00:05:00 2006 +0000 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: kdiff3\n" -"POT-Creation-Date: 2006-04-10 11:07+0200\n" +"POT-Creation-Date: 2006-05-15 11:12+0200\n" "PO-Revision-Date: 2005-02-07 10:03+0800\n" "Last-Translator: Mai Hao Hui \n" "Language-Team: zh_CN \n" @@ -62,7 +62,7 @@ "\n" "现在行匹é…处ç†å‘½ä»¤ä¼šè¢«ç¦ç”¨ã€‚" -#: diff.cpp:1617 diff.cpp:1631 +#: diff.cpp:1587 diff.cpp:1601 msgid "" "Data loss error:\n" "If it is reproducable please contact the author.\n" @@ -70,7 +70,7 @@ "æ•°æ®ä¸¢å¤±é”™è¯¯ï¼š\n" "如果它是å¯å¤åˆ¶çš„,请è”系作者。\n" -#: diff.cpp:1619 diff.cpp:1633 +#: diff.cpp:1589 diff.cpp:1603 msgid "Severe Internal Error" msgstr "严é‡å†…部错误" @@ -255,7 +255,7 @@ msgid "Changing All Merge Operations" msgstr "更改全部åˆå¹¶æ“作" -#: directorymergewindow.cpp:803 mergeresultwindow.cpp:284 +#: directorymergewindow.cpp:803 mergeresultwindow.cpp:285 msgid "C&ontinue" msgstr "ç»§ç»­(&o)" @@ -633,16 +633,6 @@ msgid "Unfold All Subdirs" msgstr "æ‰“å¼€å…¨éƒ¨å­æ–‡ä»¶å¤¹" -#: directorymergewindow.cpp:2865 -#, fuzzy -msgid "Save Directory Merge State ..." -msgstr "目录åˆå¹¶" - -#: directorymergewindow.cpp:2866 -#, fuzzy -msgid "Load Directory Merge State ..." -msgstr "目录åˆå¹¶" - #: directorymergewindow.cpp:2867 msgid "Choose A for All Items" msgstr "选择 A 的全部项目" @@ -718,7 +708,7 @@ msgid "Merge to A && B" msgstr "åˆå¹¶åˆ° A å’Œ B" -#: fileaccess.cpp:563 +#: fileaccess.cpp:581 msgid "" "While trying to make a backup, deleting an older backup failed. \n" "Filename: " @@ -726,7 +716,7 @@ "试图åšå¤‡ä»½æ—¶ï¼Œåˆ é™¤æ—§å¤‡ä»½å¤±è´¥ã€‚\n" "文件å:" -#: fileaccess.cpp:570 +#: fileaccess.cpp:588 msgid "" "While trying to make a backup, renaming failed. \n" "Filenames: " @@ -734,79 +724,79 @@ "试图备份时,é‡å‘½å失败。\n" "文件å:" -#: fileaccess.cpp:592 +#: fileaccess.cpp:610 #, c-format msgid "Getting file status: %1" msgstr "èŽ·å–æ–‡ä»¶çжæ€ï¼š%1" -#: fileaccess.cpp:635 +#: fileaccess.cpp:653 #, c-format msgid "Reading file: %1" msgstr "è¯»å–æ–‡ä»¶ï¼š%1" -#: fileaccess.cpp:671 +#: fileaccess.cpp:689 #, c-format msgid "Writing file: %1" msgstr "写入文件:%1" -#: fileaccess.cpp:699 +#: fileaccess.cpp:717 msgid "Out of memory" msgstr "内存溢出" -#: fileaccess.cpp:734 +#: fileaccess.cpp:752 #, c-format msgid "Making directory: %1" msgstr "建立目录:%1" -#: fileaccess.cpp:754 +#: fileaccess.cpp:772 #, c-format msgid "Removing directory: %1" msgstr "删除目录:%1" -#: fileaccess.cpp:769 +#: fileaccess.cpp:787 #, c-format msgid "Removing file: %1" msgstr "删除文件:%1" -#: fileaccess.cpp:785 +#: fileaccess.cpp:803 msgid "Creating symbolic link: %1 -> %2" msgstr "创建符å·é“¾æŽ¥ï¼š%1 -> %2" -#: fileaccess.cpp:811 +#: fileaccess.cpp:829 msgid "Renaming file: %1 -> %2" msgstr "é‡å‘½å文件:%1 -> %2" -#: fileaccess.cpp:847 +#: fileaccess.cpp:865 msgid "Copying file: %1 -> %2" msgstr "å¤åˆ¶æ–‡ä»¶ï¼š%1 -> %2" -#: fileaccess.cpp:861 +#: fileaccess.cpp:879 #, c-format msgid "" "Error during file copy operation: Opening file for reading failed. Filename: %1" msgstr "文件å¤åˆ¶æ“作出错:打开文件读å–失败。文件å:%1" -#: fileaccess.cpp:867 +#: fileaccess.cpp:885 #, c-format msgid "" "Error during file copy operation: Opening file for writing failed. Filename: %1" msgstr "文件å¤åˆ¶æ“作出错:打开文件写入失败。文件å:%1" -#: fileaccess.cpp:882 +#: fileaccess.cpp:900 #, c-format msgid "Error during file copy operation: Reading failed. Filename: %1" msgstr "文件å¤åˆ¶æ“作出错:读å–失败。文件å:%1" -#: fileaccess.cpp:891 +#: fileaccess.cpp:909 #, c-format msgid "Error during file copy operation: Writing failed. Filename: %1" msgstr "文件å¤åˆ¶æ“作出错:写入失败。文件å:%1" -#: fileaccess.cpp:1187 +#: fileaccess.cpp:1205 msgid "Reading directory: " msgstr "读å–目录:" -#: fileaccess.cpp:1316 +#: fileaccess.cpp:1334 #, c-format msgid "Listing directory: %1" msgstr "目录列表:%1" @@ -1152,11 +1142,11 @@ msgid "Toggle the statusbar..." msgstr "切æ¢çŠ¶æ€æ ..." -#: kdiff3_part.cpp:155 kdiff3_part.cpp:223 +#: kdiff3_part.cpp:155 kdiff3_part.cpp:224 msgid "Couldn't find files for comparison." msgstr "无法找到文件比较。" -#: kdiff3_part.cpp:290 +#: kdiff3_part.cpp:291 msgid "KDiff3Part" msgstr "KDiff3Part" @@ -1254,13 +1244,13 @@ msgid "+ Many thanks to those who reported bugs and contributed ideas!" msgstr "+ å分感谢报告错误和贡献想法的人们ï¼" -#: mergeresultwindow.cpp:132 mergeresultwindow.cpp:936 -#: mergeresultwindow.cpp:950 mergeresultwindow.cpp:962 -#: mergeresultwindow.cpp:974 +#: mergeresultwindow.cpp:133 mergeresultwindow.cpp:937 +#: mergeresultwindow.cpp:951 mergeresultwindow.cpp:963 +#: mergeresultwindow.cpp:975 msgid "Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)" msgstr "è¿˜æœªè§£å†³çš„å†²çªæ•°ç›®ï¼š%1(其中 %2 项为空白字符)" -#: mergeresultwindow.cpp:282 +#: mergeresultwindow.cpp:283 msgid "" "The output has been modified.\n" "If you continue your changes will be lost." @@ -1268,55 +1258,55 @@ "已修改输出。\n" "如果您继续您的更改将丢失。" -#: mergeresultwindow.cpp:794 pdiff.cpp:507 +#: mergeresultwindow.cpp:795 pdiff.cpp:507 msgid "All input files are binary equal." msgstr "全部输入文件二进制数æ®ç›¸åŒã€‚" -#: mergeresultwindow.cpp:796 +#: mergeresultwindow.cpp:797 msgid "All input files contain the same text." msgstr "全部输入文件包å«ç›¸åŒæ–‡æœ¬ã€‚" -#: mergeresultwindow.cpp:798 +#: mergeresultwindow.cpp:799 msgid "" "Files A and B are binary equal.\n" msgstr "" "文件 A å’Œ B 二进制数æ®ç›¸åŒã€‚\n" -#: mergeresultwindow.cpp:799 +#: mergeresultwindow.cpp:800 msgid "" "Files A and B have equal text. \n" msgstr "" "文件 A å’Œ B 文本相åŒã€‚\n" -#: mergeresultwindow.cpp:800 +#: mergeresultwindow.cpp:801 msgid "" "Files A and C are binary equal.\n" msgstr "" "文件 A å’Œ C 二进制数æ®ç›¸åŒã€‚\n" -#: mergeresultwindow.cpp:801 +#: mergeresultwindow.cpp:802 msgid "" "Files A and C have equal text. \n" msgstr "" "文件 A å’Œ C 文本相åŒã€‚\n" -#: mergeresultwindow.cpp:802 +#: mergeresultwindow.cpp:803 msgid "" "Files B and C are binary equal.\n" msgstr "" "文件 B å’Œ C 二进制数æ®ç›¸åŒã€‚\n" -#: mergeresultwindow.cpp:803 +#: mergeresultwindow.cpp:804 msgid "" "Files B and C have equal text. \n" msgstr "" "文件 B å’Œ C 文本相åŒã€‚\n" -#: mergeresultwindow.cpp:809 +#: mergeresultwindow.cpp:810 msgid "Total number of conflicts: " msgstr "å†²çªæ€»æ•°ï¼š" -#: mergeresultwindow.cpp:810 +#: mergeresultwindow.cpp:811 msgid "" "\n" "Nr of automatically solved conflicts: " @@ -1324,7 +1314,7 @@ "\n" "è‡ªåŠ¨è§£å†³çš„å†²çªæ•°ç›®ï¼š" -#: mergeresultwindow.cpp:811 +#: mergeresultwindow.cpp:812 msgid "" "\n" "Nr of unsolved conflicts: " @@ -1332,31 +1322,31 @@ "\n" "æœªè§£å†³å†²çªæ•°ç›®ï¼š" -#: mergeresultwindow.cpp:813 +#: mergeresultwindow.cpp:814 msgid "Conflicts" msgstr "冲çª" -#: mergeresultwindow.cpp:1649 +#: mergeresultwindow.cpp:1650 msgid "" msgstr "<æ— æºè¡Œ>" -#: mergeresultwindow.cpp:1657 +#: mergeresultwindow.cpp:1658 msgid "" msgstr "<åˆå¹¶å†²çª(åªæœ‰ç©ºç™½å­—符)>" -#: mergeresultwindow.cpp:1659 mergeresultwindow.cpp:2445 +#: mergeresultwindow.cpp:1660 mergeresultwindow.cpp:2446 msgid "" msgstr "<åˆå¹¶å†²çª>" -#: mergeresultwindow.cpp:1729 +#: mergeresultwindow.cpp:1730 msgid "Output" msgstr "输出" -#: mergeresultwindow.cpp:1731 +#: mergeresultwindow.cpp:1732 msgid "[Modified]" msgstr "[已修改]" -#: mergeresultwindow.cpp:2655 +#: mergeresultwindow.cpp:2656 msgid "" "Not all conflicts are solved yet.\n" "File not saved.\n" @@ -1364,11 +1354,11 @@ "尚未解决全部冲çªã€‚\n" "文件未ä¿å­˜ã€‚\n" -#: mergeresultwindow.cpp:2657 +#: mergeresultwindow.cpp:2658 msgid "Conflicts Left" msgstr "é—留的冲çª" -#: mergeresultwindow.cpp:2669 +#: mergeresultwindow.cpp:2670 msgid "" "\n" "\n" @@ -1378,11 +1368,11 @@ "\n" "创建备份失败。文件未ä¿å­˜ã€‚" -#: mergeresultwindow.cpp:2669 mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2670 mergeresultwindow.cpp:2710 msgid "File Save Error" msgstr "ä¿å­˜æ–‡ä»¶é”™è¯¯" -#: mergeresultwindow.cpp:2709 +#: mergeresultwindow.cpp:2710 msgid "Error while writing." msgstr "写入时出错。" @@ -1984,11 +1974,11 @@ msgid "Regional Settings" msgstr "区域设置" -#: optiondialog.cpp:1211 +#: optiondialog.cpp:1214 msgid "Language (restart required)" msgstr "语言(需è¦é‡å¯)" -#: optiondialog.cpp:1243 +#: optiondialog.cpp:1246 msgid "" "Choose the language of the GUI-strings or \"Auto\".\n" "For a change of language to take place, quit and restart KDiff3." @@ -1996,11 +1986,11 @@ "选择 GUI 的语言或者选择“自动â€ã€‚\n" "è¦è®©æ›´æ”¹ç”Ÿæ•ˆï¼Œè¯·é€€å‡ºå¹¶é‡å¯ KDiff3。" -#: optiondialog.cpp:1261 +#: optiondialog.cpp:1264 msgid "Use the same encoding for everything:" msgstr "所有文件使用åŒä¸€ç¼–ç ï¼š" -#: optiondialog.cpp:1264 +#: optiondialog.cpp:1267 msgid "" "Enable this allows to change all encodings by changing the first only.\n" "Disable this if different individual settings are needed." @@ -2008,35 +1998,35 @@ "å¯ç”¨æ­¤é€‰é¡¹å°†ä½¿å¾—åªæ›´æ”¹ç¬¬ä¸€ä¸ªç¼–ç è®¾ç½®å³å¯æ›´æ”¹å…¨éƒ¨æ–‡ä»¶çš„ç¼–ç ã€‚\n" "如果需è¦ä¸ºæ¯ä¸ªæ–‡ä»¶è®¾ç½®ä¸åŒçš„ç¼–ç ï¼Œè¯·ç¦ç”¨æ­¤é€‰é¡¹ã€‚" -#: optiondialog.cpp:1269 +#: optiondialog.cpp:1272 msgid "Note: Local Encoding is " msgstr "注æ„:本地编ç ä¸º" -#: optiondialog.cpp:1273 +#: optiondialog.cpp:1276 msgid "File Encoding for A:" msgstr "A 的文件编ç ï¼š" -#: optiondialog.cpp:1278 +#: optiondialog.cpp:1281 msgid "File Encoding for B:" msgstr "B 的文件编ç ï¼š" -#: optiondialog.cpp:1283 +#: optiondialog.cpp:1286 msgid "File Encoding for C:" msgstr "C 的文件编ç ï¼š" -#: optiondialog.cpp:1288 +#: optiondialog.cpp:1291 msgid "File Encoding for Merge Output and Saving:" msgstr "åˆå¹¶è¾“出和ä¿å­˜çš„æ–‡ä»¶ç¼–ç ï¼š" -#: optiondialog.cpp:1293 +#: optiondialog.cpp:1296 msgid "File Encoding for Preprocessor Files:" msgstr "é¢„å¤„ç†æ–‡ä»¶çš„æ–‡ä»¶ç¼–ç ï¼š" -#: optiondialog.cpp:1302 +#: optiondialog.cpp:1305 msgid "Right To Left Language" msgstr "从å³è‡³å·¦è¯­è¨€" -#: optiondialog.cpp:1305 +#: optiondialog.cpp:1308 msgid "" "Some languages are read from right to left.\n" "This setting will change the viewer and editor accordingly." @@ -2044,21 +2034,21 @@ "æŸäº›è¯­è¨€æ˜¯ä»Žå³åˆ°å·¦ä¹¦å†™çš„。\n" "此设置将更改查看器和编辑器的设置。" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration" msgstr "æ“作" -#: optiondialog.cpp:1315 +#: optiondialog.cpp:1318 #, fuzzy msgid "Integration Settings" msgstr "区域设置" -#: optiondialog.cpp:1325 +#: optiondialog.cpp:1328 msgid "Command line options to ignore:" msgstr "" -#: optiondialog.cpp:1330 +#: optiondialog.cpp:1333 msgid "" "List of command line options that should be ignored when KDiff3 is used by " "other tools.\n" @@ -2066,7 +2056,7 @@ "This will suppress the \"Unknown option\"-error." msgstr "" -#: optiondialog.cpp:1383 +#: optiondialog.cpp:1386 msgid "" "You selected a variable width font.\n" "\n" @@ -2082,19 +2072,19 @@ "\n" "您è¦ç»§ç»­ï¼Œè¿˜æ˜¯å¦é€‰ä¸€ç§å­—体。" -#: optiondialog.cpp:1387 +#: optiondialog.cpp:1390 msgid "Incompatible Font" msgstr "ä¸å…¼å®¹å­—体" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Continue at Own Risk" msgstr "自愿冒险继续" -#: optiondialog.cpp:1388 +#: optiondialog.cpp:1391 msgid "Select Another Font" msgstr "选择å¦ä¸€ç§å­—体" -#: optiondialog.cpp:1413 +#: optiondialog.cpp:1416 msgid "This resets all options. Not only those of the current topic." msgstr "这将é‡ç½®å…¨éƒ¨é€‰é¡¹ï¼Œè€Œä¸ä»…是当å‰ä¸»é¢˜çš„选项。" @@ -2235,11 +2225,11 @@ msgid "Search Complete" msgstr "æœç´¢å®Œæˆ" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 msgid "Nothing is selected in either diff input window." msgstr "" -#: pdiff.cpp:2129 +#: pdiff.cpp:2130 #, fuzzy msgid "Error while adding manual diff range" msgstr "创建目录时出错。" @@ -2426,6 +2416,14 @@ msgstr "" #, fuzzy +#~ msgid "Save Directory Merge State ..." +#~ msgstr "目录åˆå¹¶" + +#, fuzzy +#~ msgid "Load Directory Merge State ..." +#~ msgstr "目录åˆå¹¶" + +#, fuzzy #~ msgid "Synchronize Directories" #~ msgstr "åŒæ­¥ç›®å½•" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/Makefile.am Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,58 @@ + +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = kdiff3_part.h kdiff3_shell.h kdiff3.h common.h diff.h \ + directorymergewindow.h merger.h optiondialog.h fileaccess.h version.h \ + smalldialogs.h difftextwindow.h mergeresultwindow.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kdiff3.pot + +KDE_ICON = kdiff3 + +# this Makefile creates both a KPart application and a KPart +######################################################################### +# APPLICATION SECTION +######################################################################### +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = kdiff3 + +# the application source, library search path, and link libraries +kdiff3_SOURCES = main.cpp kdiff3_shell.cpp +kdiff3_LDFLAGS = $(KDE_RPATH) $(all_libraries) +kdiff3_LDADD = $(LIB_KPARTS) + +# this is where the desktop file will go +shelldesktopdir = $(kde_appsdir)/Development +shelldesktop_DATA = kdiff3.desktop + +# this is where the shell's XML-GUI resource file goes +shellrcdir = $(kde_datadir)/kdiff3 +shellrc_DATA = kdiff3_shell.rc + +######################################################################### +# KPART SECTION +######################################################################### +kde_module_LTLIBRARIES = libkdiff3part.la + +# the Part's source, library search path, and link libraries +libkdiff3part_la_SOURCES = kdiff3_part.cpp kdiff3.cpp directorymergewindow.cpp \ + merger.cpp pdiff.cpp difftextwindow.cpp diff.cpp optiondialog.cpp \ + mergeresultwindow.cpp fileaccess.cpp gnudiff_analyze.cpp gnudiff_io.cpp gnudiff_xmalloc.cpp \ + common.cpp smalldialogs.cpp +libkdiff3part_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) +libkdiff3part_la_LIBADD = $(LIB_KDEPRINT) $(LIB_KPARTS) $(LIB_KFILE) + +# this is where the desktop file will go +partdesktopdir = $(kde_servicesdir) +partdesktop_DATA = kdiff3part.desktop + +# this is where the part's XML-GUI resource file goes +partrcdir = $(kde_datadir)/kdiff3part +partrc_DATA = kdiff3_part.rc diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/Makefile.qt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/Makefile.qt Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,425 @@ +############################################################################# +# Makefile for building: kdiff3 +# Generated by qmake (1.07a) (Qt 3.3.5) on: Sat Apr 8 20:11:51 2006 +# Project: kdiff3.pro +# Template: app +# Command: $(QMAKE) -o Makefile kdiff3.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +LEX = flex +YACC = yacc +CFLAGS = -pipe -O2 -Wall -W -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -D__USE_STD_IOSTREAM +CXXFLAGS = -pipe -O2 -Wall -W -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 +LINK = g++ +LFLAGS = +LIBS = $(SUBLIBS) -L/usr/lib/ -L$(QTDIR)/lib/ -L/usr/X11R6/lib/ -lqt-mt -lXext -lX11 -lm -lpthread +AR = ar cqs +RANLIB = +MOC = $(QTDIR)/bin/moc +UIC = $(QTDIR)/bin/uic +QMAKE = qmake +TAR = tar -cf +GZIP = gzip -9f +COPY = cp -f +COPY_FILE= $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE= $(COPY_FILE) +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +HEADERS = version.h \ + diff.h \ + difftextwindow.h \ + mergeresultwindow.h \ + kdiff3.h \ + merger.h \ + optiondialog.h \ + kreplacements/kreplacements.h \ + directorymergewindow.h \ + fileaccess.h \ + kdiff3_shell.h \ + kdiff3_part.h \ + smalldialogs.h +SOURCES = main.cpp \ + diff.cpp \ + difftextwindow.cpp \ + kdiff3.cpp \ + merger.cpp \ + mergeresultwindow.cpp \ + optiondialog.cpp \ + pdiff.cpp \ + directorymergewindow.cpp \ + fileaccess.cpp \ + smalldialogs.cpp \ + kdiff3_shell.cpp \ + kdiff3_part.cpp \ + gnudiff_analyze.cpp \ + gnudiff_io.cpp \ + gnudiff_xmalloc.cpp \ + common.cpp \ + kreplacements/kreplacements.cpp \ + kreplacements/ShellContextMenu.cpp +OBJECTS = main.o \ + diff.o \ + difftextwindow.o \ + kdiff3.o \ + merger.o \ + mergeresultwindow.o \ + optiondialog.o \ + pdiff.o \ + directorymergewindow.o \ + fileaccess.o \ + smalldialogs.o \ + kdiff3_shell.o \ + kdiff3_part.o \ + gnudiff_analyze.o \ + gnudiff_io.o \ + gnudiff_xmalloc.o \ + common.o \ + kreplacements.o \ + ShellContextMenu.o +FORMS = +UICDECLS = +UICIMPLS = +SRCMOC = moc_difftextwindow.cpp \ + moc_mergeresultwindow.cpp \ + moc_kdiff3.cpp \ + moc_optiondialog.cpp \ + kreplacements/moc_kreplacements.cpp \ + moc_directorymergewindow.cpp \ + moc_fileaccess.cpp \ + moc_kdiff3_shell.cpp \ + moc_kdiff3_part.cpp \ + moc_smalldialogs.cpp +OBJMOC = moc_difftextwindow.o \ + moc_mergeresultwindow.o \ + moc_kdiff3.o \ + moc_optiondialog.o \ + moc_kreplacements.o \ + moc_directorymergewindow.o \ + moc_fileaccess.o \ + moc_kdiff3_shell.o \ + moc_kdiff3_part.o \ + moc_smalldialogs.o +DIST = kdiff3.pro +QMAKE_TARGET = kdiff3 +DESTDIR = +TARGET = kdiff3 + +first: all +####### Implicit rules + +.SUFFIXES: .c .o .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS) + +mocables: $(SRCMOC) +uicables: $(UICDECLS) $(UICIMPLS) + +$(MOC): + ( cd $(QTDIR)/src/moc && $(MAKE) ) + +dist: + @mkdir -p .tmp/kdiff3 && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/kdiff3/ && ( cd `dirname .tmp/kdiff3` && $(TAR) kdiff3.tar kdiff3 && $(GZIP) kdiff3.tar ) && $(MOVE) `dirname .tmp/kdiff3`/kdiff3.tar.gz . && $(DEL_FILE) -r .tmp/kdiff3 + +mocclean: + -$(DEL_FILE) $(OBJMOC) + -$(DEL_FILE) $(SRCMOC) + +uiclean: + +yaccclean: +lexclean: +clean: mocclean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) $(TARGET) + + +FORCE: + +####### Compile + +main.o: main.cpp kdiff3_shell.h \ + version.h \ + optiondialog.h \ + common.h + +diff.o: diff.cpp diff.h \ + fileaccess.h \ + optiondialog.h \ + common.h + +difftextwindow.o: difftextwindow.cpp difftextwindow.h \ + merger.h \ + optiondialog.h \ + diff.h \ + common.h \ + fileaccess.h + +kdiff3.o: kdiff3.cpp difftextwindow.h \ + mergeresultwindow.h \ + kdiff3.h \ + optiondialog.h \ + fileaccess.h \ + kdiff3_part.h \ + directorymergewindow.h \ + smalldialogs.h \ + xpm/downend.xpm \ + xpm/currentpos.xpm \ + xpm/down1arrow.xpm \ + xpm/down2arrow.xpm \ + xpm/upend.xpm \ + xpm/up1arrow.xpm \ + xpm/up2arrow.xpm \ + xpm/prevunsolved.xpm \ + xpm/nextunsolved.xpm \ + xpm/iconA.xpm \ + xpm/iconB.xpm \ + xpm/iconC.xpm \ + xpm/autoadvance.xpm \ + xpm/showwhitespace.xpm \ + xpm/showwhitespacechars.xpm \ + xpm/showlinenumbers.xpm \ + diff.h \ + common.h + +merger.o: merger.cpp merger.h \ + diff.h \ + common.h \ + fileaccess.h \ + optiondialog.h + +mergeresultwindow.o: mergeresultwindow.cpp mergeresultwindow.h \ + optiondialog.h \ + diff.h \ + common.h \ + fileaccess.h + +optiondialog.o: optiondialog.cpp optiondialog.h \ + diff.h \ + smalldialogs.h \ + common.h \ + fileaccess.h + +pdiff.o: pdiff.cpp difftextwindow.h \ + mergeresultwindow.h \ + directorymergewindow.h \ + smalldialogs.h \ + kdiff3.h \ + optiondialog.h \ + fileaccess.h \ + gnudiff_diff.h \ + diff.h \ + common.h \ + gnudiff_system.h + +directorymergewindow.o: directorymergewindow.cpp directorymergewindow.h \ + optiondialog.h \ + xpm/link_arrow.xpm \ + xpm/file.xpm \ + xpm/folder.xpm \ + xpm/startmerge.xpm \ + xpm/showequalfiles.xpm \ + xpm/showfilesonlyina.xpm \ + xpm/showfilesonlyinb.xpm \ + xpm/showfilesonlyinc.xpm \ + common.h \ + fileaccess.h \ + diff.h + +fileaccess.o: fileaccess.cpp fileaccess.h \ + optiondialog.h \ + common.h + +smalldialogs.o: smalldialogs.cpp smalldialogs.h \ + optiondialog.h \ + diff.h \ + common.h \ + fileaccess.h + +kdiff3_shell.o: kdiff3_shell.cpp kdiff3_shell.h \ + kdiff3.h \ + diff.h \ + common.h \ + fileaccess.h \ + optiondialog.h + +kdiff3_part.o: kdiff3_part.cpp kdiff3_part.h \ + kdiff3.h \ + fileaccess.h \ + version.h \ + diff.h \ + common.h \ + optiondialog.h + +gnudiff_analyze.o: gnudiff_analyze.cpp gnudiff_diff.h \ + gnudiff_system.h + +gnudiff_io.o: gnudiff_io.cpp gnudiff_diff.h \ + gnudiff_system.h + +gnudiff_xmalloc.o: gnudiff_xmalloc.cpp gnudiff_diff.h \ + gnudiff_system.h + +common.o: common.cpp common.h + +kreplacements.o: kreplacements/kreplacements.cpp kreplacements/kreplacements.h \ + common.h \ + xpm/fileopen.xpm \ + xpm/filesave.xpm \ + xpm/fileprint.xpm \ + kreplacements/kreplacements.moc + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o kreplacements.o kreplacements/kreplacements.cpp + +ShellContextMenu.o: kreplacements/ShellContextMenu.cpp kreplacements/ShellContextMenu.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ShellContextMenu.o kreplacements/ShellContextMenu.cpp + +moc_difftextwindow.o: moc_difftextwindow.cpp difftextwindow.h diff.h \ + common.h \ + fileaccess.h \ + optiondialog.h + +moc_mergeresultwindow.o: moc_mergeresultwindow.cpp mergeresultwindow.h diff.h \ + common.h \ + fileaccess.h \ + optiondialog.h + +moc_kdiff3.o: moc_kdiff3.cpp kdiff3.h diff.h \ + common.h \ + fileaccess.h \ + optiondialog.h + +moc_optiondialog.o: moc_optiondialog.cpp optiondialog.h + +moc_kreplacements.o: kreplacements/moc_kreplacements.cpp kreplacements/kreplacements.h common.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_kreplacements.o kreplacements/moc_kreplacements.cpp + +moc_directorymergewindow.o: moc_directorymergewindow.cpp directorymergewindow.h common.h \ + fileaccess.h \ + diff.h \ + optiondialog.h + +moc_fileaccess.o: moc_fileaccess.cpp fileaccess.h + +moc_kdiff3_shell.o: moc_kdiff3_shell.cpp kdiff3_shell.h + +moc_kdiff3_part.o: moc_kdiff3_part.cpp kdiff3_part.h + +moc_smalldialogs.o: moc_smalldialogs.cpp smalldialogs.h diff.h \ + common.h \ + fileaccess.h \ + optiondialog.h + +moc_difftextwindow.cpp: $(MOC) difftextwindow.h + $(MOC) difftextwindow.h -o moc_difftextwindow.cpp + +moc_mergeresultwindow.cpp: $(MOC) mergeresultwindow.h + $(MOC) mergeresultwindow.h -o moc_mergeresultwindow.cpp + +moc_kdiff3.cpp: $(MOC) kdiff3.h + $(MOC) kdiff3.h -o moc_kdiff3.cpp + +moc_optiondialog.cpp: $(MOC) optiondialog.h + $(MOC) optiondialog.h -o moc_optiondialog.cpp + +kreplacements/moc_kreplacements.cpp: $(MOC) kreplacements/kreplacements.h + $(MOC) kreplacements/kreplacements.h -o kreplacements/moc_kreplacements.cpp + +moc_directorymergewindow.cpp: $(MOC) directorymergewindow.h + $(MOC) directorymergewindow.h -o moc_directorymergewindow.cpp + +moc_fileaccess.cpp: $(MOC) fileaccess.h + $(MOC) fileaccess.h -o moc_fileaccess.cpp + +moc_kdiff3_shell.cpp: $(MOC) kdiff3_shell.h + $(MOC) kdiff3_shell.h -o moc_kdiff3_shell.cpp + +moc_kdiff3_part.cpp: $(MOC) kdiff3_part.h + $(MOC) kdiff3_part.h -o moc_kdiff3_part.cpp + +moc_smalldialogs.cpp: $(MOC) smalldialogs.h + $(MOC) smalldialogs.h -o moc_smalldialogs.cpp + +####### Install + +install_documentation: all + @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/da" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/de" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/en" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/et" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/fr" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/it" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/pt" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + -$(INSTALL_DIR) "../doc/sv" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + + +uninstall_documentation: + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/da" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/de" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/en" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/et" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/fr" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/it" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/pt" + -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/sv" + -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" + + +install_target: all + @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/bin/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/bin/" + -$(INSTALL_FILE) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)" + +uninstall_target: + -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)" + -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/bin/" + + +install: install_documentation install_target + +uninstall: uninstall_documentation uninstall_target + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/common.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/common.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,341 @@ +/*************************************************************************** + * Copyright (C) 2004-2006 by Joachim Eibl * + * joachim.eibl at gmx.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "common.h" +#include +#include +#include +#include +#include +#include +#include + +ValueMap::ValueMap() +{ +} + +ValueMap::~ValueMap() +{ +} + +void ValueMap::save( QTextStream& ts ) +{ + std::map::iterator i; + for( i=m_map.begin(); i!=m_map.end(); ++i) + { + QString key = i->first; + QString val = i->second; + ts << key << "=" << val << "\n"; + } +} + +QString ValueMap::getAsString() +{ + QString result; + std::map::iterator i; + for( i=m_map.begin(); i!=m_map.end(); ++i) + { + QString key = i->first; + QString val = i->second; + result += key + "=" + val + "\n"; + } + return result; +} + +void ValueMap::load( QTextStream& ts ) +{ + while ( !ts.atEnd() ) + { // until end of file... + QString s = ts.readLine(); // line of text excluding '\n' + int pos = s.indexOf('='); + if( pos > 0 ) // seems not to have a tag + { + QString key = s.left(pos); + QString val = s.mid(pos+1); + m_map[key] = val; + } + } +} +/* +void ValueMap::load( const QString& s ) +{ + int pos=0; + while ( pos<(int)s.length() ) + { // until end of file... + int pos2 = s.find('=', pos); + int pos3 = s.find('\n', pos2 ); + if (pos3<0) + pos3=s.length(); + if( pos2 > 0 ) // seems not to have a tag + { + QString key = s.mid(pos, pos2-pos); + QString val = s.mid(pos2+1, pos3-pos2-1); + m_map[key] = val; + } + pos = pos3; + } +} +*/ + +// safeStringJoin and safeStringSplit allow to convert a stringlist into a string and back +// safely, even if the individual strings in the list contain the separator character. +QString safeStringJoin(const QStringList& sl, char sepChar, char metaChar ) +{ + // Join the strings in the list, using the separator ',' + // If a string contains the separator character, it will be replaced with "\,". + // Any occurances of "\" (one backslash) will be replaced with "\\" (2 backslashes) + + assert(sepChar!=metaChar); + + QString sep; + sep += sepChar; + QString meta; + meta += metaChar; + + QString safeString; + + QStringList::const_iterator i; + for (i=sl.begin(); i!=sl.end(); ++i) + { + QString s = *i; + s.replace(meta, meta+meta); // "\" -> "\\" + s.replace(sep, meta+sep); // "," -> "\," + if ( i==sl.begin() ) + safeString = s; + else + safeString += sep + s; + } + return safeString; +} + +// Split a string that was joined with safeStringJoin +QStringList safeStringSplit(const QString& s, char sepChar, char metaChar ) +{ + assert(sepChar!=metaChar); + QStringList sl; + // Miniparser + int i=0; + int len=s.length(); + QString b; + for(i=0;i0 ) + { + pos = s.indexOf( sep, pos ); + --idx; + if (pos<0) break; + ++pos; + } + if ( pos>=0 ) + { + int pos2 = s.indexOf( sep, pos ); + if ( pos2>0 ) + return s.mid(pos, pos2-pos); + else + return s.mid(pos); + } + + return ""; +} + +static int num( QString& s, int idx ) +{ + return subSection( s, idx, ',').toInt(); +} + +void ValueMap::writeEntry(const QString& k, const QFont& v ) +{ + m_map[k] = v.family() + "," + QString::number(v.pointSize()) + "," + (v.bold() ? "bold" : "normal"); +} + +void ValueMap::writeEntry(const QString& k, const QColor& v ) +{ + m_map[k] = numStr(v.red()) + "," + numStr(v.green()) + "," + numStr(v.blue()); +} + +void ValueMap::writeEntry(const QString& k, const QSize& v ) +{ + m_map[k] = numStr(v.width()) + "," + numStr(v.height()); +} + +void ValueMap::writeEntry(const QString& k, const QPoint& v ) +{ + m_map[k] = numStr(v.x()) + "," + numStr(v.y()); +} + +void ValueMap::writeEntry(const QString& k, int v ) +{ + m_map[k] = numStr(v); +} + +void ValueMap::writeEntry(const QString& k, bool v ) +{ + m_map[k] = numStr(v); +} + +void ValueMap::writeEntry(const QString& k, const QString& v ) +{ + m_map[k] = v; +} + +void ValueMap::writeEntry(const QString& k, const char* v ) +{ + m_map[k] = v; +} + +void ValueMap::writeEntry(const QString& k, const QStringList& v, char separator ) +{ + m_map[k] = safeStringJoin(v, separator); +} + + +QFont ValueMap::readFontEntry(const QString& k, QFont* defaultVal ) +{ + QFont f = *defaultVal; + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + f.setFamily( subSection( i->second, 0, ',' ) ); + f.setPointSize( subSection( i->second, 1, ',' ).toInt() ); + f.setBold( subSection( i->second, 2, ',' )=="bold" ); + //f.fromString(i->second); + } + + return f; +} + +QColor ValueMap::readColorEntry(const QString& k, QColor* defaultVal ) +{ + QColor c= *defaultVal; + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + QString s = i->second; + c = QColor( num(s,0),num(s,1),num(s,2) ); + } + + return c; +} + +QSize ValueMap::readSizeEntry(const QString& k, QSize* defaultVal ) +{ + QSize size = defaultVal ? *defaultVal : QSize(600,400); + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + + QString s = i->second; + size = QSize( num(s,0),num(s,1) ); + } + + return size; +} + +QPoint ValueMap::readPointEntry(const QString& k, QPoint* defaultVal) +{ + QPoint point = defaultVal ? *defaultVal : QPoint(0,0); + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + QString s = i->second; + point = QPoint( num(s,0),num(s,1) ); + } + + return point; +} + +bool ValueMap::readBoolEntry(const QString& k, bool bDefault ) +{ + bool b = bDefault; + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + QString s = i->second; + b = (bool)num(s,0); + } + + return b; +} + +int ValueMap::readNumEntry(const QString& k, int iDefault ) +{ + int ival = iDefault; + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + QString s = i->second; + ival = num(s,0); + } + + return ival; +} + +QString ValueMap::readEntry(const QString& k, const QString& sDefault ) +{ + QString sval = sDefault; + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + sval = i->second; + } + + return sval; +} + +QStringList ValueMap::readListEntry(const QString& k, const QStringList& defaultVal, char separator ) +{ + QStringList strList; + + std::map::iterator i = m_map.find( k ); + if ( i!=m_map.end() ) + { + strList = safeStringSplit( i->second, separator ); + return strList; + } + else + return defaultVal; +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/common.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/common.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,113 @@ +/*************************************************************************** + common.h - Things that are needed often + ------------------- + begin : Mon Mar 18 2002 + copyright : (C) 2002-2006 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _COMMON_H +#define _COMMON_H + +#include + +template< class T > +T min2( T x, T y ) +{ + return x +T max2( T x, T y ) +{ + return x>y ? x : y; +} + +typedef unsigned char UINT8; +typedef unsigned short UINT16; +typedef unsigned int UINT32; + + +template +T min3( T d1, T d2, T d3 ) +{ + if ( d1 < d2 && d1 < d3 ) return d1; + if ( d2 < d3 ) return d2; + return d3; +} + +template +T max3( T d1, T d2, T d3 ) +{ + + if ( d1 > d2 && d1 > d3 ) return d1; + + + if ( d2 > d3 ) return d2; + return d3; + +} + +template +T minMaxLimiter( T d, T minimum, T maximum ) +{ + assert(minimum<=maximum); + if ( d < minimum ) return minimum; + if ( d > maximum ) return maximum; + return d; +} + +#include +#include +class QFont; +class QColor; +class QSize; +class QPoint; +class QStringList; +class QTextStream; + +class ValueMap +{ +private: + std::map m_map; +public: + ValueMap(); + virtual ~ValueMap(); + + void save( QTextStream& ts ); + void load( QTextStream& ts ); + QString getAsString(); + // void load( const QString& s ); + + virtual void writeEntry(const QString&, const QFont& ); + virtual void writeEntry(const QString&, const QColor& ); + virtual void writeEntry(const QString&, const QSize& ); + virtual void writeEntry(const QString&, const QPoint& ); + virtual void writeEntry(const QString&, int ); + virtual void writeEntry(const QString&, bool ); + virtual void writeEntry(const QString&, const QStringList&, char separator ); + virtual void writeEntry(const QString&, const QString& ); + virtual void writeEntry(const QString&, const char* ); + + virtual QFont readFontEntry (const QString&, QFont* defaultVal ); + virtual QColor readColorEntry(const QString&, QColor* defaultVal ); + virtual QSize readSizeEntry (const QString&, QSize* defaultVal ); + virtual QPoint readPointEntry(const QString&, QPoint* defaultVal ); + virtual bool readBoolEntry (const QString&, bool bDefault ); + virtual int readNumEntry (const QString&, int iDefault ); + virtual QStringList readListEntry (const QString&, const QStringList& defaultVal, char separator ); + virtual QString readEntry (const QString&, const QString& ); +}; + +QStringList safeStringSplit(const QString& s, char sepChar=',', char metaChar='\\' ); +QString safeStringJoin(const QStringList& sl, char sepChar=',', char metaChar='\\' ); + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/diff.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/diff.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1931 @@ +/*************************************************************************** + diff.cpp - description + ------------------- + begin : Mon Mar 18 2002 + copyright : (C) 2002-2004 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include + +#include "diff.h" +#include "fileaccess.h" +#include "optiondialog.h" + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +//using namespace std; + + +int LineData::width(int tabSize) const +{ + int w=0; + int j=0; + for( int i=0; i=5 || l2.occurances>=5) ) + return false; + + // Ignore white space diff + const QChar* p1 = l1.pLine; + const QChar* p1End = p1 + l1.size; + + const QChar* p2 = l2.pLine; + const QChar* p2End = p2 + l2.size; + + if ( g_bIgnoreWhiteSpace ) + { + int nonWhite = 0; + for(;;) + { + while( isWhite( *p1 ) && p1!=p1End ) ++p1; + while( isWhite( *p2 ) && p2!=p2End ) ++p2; + + if ( p1 == p1End && p2 == p2End ) + { + if ( bStrict && g_bIgnoreTrivialMatches ) + { // Then equality is not enough + return nonWhite>2; + } + else // equality is enough + return true; + } + else if ( p1 == p1End || p2 == p2End ) + return false; + + if( *p1 != *p2 ) + return false; + ++p1; + ++p2; + ++nonWhite; + } + } + + else + { + if ( l1.size==l2.size && memcmp(p1, p2, l1.size)==0) + return true; + else + return false; + } +} + + +static bool isLineOrBufEnd( const QChar* p, int i, int size ) +{ + return + i>=size // End of file + || p[i]=='\n' // Normal end of line + + // No support for Mac-end of line yet, because incompatible with GNU-diff-routines. + // || ( p[i]=='\r' && (i>=size-1 || p[i+1]!='\n') + // && (i==0 || p[i-1]!='\n') ) // Special case: '\r' without '\n' + ; +} + + +/* Features of class SourceData: +- Read a file (from the given URL) or accept data via a string. +- Allocate and free buffers as necessary. +- Run a preprocessor, when specified. +- Run the line-matching preprocessor, when specified. +- Run other preprocessing steps: Uppercase, ignore comments, + remove carriage return, ignore numbers. + +Order of operation: + 1. If data was given via a string then save it to a temp file. (see setData()) + 2. If the specified file is nonlocal (URL) copy it to a temp file. + 3. If a preprocessor was specified, run the input file through it. + 4. Read the output of the preprocessor. + 5. If Uppercase was specified: Turn the read data to uppercase. + 6. Write the result to a temp file. + 7. If a line-matching preprocessor was specified, run the temp file through it. + 8. Read the output of the line-matching preprocessor. + 9. If ignore numbers was specified, strip the LMPP-output of all numbers. +10. If ignore comments was specified, strip the LMPP-output of comments. + +Optimizations: Skip unneeded steps. +*/ + +SourceData::SourceData() +{ + m_pOptionDialog = 0; + reset(); +} + +SourceData::~SourceData() +{ + reset(); +} + +void SourceData::reset() +{ + m_pEncoding = 0; + m_fileAccess = FileAccess(); + m_normalData.reset(); + m_lmppData.reset(); + if ( !m_tempInputFileName.isEmpty() ) + { + FileAccess::removeFile( m_tempInputFileName ); + m_tempInputFileName = ""; + } +} + +void SourceData::setFilename( const QString& filename ) +{ + if (filename.isEmpty()) + { + reset(); + } + else + { + FileAccess fa( filename ); + setFileAccess( fa ); + } +} + +bool SourceData::isEmpty() +{ + return getFilename().isEmpty(); +} + +bool SourceData::hasData() +{ + return m_normalData.m_pBuf != 0; +} + +bool SourceData::isValid() +{ + return isEmpty() || hasData(); +} + +void SourceData::setOptionDialog( OptionDialog* pOptionDialog ) +{ + m_pOptionDialog = pOptionDialog; +} + +QString SourceData::getFilename() +{ + return m_fileAccess.absFilePath(); +} + +QString SourceData::getAliasName() +{ + return m_aliasName.isEmpty() ? m_fileAccess.prettyAbsPath() : m_aliasName; +} + +void SourceData::setAliasName( const QString& name ) +{ + m_aliasName = name; +} + +void SourceData::setFileAccess( const FileAccess& fileAccess ) +{ + m_fileAccess = fileAccess; + m_aliasName = QString(); + if ( !m_tempInputFileName.isEmpty() ) + { + FileAccess::removeFile( m_tempInputFileName ); + m_tempInputFileName = ""; + } +} + +void SourceData::setData( const QString& data ) +{ + // Create a temp file for preprocessing: + if ( m_tempInputFileName.isEmpty() ) + { + m_tempInputFileName = FileAccess::tempFileName(); + } + + FileAccess f( m_tempInputFileName ); + bool bSuccess = f.writeFile( QTextCodec::codecForName("UTF-8")->fromUnicode(data), data.length() ); + if ( !bSuccess ) + { + KMessageBox::error( m_pOptionDialog, i18n("Writing clipboard data to temp file failed.") ); + return; + } + + m_aliasName = i18n("From Clipboard"); + m_fileAccess = FileAccess(""); // Effect: m_fileAccess.isValid() is false +} + +const LineData* SourceData::getLineDataForDiff() const +{ + if ( m_lmppData.m_pBuf==0 ) + return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : 0; + else + return m_lmppData.m_v.size()>0 ? &m_lmppData.m_v[0] : 0; +} + +const LineData* SourceData::getLineDataForDisplay() const +{ + return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : 0; +} + +int SourceData::getSizeLines() const +{ + return m_normalData.m_vSize; +} + +int SourceData::getSizeBytes() const +{ + return m_normalData.m_size; +} + +const char* SourceData::getBuf() const +{ + return m_normalData.m_pBuf; +} + +bool SourceData::isText() +{ + return m_normalData.m_bIsText; +} + +bool SourceData::isFromBuffer() +{ + return !m_fileAccess.isValid(); +} + + +bool SourceData::isBinaryEqualWith( const SourceData& other ) const +{ + return getSizeBytes() == other.getSizeBytes() && + ( getSizeBytes()==0 || memcmp( getBuf(), other.getBuf(), getSizeBytes() )==0 ); +} + +void SourceData::FileData::reset() +{ + delete[] (char*)m_pBuf; + m_pBuf = 0; + m_v.clear(); + m_size = 0; + m_vSize = 0; + m_bIsText = true; +} + +bool SourceData::FileData::readFile( const QString& filename ) +{ + reset(); + if ( filename.isEmpty() ) { return true; } + + FileAccess fa( filename ); + m_size = fa.sizeForReading(); + char* pBuf; + m_pBuf = pBuf = new char[m_size+100]; // Alloc 100 byte extra: Savety hack, not nice but does no harm. + // Some extra bytes at the end of the buffer are needed by + // the diff algorithm. See also GnuDiff::diff_2_files(). + bool bSuccess = fa.readFile( pBuf, m_size ); + if ( !bSuccess ) + { + delete pBuf; + m_pBuf = 0; + m_size = 0; + } + return bSuccess; +} + +bool SourceData::saveNormalDataAs( const QString& fileName ) +{ + return m_normalData.writeFile( fileName ); +} + +bool SourceData::FileData::writeFile( const QString& filename ) +{ + if ( filename.isEmpty() ) { return true; } + + FileAccess fa( filename ); + bool bSuccess = fa.writeFile(m_pBuf, m_size); + return bSuccess; +} + +void SourceData::FileData::copyBufFrom( const FileData& src ) +{ + reset(); + char* pBuf; + m_size = src.m_size; + m_pBuf = pBuf = new char[m_size+100]; + memcpy( pBuf, src.m_pBuf, m_size ); +} + +// Convert the input file from input encoding to output encoding and write it to the output file. +static bool convertFileEncoding( const QString& fileNameIn, QTextCodec* pCodecIn, + const QString& fileNameOut, QTextCodec* pCodecOut ) +{ + QFile in( fileNameIn ); + if ( ! in.open(QIODevice::ReadOnly ) ) + return false; + QTextStream inStream( &in ); + inStream.setCodec( pCodecIn ); + inStream.setAutoDetectUnicode( false ); + + QFile out( fileNameOut ); + if ( ! out.open( QIODevice::WriteOnly ) ) + return false; + QTextStream outStream( &out ); + outStream.setCodec( pCodecOut ); + + QString data = inStream.readAll(); + outStream << data; + + return true; +} + +static QTextCodec* detectEncoding( const char* buf, qint64 size, qint64& skipBytes ) +{ + if (size>=2) + { + skipBytes = 2; + if (buf[0]=='\xFF' && buf[1]=='\xFE' ) + return QTextCodec::codecForName( "UTF-16LE" ); + + if (buf[0]=='\xFE' && buf[1]=='\xFF' ) + return QTextCodec::codecForName( "UTF-16BE" ); + } + if (size>=3) + { + skipBytes = 3; + if (buf[0]=='\xEF' && buf[1]=='\xBB' && buf[2]=='\xBF' ) + return QTextCodec::codecForName( "UTF-8-BOM" ); + } + skipBytes = 0; + return 0; +} + +QTextCodec* SourceData::detectEncoding( const QString& fileName, QTextCodec* pFallbackCodec ) +{ + QFile f(fileName); + if ( f.open(QIODevice::ReadOnly) ) + { + char buf[4]; + qint64 size = f.read( buf, sizeof(buf) ); + qint64 skipBytes = 0; + QTextCodec* pCodec = ::detectEncoding( buf, size, skipBytes ); + if (pCodec) + return pCodec; + } + return pFallbackCodec; +} + +void SourceData::readAndPreprocess( QTextCodec* pEncoding, bool bAutoDetectUnicode ) +{ + m_pEncoding = pEncoding; + QString fileNameIn1; + QString fileNameOut1; + QString fileNameIn2; + QString fileNameOut2; + + bool bTempFileFromClipboard = !m_fileAccess.isValid(); + + // Detect the input for the preprocessing operations + if ( !bTempFileFromClipboard ) + { + if ( m_fileAccess.isLocal() ) + { + fileNameIn1 = m_fileAccess.absFilePath(); + } + else // File is not local: create a temporary local copy: + { + if ( m_tempInputFileName.isEmpty() ) { m_tempInputFileName = FileAccess::tempFileName(); } + + m_fileAccess.copyFile(m_tempInputFileName); + fileNameIn1 = m_tempInputFileName; + } + if ( bAutoDetectUnicode ) + { + m_pEncoding = detectEncoding( fileNameIn1, pEncoding ); + } + } + else // The input was set via setData(), probably from clipboard. + { + fileNameIn1 = m_tempInputFileName; + m_pEncoding = QTextCodec::codecForName("UTF-8"); + } + QTextCodec* pEncoding1 = m_pEncoding; + QTextCodec* pEncoding2 = m_pEncoding; + + m_normalData.reset(); + m_lmppData.reset(); + + FileAccess faIn(fileNameIn1); + int fileInSize = faIn.size(); + + if ( faIn.exists() ) // fileInSize > 0 ) + { + +#ifdef _WIN32 + QString catCmd = "type"; + fileNameIn1.replace( '/', "\\" ); +#else + QString catCmd = "cat"; +#endif + + // Run the first preprocessor + if ( m_pOptionDialog->m_PreProcessorCmd.isEmpty() ) + { + // No preprocessing: Read the file directly: + m_normalData.readFile( fileNameIn1 ); + } + else + { + QString fileNameInPP = fileNameIn1; + + if ( pEncoding1 != m_pOptionDialog->m_pEncodingPP ) + { + // Before running the preprocessor convert to the format that the preprocessor expects. + fileNameInPP = FileAccess::tempFileName(); + pEncoding1 = m_pOptionDialog->m_pEncodingPP; + convertFileEncoding( fileNameIn1, pEncoding, fileNameInPP, pEncoding1 ); + } + + QString ppCmd = m_pOptionDialog->m_PreProcessorCmd; + fileNameOut1 = FileAccess::tempFileName(); + + QProcess ppProcess; + ppProcess.setStandardInputFile( fileNameInPP ); + ppProcess.setStandardOutputFile( fileNameOut1 ); + ppProcess.start( ppCmd ); + ppProcess.waitForFinished(-1); + //QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut1+"\""; + //::system( encodeString(cmd) ); + bool bSuccess = m_normalData.readFile( fileNameOut1 ); + if ( fileInSize >0 && ( !bSuccess || m_normalData.m_size==0 ) ) + { + KMessageBox::error(m_pOptionDialog, + i18n("Preprocessing possibly failed. Check this command:\n\n %1" + "\n\nThe preprocessing command will be disabled now." + ).arg(ppCmd) ); + m_pOptionDialog->m_PreProcessorCmd = ""; + m_normalData.readFile( fileNameIn1 ); + pEncoding1 = m_pEncoding; + } + if (fileNameInPP != fileNameIn1) + { + FileAccess::removeTempFile( fileNameInPP ); + } + } + + // LineMatching Preprocessor + if ( ! m_pOptionDialog->m_LineMatchingPreProcessorCmd.isEmpty() ) + { + fileNameIn2 = fileNameOut1.isEmpty() ? fileNameIn1 : fileNameOut1; + QString fileNameInPP = fileNameIn2; + pEncoding2 = pEncoding1; + if ( pEncoding2 != m_pOptionDialog->m_pEncodingPP ) + { + // Before running the preprocessor convert to the format that the preprocessor expects. + fileNameInPP = FileAccess::tempFileName(); + pEncoding2 = m_pOptionDialog->m_pEncodingPP; + convertFileEncoding( fileNameIn2, pEncoding1, fileNameInPP, pEncoding2 ); + } + + QString ppCmd = m_pOptionDialog->m_LineMatchingPreProcessorCmd; + fileNameOut2 = FileAccess::tempFileName(); + QProcess ppProcess; + ppProcess.setStandardInputFile( fileNameInPP ); + ppProcess.setStandardOutputFile( fileNameOut2 ); + ppProcess.start( ppCmd ); + ppProcess.waitForFinished(-1); + //QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut2 + "\""; + //::system( encodeString(cmd) ); + bool bSuccess = m_lmppData.readFile( fileNameOut2 ); + if ( FileAccess(fileNameIn2).size()>0 && ( !bSuccess || m_lmppData.m_size==0 ) ) + { + KMessageBox::error(m_pOptionDialog, + i18n("The line-matching-preprocessing possibly failed. Check this command:\n\n %1" + "\n\nThe line-matching-preprocessing command will be disabled now." + ).arg(ppCmd) ); + m_pOptionDialog->m_LineMatchingPreProcessorCmd = ""; + m_lmppData.readFile( fileNameIn2 ); + } + FileAccess::removeTempFile( fileNameOut2 ); + if (fileNameInPP != fileNameIn2) + { + FileAccess::removeTempFile( fileNameInPP ); + } + } + else if ( m_pOptionDialog->m_bIgnoreComments || m_pOptionDialog->m_bIgnoreCase ) + { + // We need a copy of the normal data. + m_lmppData.copyBufFrom( m_normalData ); + } + else + { // We don't need any lmpp data at all. + m_lmppData.reset(); + } + } + + m_normalData.preprocess( m_pOptionDialog->m_bPreserveCarriageReturn, pEncoding1 ); + m_lmppData.preprocess( false, pEncoding2 ); + + if ( m_lmppData.m_vSize < m_normalData.m_vSize ) + { + // This probably is the fault of the LMPP-Command, but not worth reporting. + m_lmppData.m_v.resize( m_normalData.m_vSize ); + for(int i=m_lmppData.m_vSize; im_bIgnoreCase ) + { + int i; + QChar* pBuf = const_cast(m_lmppData.m_unicodeBuf.unicode()); + int ucSize = m_lmppData.m_unicodeBuf.length(); + for(i=0; im_bIgnoreComments ) + { + m_lmppData.removeComments(); + int vSize = min2(m_normalData.m_vSize, m_lmppData.m_vSize); + for(int i=0; i0 && m_v[lineIdx].pLine[lineLength-1]=='\r' ) + { + --lineLength; + } + m_v[lineIdx].pFirstNonWhiteChar = m_v[lineIdx].pLine + min2(whiteLength,lineLength); + m_v[lineIdx].size = lineLength; + lineLength = 0; + bNonWhiteFound = false; + whiteLength = 0; + ++lineIdx; + } + else + { + ++lineLength; + + if ( ! bNonWhiteFound && isWhite( p[i] ) ) + ++whiteLength; + else + bNonWhiteFound = true; + } + } + assert( lineIdx == lines ); + + m_vSize = lines; +} + + +// Must not be entered, when within a comment. +// Returns either at a newline-character p[i]=='\n' or when i==size. +// A line that contains only comments is still "white". +// Comments in white lines must remain, while comments in +// non-white lines are overwritten with spaces. +static void checkLineForComments( + QChar* p, // pointer to start of buffer + int& i, // index of current position (in, out) + int size, // size of buffer + bool& bWhite, // false if this line contains nonwhite characters (in, out) + bool& bCommentInLine, // true if any comment is within this line (in, out) + bool& bStartsOpenComment // true if the line ends within an comment (out) + ) +{ + bStartsOpenComment = false; + for(; i(m_unicodeBuf.unicode()); + bool bWithinComment=false; + int size = m_unicodeBuf.length(); + for(int i=0; ibegin(); + int lineA=0; + int lineB=0; + Diff d(0,0,0); + + for(;;) + { + if ( d.nofEquals==0 && d.diff1==0 && d.diff2==0 ) + { + if ( i!=pDiffListAB->end() ) + { + d=*i; + ++i; + } + else + break; + } + + Diff3Line d3l; + if( d.nofEquals>0 ) + { + d3l.bAEqB = true; + d3l.lineA = lineA; + d3l.lineB = lineB; + --d.nofEquals; + ++lineA; + ++lineB; + } + else if ( d.diff1>0 && d.diff2>0 ) + { + d3l.lineA = lineA; + d3l.lineB = lineB; + --d.diff1; + --d.diff2; + ++lineA; + ++lineB; + } + else if ( d.diff1>0 ) + { + d3l.lineA = lineA; + --d.diff1; + ++lineA; + } + else if ( d.diff2>0 ) + { + d3l.lineB = lineB; + --d.diff2; + ++lineB; + } + + d3ll.push_back( d3l ); + } +} + + +// Second step +void calcDiff3LineListUsingAC( + const DiffList* pDiffListAC, + Diff3LineList& d3ll + ) +{ + //////////////// + // Now insert data from C using pDiffListAC + + DiffList::const_iterator i=pDiffListAC->begin(); + Diff3LineList::iterator i3 = d3ll.begin(); + int lineA=0; + int lineC=0; + Diff d(0,0,0); + + for(;;) + { + if ( d.nofEquals==0 && d.diff1==0 && d.diff2==0 ) + { + if ( i!=pDiffListAC->end() ) + { + d=*i; + ++i; + } + else + break; + } + + Diff3Line d3l; + if( d.nofEquals>0 ) + { + // Find the corresponding lineA + while( (*i3).lineA!=lineA ) + ++i3; + + (*i3).lineC = lineC; + (*i3).bAEqC = true; + (*i3).bBEqC = (*i3).bAEqB; + + --d.nofEquals; + ++lineA; + ++lineC; + ++i3; + } + else if ( d.diff1>0 && d.diff2>0 ) + { + d3l.lineC = lineC; + d3ll.insert( i3, d3l ); + --d.diff1; + --d.diff2; + ++lineA; + ++lineC; + } + else if ( d.diff1>0 ) + { + --d.diff1; + ++lineA; + } + else if ( d.diff2>0 ) + { + d3l.lineC = lineC; + d3ll.insert( i3, d3l ); + --d.diff2; + ++lineC; + } + } +} + +// Third step +void calcDiff3LineListUsingBC( + const DiffList* pDiffListBC, + Diff3LineList& d3ll + ) +{ + //////////////// + // Now improve the position of data from C using pDiffListBC + // If a line from C equals a line from A then it is in the + // same Diff3Line already. + // If a line from C equals a line from B but not A, this + // information will be used here. + + DiffList::const_iterator i=pDiffListBC->begin(); + Diff3LineList::iterator i3b = d3ll.begin(); + Diff3LineList::iterator i3c = d3ll.begin(); + int lineB=0; + int lineC=0; + Diff d(0,0,0); + + for(;;) + { + if ( d.nofEquals==0 && d.diff1==0 && d.diff2==0 ) + { + if ( i!=pDiffListBC->end() ) + { + d=*i; + ++i; + } + else + break; + } + + Diff3Line d3l; + if( d.nofEquals>0 ) + { + // Find the corresponding lineB and lineC + while( i3b!=d3ll.end() && (*i3b).lineB!=lineB ) + ++i3b; + + while( i3c!=d3ll.end() && (*i3c).lineC!=lineC ) + ++i3c; + + assert(i3b!=d3ll.end()); + assert(i3c!=d3ll.end()); + + if ( i3b==i3c ) + { + assert( (*i3b).lineC == lineC ); + (*i3b).bBEqC = true; + } + else + { + // Is it possible to move this line up? + // Test if no other B's are used between i3c and i3b + + // First test which is before: i3c or i3b ? + Diff3LineList::iterator i3c1 = i3c; + Diff3LineList::iterator i3b1 = i3b; + while( i3c1!=i3b && i3b1!=i3c ) + { + assert(i3b1!=d3ll.end() || i3c1!=d3ll.end()); + if( i3c1!=d3ll.end() ) ++i3c1; + if( i3b1!=d3ll.end() ) ++i3b1; + } + + if( i3c1==i3b && !(*i3b).bAEqB ) // i3c before i3b + { + Diff3LineList::iterator i3 = i3c; + int nofDisturbingLines = 0; + while( i3 != i3b && i3!=d3ll.end() ) + { + if ( (*i3).lineB != -1 ) + ++nofDisturbingLines; + ++i3; + } + + if ( nofDisturbingLines>0 )//&& nofDisturbingLines < d.nofEquals*d.nofEquals+4 ) + { + // Move the disturbing lines up, out of sight. + i3 = i3c; + while( i3 != i3b ) + { + if ( (*i3).lineB != -1 ) + { + Diff3Line d3l; + d3l.lineB = (*i3).lineB; + (*i3).lineB = -1; + (*i3).bAEqB = false; + (*i3).bBEqC = false; + d3ll.insert( i3c, d3l ); + } + ++i3; + } + nofDisturbingLines=0; + } + + if ( nofDisturbingLines == 0 ) + { + // Yes, the line from B can be moved. + (*i3b).lineB = -1; // This might leave an empty line: removed later. + (*i3b).bAEqB = false; + (*i3b).bAEqC = false; + (*i3b).bBEqC = false; + (*i3c).lineB = lineB; + (*i3c).bBEqC = true; + } + } + else if( i3b1==i3c && !(*i3c).bAEqC) + { + Diff3LineList::iterator i3 = i3b; + int nofDisturbingLines = 0; + while( i3 != i3c && i3!=d3ll.end() ) + { + if ( (*i3).lineC != -1 ) + ++nofDisturbingLines; + ++i3; + } + + if ( nofDisturbingLines>0 )//&& nofDisturbingLines < d.nofEquals*d.nofEquals+4 ) + { + // Move the disturbing lines up. + i3 = i3b; + while( i3 != i3c ) + { + if ( (*i3).lineC != -1 ) + { + Diff3Line d3l; + d3l.lineC = (*i3).lineC; + (*i3).lineC = -1; + (*i3).bAEqC = false; + (*i3).bBEqC = false; + d3ll.insert( i3b, d3l ); + } + ++i3; + } + nofDisturbingLines=0; + } + + if ( nofDisturbingLines == 0 ) + { + // Yes, the line from C can be moved. + (*i3c).lineC = -1; // This might leave an empty line: removed later. + (*i3c).bAEqC = false; + (*i3c).bBEqC = false; + (*i3b).lineC = lineC; + (*i3b).bBEqC = true; + } + } + } + + --d.nofEquals; + ++lineB; + ++lineC; + ++i3b; + ++i3c; + } + else if ( d.diff1>0 ) + { + Diff3LineList::iterator i3 = i3b; + while( (*i3).lineB!=lineB ) + ++i3; + if( i3 != i3b && (*i3).bAEqB==false ) + { + // Take B from this line and move it up as far as possible + d3l.lineB = lineB; + d3ll.insert( i3b, d3l ); + (*i3).lineB = -1; + } + else + { + i3b=i3; + } + --d.diff1; + ++lineB; + ++i3b; + + if( d.diff2>0 ) + { + --d.diff2; + ++lineC; + } + } + else if ( d.diff2>0 ) + { + --d.diff2; + ++lineC; + } + } +/* + Diff3LineList::iterator it = d3ll.begin(); + int li=0; + for( ; it!=d3ll.end(); ++it, ++li ) + { + printf( "%4d %4d %4d %4d A%c=B A%c=C B%c=C\n", + li, (*it).lineA, (*it).lineB, (*it).lineC, + (*it).bAEqB ? '=' : '!', (*it).bAEqC ? '=' : '!', (*it).bBEqC ? '=' : '!' ); + } + printf("\n");*/ +} + +#ifdef _WIN32 +using ::equal; +#endif + +// Test if the move would pass a barrier. Return true if not. +static bool isValidMove( ManualDiffHelpList* pManualDiffHelpList, int line1, int line2, int winIdx1, int winIdx2 ) +{ + if (line1>=0 && line2>=0) + { + ManualDiffHelpList::const_iterator i; + for( i = pManualDiffHelpList->begin(); i!=pManualDiffHelpList->end(); ++i ) + { + const ManualDiffHelpEntry& mdhe = *i; + + // Barrier + int l1 = winIdx1 == 1 ? mdhe.lineA1 : winIdx1==2 ? mdhe.lineB1 : mdhe.lineC1 ; + int l2 = winIdx2 == 1 ? mdhe.lineA1 : winIdx2==2 ? mdhe.lineB1 : mdhe.lineC1 ; + + if ( l1>=0 && l2>=0 ) + { + if ( line1>=l1 && line2=l2 ) + return false; + l1 = winIdx1 == 1 ? mdhe.lineA2 : winIdx1==2 ? mdhe.lineB2 : mdhe.lineC2 ; + l2 = winIdx2 == 1 ? mdhe.lineA2 : winIdx2==2 ? mdhe.lineB2 : mdhe.lineC2 ; + ++l1; + ++l2; + if ( line1>=l1 && line2=l2 ) + return false; + } + } + } + return true; // no barrier passed. +} + +void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManualDiffHelpList ) +{ + if ( pManualDiffHelpList->empty() ) + return; + + // If a line appears unaligned in comparison to the manual alignment, correct this. + + ManualDiffHelpList::iterator iMDHL; + for( iMDHL = pManualDiffHelpList->begin(); iMDHL != pManualDiffHelpList->end(); ++iMDHL ) + { + Diff3LineList::iterator i3 = d3ll.begin(); + int winIdxPreferred = 0; + int missingWinIdx = 0; + int alignedSum = (iMDHL->lineA1<0?0:1) + (iMDHL->lineB1<0?0:1) + (iMDHL->lineC1<0?0:1); + if (alignedSum==2) + { + // If only A & B are aligned then let C rather be aligned with A + // If only A & C are aligned then let B rather be aligned with A + // If only B & C are aligned then let A rather be aligned with B + missingWinIdx = iMDHL->lineA1<0 ? 1 : (iMDHL->lineB1<0 ? 2 : 3 ); + winIdxPreferred = missingWinIdx == 1 ? 2 : 1; + } + else if (alignedSum<=1) + { + return; + } + + // At the first aligned line, move up the two other lines into new d3ls until the second input is aligned + // Then move up the third input until all three lines are aligned. + int wi=0; + for( ; i3!=d3ll.end(); ++i3 ) + { + for ( wi=1; wi<=3; ++wi ) + { + if ( i3->getLineInFile(wi) >= 0 && iMDHL->firstLine(wi) == i3->getLineInFile(wi) ) + break; + } + if ( wi<=3 ) + break; + } + + if (wi>=1 && wi <= 3) + { + // Found manual alignment for one source + Diff3LineList::iterator iDest = i3; + + // Move lines up until the next firstLine is found. Omit wi from move and search. + int wi2=0; + for( ; i3!=d3ll.end(); ++i3 ) + { + for ( wi2=1; wi2<=3; ++wi2 ) + { + if ( wi!=wi2 && i3->getLineInFile(wi2) >= 0 && iMDHL->firstLine(wi2) == i3->getLineInFile(wi2) ) + break; + } + if (wi2>3) + { // Not yet found + // Move both others up + Diff3Line d3l; + // Move both up + if (wi==1) // Move B and C up + { + d3l.bBEqC = i3->bBEqC; + d3l.lineB = i3->lineB; + d3l.lineC = i3->lineC; + i3->lineB = -1; + i3->lineC = -1; + } + if (wi==2) // Move A and C up + { + d3l.bAEqC = i3->bAEqC; + d3l.lineA = i3->lineA; + d3l.lineC = i3->lineC; + i3->lineA = -1; + i3->lineC = -1; + } + if (wi==3) // Move A and B up + { + d3l.bAEqB = i3->bAEqB; + d3l.lineA = i3->lineA; + d3l.lineB = i3->lineB; + i3->lineA = -1; + i3->lineB = -1; + } + i3->bAEqB = false; + i3->bAEqC = false; + i3->bBEqC = false; + d3ll.insert( iDest, d3l ); + } + else + { + // align the found line with the line we already have here + if ( i3 != iDest ) + { + if (wi2==1) + { + iDest->lineA = i3->lineA; + i3->lineA = -1; + i3->bAEqB = false; + i3->bAEqC = false; + } + else if (wi2==2) + { + iDest->lineB = i3->lineB; + i3->lineB = -1; + i3->bAEqB = false; + i3->bBEqC = false; + } + else if (wi2==3) + { + iDest->lineC = i3->lineC; + i3->lineC = -1; + i3->bBEqC = false; + i3->bAEqC = false; + } + } + + if ( missingWinIdx!=0 ) + { + for( ; i3!=d3ll.end(); ++i3 ) + { + int wi3 = missingWinIdx; + if ( i3->getLineInFile(wi3) >= 0 ) + { + // 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 ) + { + if (i3->bAEqB) + break; + d3l.lineB = i3->lineB; + i3->lineB = -1; + i3->bAEqB = false; + i3->bBEqC = false; + } + if ( wi3==3 ) + { + 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 + } + break; + } + } // for(), searching for wi2 + } // if, wi found + } // for (iMDHL) +} + +// Fourth step +void calcDiff3LineListTrim( + Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList + ) +{ + const Diff3Line d3l_empty; + d3ll.remove( d3l_empty ); + + Diff3LineList::iterator i3 = d3ll.begin(); + Diff3LineList::iterator i3A = d3ll.begin(); + Diff3LineList::iterator i3B = d3ll.begin(); + Diff3LineList::iterator i3C = d3ll.begin(); + + int line=0; // diff3line counters + int lineA=0; // + int lineB=0; + int lineC=0; + + ManualDiffHelpList::iterator iMDHL = pManualDiffHelpList->begin(); + // The iterator i3 and the variable line look ahead. + // The iterators i3A, i3B, i3C and corresponding lineA, lineB and lineC stop at empty lines, if found. + // If possible, then the texts from the look ahead will be moved back to the empty places. + + for( ; i3!=d3ll.end(); ++i3, ++line ) + { + if ( iMDHL!=pManualDiffHelpList->end() ) + { + if ( i3->lineA >= 0 && i3->lineA==iMDHL->lineA1 || + i3->lineB >= 0 && i3->lineB==iMDHL->lineB1 || + i3->lineC >= 0 && i3->lineC==iMDHL->lineC1 ) + { + i3A = i3; + i3B = i3; + i3C = i3; + lineA = line; + lineB = line; + lineC = line; + ++iMDHL; + } + } + + if( line>lineA && (*i3).lineA != -1 && (*i3A).lineB!=-1 && (*i3A).bBEqC && + ::equal( pldA[(*i3).lineA], pldB[(*i3A).lineB], false ) && + isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineB, 1, 2 ) && + isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineC, 1, 3 ) ) + { + // Empty space for A. A matches B and C in the empty line. Move it up. + (*i3A).lineA = (*i3).lineA; + (*i3A).bAEqB = true; + (*i3A).bAEqC = true; + (*i3).lineA = -1; + (*i3).bAEqB = false; + (*i3).bAEqC = false; + ++i3A; + ++lineA; + } + + if( line>lineB && (*i3).lineB != -1 && (*i3B).lineA!=-1 && (*i3B).bAEqC && + ::equal( pldB[(*i3).lineB], pldA[(*i3B).lineA], false ) && + isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineA, 2, 1 ) && + isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineC, 2, 3 ) ) + { + // Empty space for B. B matches A and C in the empty line. Move it up. + (*i3B).lineB = (*i3).lineB; + (*i3B).bAEqB = true; + (*i3B).bBEqC = true; + (*i3).lineB = -1; + (*i3).bAEqB = false; + (*i3).bBEqC = false; + ++i3B; + ++lineB; + } + + if( line>lineC && (*i3).lineC != -1 && (*i3C).lineA!=-1 && (*i3C).bAEqB && + ::equal( pldC[(*i3).lineC], pldA[(*i3C).lineA], false )&& + isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineA, 3, 1 ) && + isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineB, 3, 2 ) ) + { + // Empty space for C. C matches A and B in the empty line. Move it up. + (*i3C).lineC = (*i3).lineC; + (*i3C).bAEqC = true; + (*i3C).bBEqC = true; + (*i3).lineC = -1; + (*i3).bAEqC = false; + (*i3).bBEqC = false; + ++i3C; + ++lineC; + } + + if( line>lineA && (*i3).lineA != -1 && !(*i3).bAEqB && !(*i3).bAEqC && + isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineB, 1, 2 ) && + isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineC, 1, 3 ) ) { + // Empty space for A. A doesn't match B or C. Move it up. + (*i3A).lineA = (*i3).lineA; + (*i3).lineA = -1; + ++i3A; + ++lineA; + } + + if( line>lineB && (*i3).lineB != -1 && !(*i3).bAEqB && !(*i3).bBEqC && + isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineA, 2, 1 ) && + isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineC, 2, 3 ) ) + { + // Empty space for B. B matches neither A nor C. Move B up. + (*i3B).lineB = (*i3).lineB; + (*i3).lineB = -1; + ++i3B; + ++lineB; + } + + if( line>lineC && (*i3).lineC != -1 && !(*i3).bAEqC && !(*i3).bBEqC && + isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineA, 3, 1 ) && + isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineB, 3, 2 ) ) + { + // Empty space for C. C matches neither A nor B. Move C up. + (*i3C).lineC = (*i3).lineC; + (*i3).lineC = -1; + ++i3C; + ++lineC; + } + + if( line>lineA && line>lineB && (*i3).lineA != -1 && (*i3).bAEqB && !(*i3).bAEqC ) + { + // Empty space for A and B. A matches B, but not C. Move A & B up. + Diff3LineList::iterator i = lineA > lineB ? i3A : i3B; + int l = lineA > lineB ? lineA : lineB; + + if ( isValidMove( pManualDiffHelpList, i->lineC, (*i3).lineA, 3, 1 ) && + isValidMove( pManualDiffHelpList, i->lineC, (*i3).lineB, 3, 2 ) ) + { + (*i).lineA = (*i3).lineA; + (*i).lineB = (*i3).lineB; + (*i).bAEqB = true; + + (*i3).lineA = -1; + (*i3).lineB = -1; + (*i3).bAEqB = false; + i3A = i; + i3B = i; + ++i3A; + ++i3B; + lineA=l+1; + lineB=l+1; + } + } + else if( line>lineA && line>lineC && (*i3).lineA != -1 && (*i3).bAEqC && !(*i3).bAEqB ) + { + // Empty space for A and C. A matches C, but not B. Move A & C up. + Diff3LineList::iterator i = lineA > lineC ? i3A : i3C; + int l = lineA > lineC ? lineA : lineC; + + if ( isValidMove( pManualDiffHelpList, i->lineB, (*i3).lineA, 2, 1 ) && + isValidMove( pManualDiffHelpList, i->lineB, (*i3).lineC, 2, 3 ) ) + { + (*i).lineA = (*i3).lineA; + (*i).lineC = (*i3).lineC; + (*i).bAEqC = true; + + (*i3).lineA = -1; + (*i3).lineC = -1; + (*i3).bAEqC = false; + i3A = i; + i3C = i; + ++i3A; + ++i3C; + lineA=l+1; + lineC=l+1; + } + } + else if( line>lineB && line>lineC && (*i3).lineB != -1 && (*i3).bBEqC && !(*i3).bAEqC ) + { + // Empty space for B and C. B matches C, but not A. Move B & C up. + Diff3LineList::iterator i = lineB > lineC ? i3B : i3C; + int l = lineB > lineC ? lineB : lineC; + + if ( isValidMove( pManualDiffHelpList, i->lineA, (*i3).lineB, 1, 2 ) && + isValidMove( pManualDiffHelpList, i->lineA, (*i3).lineC, 1, 3 ) ) + { + (*i).lineB = (*i3).lineB; + (*i).lineC = (*i3).lineC; + (*i).bBEqC = true; + + (*i3).lineB = -1; + (*i3).lineC = -1; + (*i3).bBEqC = false; + i3B = i; + i3C = i; + ++i3B; + ++i3C; + lineB=l+1; + lineC=l+1; + } + } + + if ( (*i3).lineA != -1 ) + { + lineA = line+1; + i3A = i3; + ++i3A; + } + if ( (*i3).lineB != -1 ) + { + lineB = line+1; + i3B = i3; + ++i3B; + } + if ( (*i3).lineC != -1 ) + { + lineC = line+1; + i3C = i3; + ++i3C; + } + } + + d3ll.remove( d3l_empty ); + +/* + + Diff3LineList::iterator it = d3ll.begin(); + int li=0; + for( ; it!=d3ll.end(); ++it, ++li ) + { + printf( "%4d %4d %4d %4d A%c=B A%c=C B%c=C\n", + li, (*it).lineA, (*it).lineB, (*it).lineC, + (*it).bAEqB ? '=' : '!', (*it).bAEqC ? '=' : '!', (*it).bBEqC ? '=' : '!' ); + + } +*/ +} + +void DiffBufferInfo::init( Diff3LineList* pD3ll, const Diff3LineVector* pD3lv, + const LineData* pldA, int sizeA, const LineData* pldB, int sizeB, const LineData* pldC, int sizeC ) +{ + m_pDiff3LineList = pD3ll; + m_pDiff3LineVector = pD3lv; + m_pLineDataA = pldA; + m_pLineDataB = pldB; + m_pLineDataC = pldC; + m_sizeA = sizeA; + m_sizeB = sizeB; + m_sizeC = sizeC; + Diff3LineList::iterator i3 = pD3ll->begin(); + for( ; i3!=pD3ll->end(); ++i3 ) + { + i3->m_pDiffBufferInfo = this; + } +} + +void calcWhiteDiff3Lines( + Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC + ) +{ + Diff3LineList::iterator i3 = d3ll.begin(); + + for( ; i3!=d3ll.end(); ++i3 ) + { + i3->bWhiteLineA = ( (*i3).lineA == -1 || pldA==0 || pldA[(*i3).lineA].whiteLine() || pldA[(*i3).lineA].bContainsPureComment ); + i3->bWhiteLineB = ( (*i3).lineB == -1 || pldB==0 || pldB[(*i3).lineB].whiteLine() || pldB[(*i3).lineB].bContainsPureComment ); + i3->bWhiteLineC = ( (*i3).lineC == -1 || pldC==0 || pldC[(*i3).lineC].whiteLine() || pldC[(*i3).lineC].bContainsPureComment ); + } +} + +// Just make sure that all input lines are in the output too, exactly once. +void debugLineCheck( Diff3LineList& d3ll, int size, int idx ) +{ + Diff3LineList::iterator it = d3ll.begin(); + int i=0; + + for ( it = d3ll.begin(); it!= d3ll.end(); ++it ) + { + int l=0; + if (idx==1) l=(*it).lineA; + else if (idx==2) l=(*it).lineB; + else if (idx==3) l=(*it).lineC; + else assert(false); + + if ( l!=-1 ) + { + if( l!=i ) + { + KMessageBox::error(0, i18n( + "Data loss error:\n" + "If it is reproducable please contact the author.\n" + ), i18n("Severe Internal Error") ); + assert(false); + std::cerr << "Severe Internal Error.\n"; + ::exit(-1); + } + ++i; + } + } + + if( size!=i ) + { + KMessageBox::error(0, i18n( + "Data loss error:\n" + "If it is reproducable please contact the author.\n" + ), i18n("Severe Internal Error") ); + assert(false); + std::cerr << "Severe Internal Error.\n"; + ::exit(-1); + } +} + +inline bool equal( QChar c1, QChar c2, bool /*bStrict*/ ) +{ + // If bStrict then white space doesn't match + + //if ( bStrict && ( c1==' ' || c1=='\t' ) ) + // return false; + + return c1==c2; +} + + +// My own diff-invention: +template +void calcDiff( const T* p1, int size1, const T* p2, int size2, DiffList& diffList, int match, int maxSearchRange ) +{ + diffList.clear(); + + const T* p1start = p1; + const T* p2start = p2; + const T* p1end=p1+size1; + const T* p2end=p2+size2; + for(;;) + { + int nofEquals = 0; + while( p1!=p1end && p2!=p2end && equal(*p1, *p2, false) ) + { + ++p1; + ++p2; + ++nofEquals; + } + + bool bBestValid=false; + int bestI1=0; + int bestI2=0; + int i1=0; + int i2=0; + for( i1=0; ; ++i1 ) + { + if ( &p1[i1]==p1end || ( bBestValid && i1>= bestI1+bestI2)) + { + break; + } + for(i2=0;i2=bestI1+bestI2) ) + { + break; + } + else if( equal( p2[i2], p1[i1], true ) && + ( match==1 || abs(i1-i2)<3 || ( &p2[i2+1]==p2end && &p1[i1+1]==p1end ) || + ( &p2[i2+1]!=p2end && &p1[i1+1]!=p1end && equal( p2[i2+1], p1[i1+1], false )) + ) + ) + { + if ( i1+i2 < bestI1+bestI2 || bBestValid==false ) + { + bestI1 = i1; + bestI2 = i2; + bBestValid = true; + break; + } + } + } + } + + // The match was found using the strict search. Go back if there are non-strict + // matches. + while( bestI1>=1 && bestI2>=1 && equal( p1[bestI1-1], p2[bestI2-1], false ) ) + { + --bestI1; + --bestI2; + } + + + bool bEndReached = false; + if (bBestValid) + { + // continue somehow + Diff d(nofEquals, bestI1, bestI2); + diffList.push_back( d ); + + p1 += bestI1; + p2 += bestI2; + } + else + { + // Nothing else to match. + Diff d(nofEquals, p1end-p1, p2end-p2); + diffList.push_back( d ); + + bEndReached = true; //break; + } + + // Sometimes the algorithm that chooses the first match unfortunately chooses + // a match where later actually equal parts don't match anymore. + // A different match could be achieved, if we start at the end. + // Do it, if it would be a better match. + int nofUnmatched = 0; + const T* pu1 = p1-1; + const T* pu2 = p2-1; + while ( pu1>=p1start && pu2>=p2start && equal( *pu1, *pu2, false ) ) + { + ++nofUnmatched; + --pu1; + --pu2; + } + + Diff d = diffList.back(); + if ( nofUnmatched > 0 ) + { + // We want to go backwards the nofUnmatched elements and redo + // the matching + d = diffList.back(); + Diff origBack = d; + diffList.pop_back(); + + while ( nofUnmatched > 0 ) + { + if ( d.diff1 > 0 && d.diff2 > 0 ) + { + --d.diff1; + --d.diff2; + --nofUnmatched; + } + else if ( d.nofEquals > 0 ) + { + --d.nofEquals; + --nofUnmatched; + } + + if ( d.nofEquals==0 && (d.diff1==0 || d.diff2==0) && nofUnmatched>0 ) + { + if ( diffList.empty() ) + break; + d.nofEquals += diffList.back().nofEquals; + d.diff1 += diffList.back().diff1; + d.diff2 += diffList.back().diff2; + diffList.pop_back(); + bEndReached = false; + } + } + + if ( bEndReached ) + diffList.push_back( origBack ); + else + { + + p1 = pu1 + 1 + nofUnmatched; + p2 = pu2 + 1 + nofUnmatched; + diffList.push_back( d ); + } + } + if ( bEndReached ) + break; + } + +#ifndef NDEBUG + // Verify difflist + { + int l1=0; + int l2=0; + DiffList::iterator i; + for( i = diffList.begin(); i!=diffList.end(); ++i ) + { + l1+= i->nofEquals + i->diff1; + l2+= i->nofEquals + i->diff2; + } + + //if( l1!=p1-p1start || l2!=p2-p2start ) + if( l1!=size1 || l2!=size2 ) + assert( false ); + } +#endif +} + +void fineDiff( + Diff3LineList& diff3LineList, + int selector, + const LineData* v1, + const LineData* v2, + bool& bTextsTotalEqual + ) +{ + // Finetuning: Diff each line with deltas + ProgressProxy pp; + int maxSearchLength=500; + Diff3LineList::iterator i; + int k1=0; + int k2=0; + bTextsTotalEqual = true; + int listSize = diff3LineList.size(); + int listIdx = 0; + for( i= diff3LineList.begin(); i!= diff3LineList.end(); ++i) + { + if (selector==1){ k1=i->lineA; k2=i->lineB; } + else if (selector==2){ k1=i->lineB; k2=i->lineC; } + else if (selector==3){ k1=i->lineC; k2=i->lineA; } + else assert(false); + if( k1==-1 && k2!=-1 || k1!=-1 && k2==-1 ) bTextsTotalEqual=false; + if( k1!=-1 && k2!=-1 ) + { + if ( v1[k1].size != v2[k2].size || memcmp( v1[k1].pLine, v2[k2].pLine, v1[k1].size<<1)!=0 ) + { + bTextsTotalEqual = false; + DiffList* pDiffList = new DiffList; + calcDiff( v1[k1].pLine, v1[k1].size, v2[k2].pLine, v2[k2].size, *pDiffList, 2, maxSearchLength ); + + // Optimize the diff list. + DiffList::iterator dli; + bool bUsefulFineDiff = false; + for( dli = pDiffList->begin(); dli!=pDiffList->end(); ++dli) + { + if( dli->nofEquals >= 4 ) + { + bUsefulFineDiff = true; + break; + } + } + + for( dli = pDiffList->begin(); dli!=pDiffList->end(); ++dli) + { + if( dli->nofEquals < 4 && (dli->diff1>0 || dli->diff2>0) + && !( bUsefulFineDiff && dli==pDiffList->begin() ) + ) + { + dli->diff1 += dli->nofEquals; + dli->diff2 += dli->nofEquals; + dli->nofEquals = 0; + } + } + + if (selector==1){ delete (*i).pFineAB; (*i).pFineAB = pDiffList; } + else if (selector==2){ delete (*i).pFineBC; (*i).pFineBC = pDiffList; } + else if (selector==3){ delete (*i).pFineCA; (*i).pFineCA = pDiffList; } + else assert(false); + } + + if ( (v1[k1].bContainsPureComment || v1[k1].whiteLine()) && (v2[k2].bContainsPureComment || v2[k2].whiteLine())) + { + if (selector==1){ i->bAEqB = true; } + else if (selector==2){ i->bBEqC = true; } + else if (selector==3){ i->bAEqC = true; } + else assert(false); + } + } + ++listIdx; + pp.setCurrent(double(listIdx)/listSize); + } +} + + +// Convert the list to a vector of pointers +void calcDiff3LineVector( Diff3LineList& d3ll, Diff3LineVector& d3lv ) +{ + d3lv.resize( d3ll.size() ); + Diff3LineList::iterator i; + int j=0; + for( i= d3ll.begin(); i!= d3ll.end(); ++i, ++j) + { + d3lv[j] = &(*i); + } + assert( j==(int)d3lv.size() ); +} + + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/diff.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/diff.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,456 @@ +/*************************************************************************** + diff.h - description + ------------------- + begin : Mon Mar 18 2002 + copyright : (C) 2002-2004 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef DIFF_H +#define DIFF_H + +#include +#include +#include +#include +#include "common.h" +#include "fileaccess.h" + +class OptionDialog; + +// Each range with matching elements is followed by a range with differences on either side. +// Then again range of matching elements should follow. +struct Diff +{ + int nofEquals; + + int diff1; + int diff2; + + Diff(int eq, int d1, int d2){nofEquals=eq; diff1=d1; diff2=d2; } +}; + +typedef std::list DiffList; + +struct LineData +{ + const QChar* pLine; + const QChar* pFirstNonWhiteChar; + int size; + + LineData(){ pLine=0; pFirstNonWhiteChar=0; size=0; /*occurances=0;*/ bContainsPureComment=false; } + int width(int tabSize) const; // Calcs width considering tabs. + //int occurances; + bool whiteLine() const { return pFirstNonWhiteChar-pLine == size; } + bool bContainsPureComment; +}; + +class Diff3LineList; +class Diff3LineVector; + +struct DiffBufferInfo +{ + const LineData* m_pLineDataA; + const LineData* m_pLineDataB; + const LineData* m_pLineDataC; + int m_sizeA; + int m_sizeB; + int m_sizeC; + const Diff3LineList* m_pDiff3LineList; + const Diff3LineVector* m_pDiff3LineVector; + void init( Diff3LineList* d3ll, const Diff3LineVector* d3lv, + const LineData* pldA, int sizeA, const LineData* pldB, int sizeB, const LineData* pldC, int sizeC ); +}; + +struct Diff3Line +{ + int lineA; + int lineB; + int lineC; + + bool bAEqC : 1; // These are true if equal or only white-space changes exist. + bool bBEqC : 1; + bool bAEqB : 1; + + bool bWhiteLineA : 1; + bool bWhiteLineB : 1; + bool bWhiteLineC : 1; + + DiffList* pFineAB; // These are 0 only if completely equal or if either source doesn't exist. + DiffList* pFineBC; + DiffList* pFineCA; + + int linesNeededForDisplay; // Due to wordwrap + int sumLinesNeededForDisplay; // For fast conversion to m_diff3WrapLineVector + + DiffBufferInfo* m_pDiffBufferInfo; // For convenience + + Diff3Line() + { + lineA=-1; lineB=-1; lineC=-1; + bAEqC=false; bAEqB=false; bBEqC=false; + pFineAB=0; pFineBC=0; pFineCA=0; + linesNeededForDisplay=1; + sumLinesNeededForDisplay=0; + bWhiteLineA=false; bWhiteLineB=false; bWhiteLineC=false; + m_pDiffBufferInfo=0; + } + + ~Diff3Line() + { + if (pFineAB!=0) delete pFineAB; + if (pFineBC!=0) delete pFineBC; + if (pFineCA!=0) delete pFineCA; + pFineAB=0; pFineBC=0; pFineCA=0; + } + + bool operator==( const Diff3Line& d3l ) + { + return lineA == d3l.lineA && lineB == d3l.lineB && lineC == d3l.lineC + && bAEqB == d3l.bAEqB && bAEqC == d3l.bAEqC && bBEqC == d3l.bBEqC; + } + + const LineData* getLineData( int src ) const + { + assert( m_pDiffBufferInfo!=0 ); + if ( src == 1 && lineA >= 0 ) return &m_pDiffBufferInfo->m_pLineDataA[lineA]; + if ( src == 2 && lineB >= 0 ) return &m_pDiffBufferInfo->m_pLineDataB[lineB]; + if ( src == 3 && lineC >= 0 ) return &m_pDiffBufferInfo->m_pLineDataC[lineC]; + return 0; + } + QString getString( int src ) const + { + const LineData* pld = getLineData(src); + if ( pld ) + return QString( pld->pLine, pld->size); + else + return QString(); + } + int getLineInFile( int src ) const + { + if ( src == 1 ) return lineA; + if ( src == 2 ) return lineB; + if ( src == 3 ) return lineC; + return -1; + } +}; + + +class Diff3LineList : public std::list +{ +}; +class Diff3LineVector : public std::vector +{ +}; + +class Diff3WrapLine +{ +public: + Diff3Line* pD3L; + int diff3LineIndex; + int wrapLineOffset; + int wrapLineLength; +}; + +typedef std::vector Diff3WrapLineVector; + + +class TotalDiffStatus +{ +public: + TotalDiffStatus(){ reset(); } + void reset() {bBinaryAEqC=false; bBinaryBEqC=false; bBinaryAEqB=false; + bTextAEqC=false; bTextBEqC=false; bTextAEqB=false; + nofUnsolvedConflicts=0; nofSolvedConflicts=0; + nofWhitespaceConflicts=0; + } + bool bBinaryAEqC; + bool bBinaryBEqC; + bool bBinaryAEqB; + + bool bTextAEqC; + bool bTextBEqC; + bool bTextAEqB; + + int nofUnsolvedConflicts; + int nofSolvedConflicts; + int nofWhitespaceConflicts; +}; + +// Three corresponding ranges. (Minimum size of a valid range is one line.) +class ManualDiffHelpEntry +{ +public: + ManualDiffHelpEntry() { lineA1=-1; lineA2=-1; + lineB1=-1; lineB2=-1; + lineC1=-1; lineC2=-1; } + int lineA1; + int lineA2; + int lineB1; + int lineB2; + int lineC1; + int lineC2; + int& firstLine( int winIdx ) + { + return winIdx==1 ? lineA1 : (winIdx==2 ? lineB1 : lineC1 ); + } + int& lastLine( int winIdx ) + { + return winIdx==1 ? lineA2 : (winIdx==2 ? lineB2 : lineC2 ); + } + bool isLineInRange( int line, int winIdx ) + { + return line>=0 && line>=firstLine(winIdx) && line<=lastLine(winIdx); + } + bool operator==(const ManualDiffHelpEntry& r) const + { + return lineA1 == r.lineA1 && lineB1 == r.lineB1 && lineC1 == r.lineC1 && + lineA2 == r.lineA2 && lineB2 == r.lineB2 && lineC2 == r.lineC2; + } +}; + +// A list of corresponding ranges +typedef std::list ManualDiffHelpList; + +void calcDiff3LineListUsingAB( + const DiffList* pDiffListAB, + Diff3LineList& d3ll + ); + +void calcDiff3LineListUsingAC( + const DiffList* pDiffListBC, + Diff3LineList& d3ll + ); + +void calcDiff3LineListUsingBC( + const DiffList* pDiffListBC, + Diff3LineList& d3ll + ); + +void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManualDiffHelpList ); + +class SourceData +{ +public: + SourceData(); + ~SourceData(); + + void setOptionDialog( OptionDialog* pOptionDialog ); + + int getSizeLines() const; + int getSizeBytes() const; + const char* getBuf() const; + const LineData* getLineDataForDisplay() const; + const LineData* getLineDataForDiff() const; + + void setFilename(const QString& filename); + void setFileAccess( const FileAccess& fa ); + //FileAccess& getFileAccess(); + QString getFilename(); + void setAliasName(const QString& a); + QString getAliasName(); + bool isEmpty(); // File was set + bool hasData(); // Data was readable + bool isText(); // is it pure text (vs. binary data) + bool isFromBuffer(); // was it set via setData() (vs. setFileAccess() or setFilename()) + void setData( const QString& data ); + bool isValid(); // Either no file is specified or reading was successful + + void readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetectUnicode ); + bool saveNormalDataAs( const QString& fileName ); + + bool isBinaryEqualWith( const SourceData& other ) const; + + void reset(); + + QTextCodec* getEncoding() const { return m_pEncoding; } + +private: + QTextCodec* detectEncoding( const QString& fileName, QTextCodec* pFallbackCodec ); + QString m_aliasName; + FileAccess m_fileAccess; + OptionDialog* m_pOptionDialog; + QString m_tempInputFileName; + + struct FileData + { + FileData(){ m_pBuf=0; m_size=0; m_vSize=0; m_bIsText=false; } + ~FileData(){ reset(); } + const char* m_pBuf; + int m_size; + int m_vSize; // Nr of lines in m_pBuf1 and size of m_v1, m_dv12 and m_dv13 + QString m_unicodeBuf; + std::vector m_v; + bool m_bIsText; + bool readFile( const QString& filename ); + bool writeFile( const QString& filename ); + void preprocess(bool bPreserveCR, QTextCodec* pEncoding ); + void reset(); + void removeComments(); + void copyBufFrom( const FileData& src ); + }; + FileData m_normalData; + FileData m_lmppData; + QTextCodec* m_pEncoding; +}; + +void calcDiff3LineListTrim( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList ); +void calcWhiteDiff3Lines( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC ); + +void calcDiff3LineVector( Diff3LineList& d3ll, Diff3LineVector& d3lv ); + +void debugLineCheck( Diff3LineList& d3ll, int size, int idx ); + +class QStatusBar; + + +class Selection +{ +public: + Selection(){ reset(); oldLastLine=-1; lastLine=-1; oldFirstLine=-1; } + int firstLine; + int firstPos; + int lastLine; + int lastPos; + int oldLastLine; + int oldFirstLine; + bool bSelectionContainsData; + bool isEmpty() { return firstLine==-1 || (firstLine==lastLine && firstPos==lastPos) || bSelectionContainsData==false;} + void reset(){ + oldFirstLine=firstLine; + oldLastLine =lastLine; + firstLine=-1; + lastLine=-1; + bSelectionContainsData = false; + } + void start( int l, int p ) { firstLine = l; firstPos = p; } + void end( int l, int p ) { + if ( oldLastLine == -1 ) + oldLastLine = lastLine; + lastLine = l; + lastPos = p; + } + bool within( int l, int p ); + + bool lineWithin( int l ); + int firstPosInLine(int l); + int lastPosInLine(int l); + int beginLine(){ + if (firstLine<0 && lastLine<0) return -1; + return max2(0,min2(firstLine,lastLine)); + } + int endLine(){ + if (firstLine<0 && lastLine<0) return -1; + return max2(firstLine,lastLine); + } + int beginPos() { return firstLine==lastLine ? min2(firstPos,lastPos) : + firstLine +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + + +class DiffTextWindowData +{ +public: + DiffTextWindowData( DiffTextWindow* p ) + { + m_pDiffTextWindow = p; + m_bPaintingAllowed = false; + m_pLineData = 0; + m_size = 0; + m_bWordWrap = false; + m_delayedDrawTimer = 0; + m_pDiff3LineVector = 0; + m_pManualDiffHelpList = 0; + m_pOptionDialog = 0; + m_fastSelectorLine1 = 0; + m_fastSelectorNofLines = 0; + m_bTriple = 0; + m_winIdx = 0; + m_firstLine = 0; + m_oldFirstLine = 0; + m_oldFirstColumn = 0; + m_firstColumn = 0; + m_lineNumberWidth = 0; + m_pStatusBar = 0; + m_scrollDeltaX = 0; + m_scrollDeltaY = 0; + m_bMyUpdate = false; + m_bSelectionInProgress = false; + } + DiffTextWindow* m_pDiffTextWindow; + DiffTextWindowFrame* m_pDiffTextWindowFrame; + + bool m_bPaintingAllowed; + const LineData* m_pLineData; + int m_size; + QString m_filename; + bool m_bWordWrap; + int m_delayedDrawTimer; + + const Diff3LineVector* m_pDiff3LineVector; + Diff3WrapLineVector m_diff3WrapLineVector; + const ManualDiffHelpList* m_pManualDiffHelpList; + + OptionDialog* m_pOptionDialog; + QColor m_cThis; + QColor m_cDiff1; + QColor m_cDiff2; + QColor m_cDiffBoth; + + int m_fastSelectorLine1; + int m_fastSelectorNofLines; + + bool m_bTriple; + int m_winIdx; + int m_firstLine; + int m_oldFirstLine; + int m_oldFirstColumn; + int m_firstColumn; + int m_lineNumberWidth; + + void getLineInfo( + const Diff3Line& d, + int& lineIdx, + DiffList*& pFineDiff1, DiffList*& pFineDiff2, // return values + int& changed, int& changed2 ); + + QString getString( int d3lIdx ); + QString getLineString( int line ); + + void writeLine( + MyPainter& p, const LineData* pld, + const DiffList* pLineDiff1, const DiffList* pLineDiff2, int line, + int whatChanged, int whatChanged2, int srcLineIdx, + int wrapLineOffset, int wrapLineLength, bool bWrapLine, const QRect& invalidRect, int deviceWidth + ); + + void draw( MyPainter& p, const QRect& invalidRect, int deviceWidth, int beginLine, int endLine ); + + QStatusBar* m_pStatusBar; + + Selection m_selection; + + int m_scrollDeltaX; + int m_scrollDeltaY; + + bool m_bMyUpdate; + void myUpdate(int afterMilliSecs ); + + int leftInfoWidth() { return 4+m_lineNumberWidth; } // Nr of information columns on left side + int convertLineOnScreenToLineInSource( int lineOnScreen, e_CoordType coordType, bool bFirstLine ); + + bool m_bSelectionInProgress; + QPoint m_lastKnownMousePos; +}; + +DiffTextWindow::DiffTextWindow( + DiffTextWindowFrame* pParent, + QStatusBar* pStatusBar, + OptionDialog* pOptionDialog, + int winIdx + ) + : QWidget(pParent) +{ + setObjectName(QString("DiffTextWindow%1").arg(winIdx)); + setAttribute( Qt::WA_OpaquePaintEvent ); + setAttribute( Qt::WA_PaintOnScreen ); + + d = new DiffTextWindowData(this); + d->m_pDiffTextWindowFrame = pParent; + setFocusPolicy( Qt::ClickFocus ); + setAcceptDrops( true ); + + d->m_pOptionDialog = pOptionDialog; + init( 0, 0, 0, 0, 0, false ); + + setMinimumSize(QSize(20,20)); + + d->m_pStatusBar = pStatusBar; + d->m_bPaintingAllowed = true; + d->m_bWordWrap = false; + d->m_winIdx = winIdx; + + setFont(d->m_pOptionDialog->m_font); +} + +DiffTextWindow::~DiffTextWindow() +{ + delete d; +} + +void DiffTextWindow::init( + const QString& filename, + const LineData* pLineData, + int size, + const Diff3LineVector* pDiff3LineVector, + const ManualDiffHelpList* pManualDiffHelpList, + bool bTriple + ) +{ + d->m_filename = filename; + d->m_pLineData = pLineData; + d->m_size = size; + d->m_pDiff3LineVector = pDiff3LineVector; + d->m_diff3WrapLineVector.clear(); + d->m_pManualDiffHelpList = pManualDiffHelpList; + + d->m_firstLine = 0; + d->m_oldFirstLine = -1; + d->m_firstColumn = 0; + d->m_oldFirstColumn = -1; + d->m_bTriple = bTriple; + d->m_scrollDeltaX=0; + d->m_scrollDeltaY=0; + d->m_bMyUpdate = false; + d->m_fastSelectorLine1 = 0; + d->m_fastSelectorNofLines = 0; + d->m_lineNumberWidth = 0; + d->m_selection.reset(); + d->m_selection.oldFirstLine = -1; // reset is not enough here. + d->m_selection.oldLastLine = -1; + d->m_selection.lastLine = -1; + + update(); + d->m_pDiffTextWindowFrame->init(); +} + +void DiffTextWindow::reset() +{ + d->m_pLineData=0; + d->m_size=0; + d->m_pDiff3LineVector=0; + d->m_filename=""; + d->m_diff3WrapLineVector.clear(); +} + +void DiffTextWindow::setPaintingAllowed( bool bAllowPainting ) +{ + if (d->m_bPaintingAllowed != bAllowPainting) + { + d->m_bPaintingAllowed = bAllowPainting; + if ( d->m_bPaintingAllowed ) update(); + else reset(); + } +} + +void DiffTextWindow::dragEnterEvent( QDragEnterEvent* e ) +{ + e->setAccepted( e->mimeData()->hasUrls() || e->mimeData()->hasText() ); + // Note that the corresponding drop is handled in KDiff3App::eventFilter(). +} + + +void DiffTextWindow::setFirstLine(int firstLine) +{ + int fontHeight = fontMetrics().height(); + + int newFirstLine = max2(0,firstLine); + + int deltaY = fontHeight * ( d->m_firstLine - newFirstLine ); + + d->m_firstLine = newFirstLine; + + if ( d->m_bSelectionInProgress && d->m_selection.firstLine != -1 ) + { + int line, pos; + convertToLinePos( d->m_lastKnownMousePos.x(), d->m_lastKnownMousePos.y(), line, pos ); + d->m_selection.end( line, pos ); + update(); + } + else + { + QWidget::scroll( 0, deltaY ); + } + d->m_pDiffTextWindowFrame->setFirstLine( d->m_firstLine ); +} + +int DiffTextWindow::getFirstLine() +{ + return d->m_firstLine; +} + +void DiffTextWindow::setFirstColumn(int firstCol) +{ + int fontWidth = fontMetrics().width('W'); + int xOffset = d->leftInfoWidth() * fontWidth; + + int newFirstColumn = max2(0,firstCol); + + int deltaX = fontWidth * ( d->m_firstColumn - newFirstColumn ); + + d->m_firstColumn = newFirstColumn; + + QRect r( xOffset, 0, width()-xOffset, height() ); + + if ( d->m_pOptionDialog->m_bRightToLeftLanguage ) + { + deltaX = -deltaX; + r = QRect( width()-1-xOffset, 0, -(width()-xOffset), height() ).normalized(); + } + + if ( d->m_bSelectionInProgress && d->m_selection.firstLine != -1 ) + { + int line, pos; + convertToLinePos( d->m_lastKnownMousePos.x(), d->m_lastKnownMousePos.y(), line, pos ); + d->m_selection.end( line, pos ); + update(); + } + else + { + QWidget::scroll( deltaX, 0, r ); + } +} + +int DiffTextWindow::getNofColumns() +{ + if (d->m_bWordWrap) + { + return getNofVisibleColumns(); + } + else + { + int nofColumns = 0; + for( int i = 0; i< d->m_size; ++i ) + { + if ( d->m_pLineData[i].width( d->m_pOptionDialog->m_tabSize ) > nofColumns ) + nofColumns = d->m_pLineData[i].width( d->m_pOptionDialog->m_tabSize ); + } + return nofColumns; + } +} + +int DiffTextWindow::getNofLines() +{ + return d->m_bWordWrap ? d->m_diff3WrapLineVector.size() : + d->m_pDiff3LineVector->size(); +} + + +int DiffTextWindow::convertLineToDiff3LineIdx( int line ) +{ + if ( d->m_bWordWrap && d->m_diff3WrapLineVector.size()>0 ) + return d->m_diff3WrapLineVector[ min2( line, (int)d->m_diff3WrapLineVector.size()-1 ) ].diff3LineIndex; + else + return line; +} + +int DiffTextWindow::convertDiff3LineIdxToLine( int d3lIdx ) +{ + if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 && d->m_pDiff3LineVector->size()>0 ) + return (*d->m_pDiff3LineVector)[ min2( d3lIdx, (int)d->m_pDiff3LineVector->size()-1 ) ]->sumLinesNeededForDisplay; + else + return d3lIdx; +} + +/** Returns a line number where the linerange [line, line+nofLines] can + be displayed best. If it fits into the currently visible range then + the returned value is the current firstLine. +*/ +int getBestFirstLine( int line, int nofLines, int firstLine, int visibleLines ) +{ + int newFirstLine = firstLine; + if ( line < firstLine || line + nofLines + 2 > firstLine + visibleLines ) + { + if ( nofLines > visibleLines || nofLines <= ( 2*visibleLines / 3 - 1) ) + newFirstLine = line - visibleLines/3; + else + newFirstLine = line - (visibleLines - nofLines); + } + + return newFirstLine; +} + + +void DiffTextWindow::setFastSelectorRange( int line1, int nofLines ) +{ + d->m_fastSelectorLine1 = line1; + d->m_fastSelectorNofLines = nofLines; + if ( isVisible() ) + { + int newFirstLine = getBestFirstLine( + convertDiff3LineIdxToLine(d->m_fastSelectorLine1), + convertDiff3LineIdxToLine(d->m_fastSelectorLine1+d->m_fastSelectorNofLines)-convertDiff3LineIdxToLine(d->m_fastSelectorLine1), + d->m_firstLine, + getNofVisibleLines() + ); + if ( newFirstLine != d->m_firstLine ) + { + scroll( 0, newFirstLine - d->m_firstLine ); + } + + update(); + } +} + + +void DiffTextWindow::showStatusLine(int line ) +{ + int d3lIdx = convertLineToDiff3LineIdx( line ); + if(d3lIdx >= 0 && d3lIdx<(int)d->m_pDiff3LineVector->size() ) + { + const Diff3Line* pD3l = (*d->m_pDiff3LineVector)[d3lIdx]; + if ( pD3l != 0 ) + { + int l = pD3l->getLineInFile( d->m_winIdx ); + + QString s = i18n("File") + " " + d->m_filename; + if ( l!=-1 ) + s += ": " + i18n("Line") + " " + QString::number( l+1 ); + else + s += ": " + i18n("Line not available"); + if (d->m_pStatusBar!=0) d->m_pStatusBar->showMessage(s); + + emit lineClicked( d->m_winIdx, l ); + } + } +} + +void DiffTextWindow::focusInEvent(QFocusEvent* e) +{ + emit gotFocus(); + QWidget::focusInEvent(e); +} + +void DiffTextWindow::mousePressEvent ( QMouseEvent* e ) +{ + if ( e->button() == Qt::LeftButton ) + { + int line; + int pos; + convertToLinePos( e->x(), e->y(), line, pos ); + if ( pos < d->m_firstColumn ) + { + emit setFastSelectorLine( convertLineToDiff3LineIdx(line) ); + d->m_selection.firstLine = -1; // Disable current d->m_selection + } + else + { // Selection + resetSelection(); + d->m_selection.start( line, pos ); + d->m_selection.end( line, pos ); + d->m_bSelectionInProgress = true; + d->m_lastKnownMousePos = e->pos(); + + showStatusLine( line ); + } + } +} + +bool isCTokenChar( QChar c ) +{ + return (c=='_') || + ( c>='A' && c<='Z' ) || ( c>='a' && c<='z' ) || + (c>='0' && c<='9'); +} + +/// Calculate where a token starts and ends, given the x-position on screen. +void calcTokenPos( const QString& s, int posOnScreen, int& pos1, int& pos2, int tabSize ) +{ + // Cursor conversions that consider g_tabSize + int pos = convertToPosInText( s, max2( 0, posOnScreen ), tabSize ); + if ( pos>=(int)s.length() ) + { + pos1=s.length(); + pos2=s.length(); + return; + } + + pos1 = pos; + pos2 = pos+1; + + if( isCTokenChar( s[pos1] ) ) + { + while( pos1>=0 && isCTokenChar( s[pos1] ) ) + --pos1; + ++pos1; + + while( pos2<(int)s.length() && isCTokenChar( s[pos2] ) ) + ++pos2; + } +} + +void DiffTextWindow::mouseDoubleClickEvent( QMouseEvent* e ) +{ + d->m_bSelectionInProgress = false; + d->m_lastKnownMousePos = e->pos(); + if ( e->button() == Qt::LeftButton ) + { + int line; + int pos; + convertToLinePos( e->x(), e->y(), line, pos ); + + // Get the string data of the current line + QString s; + if ( d->m_bWordWrap ) + { + if ( line<0 || line >= (int)d->m_diff3WrapLineVector.size() ) + return; + const Diff3WrapLine& d3wl = d->m_diff3WrapLineVector[line]; + s = d->getString( d3wl.diff3LineIndex ).mid( d3wl.wrapLineOffset, d3wl.wrapLineLength ); + } + else + { + if ( line<0 || line >= (int)d->m_pDiff3LineVector->size() ) + return; + s = d->getString( line ); + } + + if ( ! s.isEmpty() ) + { + int pos1, pos2; + calcTokenPos( s, pos, pos1, pos2, d->m_pOptionDialog->m_tabSize ); + + resetSelection(); + d->m_selection.start( line, convertToPosOnScreen( s, pos1, d->m_pOptionDialog->m_tabSize ) ); + d->m_selection.end( line, convertToPosOnScreen( s, pos2, d->m_pOptionDialog->m_tabSize ) ); + update(); + // emit d->m_selectionEnd() happens in the mouseReleaseEvent. + showStatusLine( line ); + } + } +} + +void DiffTextWindow::mouseReleaseEvent ( QMouseEvent* e ) +{ + d->m_bSelectionInProgress = false; + d->m_lastKnownMousePos = e->pos(); + //if ( e->button() == LeftButton ) + { + if (d->m_delayedDrawTimer) + killTimer(d->m_delayedDrawTimer); + d->m_delayedDrawTimer = 0; + if (d->m_selection.firstLine != -1 ) + { + emit selectionEnd(); + } + } + d->m_scrollDeltaX=0; + d->m_scrollDeltaY=0; +} + +inline int sqr(int x){return x*x;} + +void DiffTextWindow::mouseMoveEvent ( QMouseEvent * e ) +{ + int line; + int pos; + convertToLinePos( e->x(), e->y(), line, pos ); + d->m_lastKnownMousePos = e->pos(); + + if (d->m_selection.firstLine != -1 ) + { + d->m_selection.end( line, pos ); + + showStatusLine( line ); + + // Scroll because mouse moved out of the window + const QFontMetrics& fm = fontMetrics(); + int fontWidth = fm.width('W'); + int deltaX=0; + int deltaY=0; + if ( ! d->m_pOptionDialog->m_bRightToLeftLanguage ) + { + if ( e->x() < d->leftInfoWidth()*fontWidth ) deltaX = -1 - abs(e->x()-d->leftInfoWidth()*fontWidth)/fontWidth; + if ( e->x() > width() ) deltaX = +1 + abs(e->x()-width())/fontWidth; + } + else + { + if ( e->x() > width()-1-d->leftInfoWidth()*fontWidth ) deltaX=+1+ abs(e->x() - (width()-1-d->leftInfoWidth()*fontWidth)) / fontWidth; + if ( e->x() < fontWidth ) deltaX=-1- abs(e->x()-fontWidth)/fontWidth; + } + if ( e->y() < 0 ) deltaY = -1 - sqr( e->y() ) / sqr(fm.height()); + if ( e->y() > height() ) deltaY = +1 + sqr( e->y() - height() ) / sqr(fm.height()); + if ( deltaX != 0 && d->m_scrollDeltaX!=deltaX || deltaY!= 0 && d->m_scrollDeltaY!=deltaY ) + { + d->m_scrollDeltaX = deltaX; + d->m_scrollDeltaY = deltaY; + emit scroll( deltaX, deltaY ); + killTimer( d->m_delayedDrawTimer ); + d->m_delayedDrawTimer = startTimer(50); + } + else + { + d->m_scrollDeltaX = deltaX; + d->m_scrollDeltaY = deltaY; + d->myUpdate(0); + } + } +} + + +void DiffTextWindowData::myUpdate(int afterMilliSecs) +{ + if (m_delayedDrawTimer) + m_pDiffTextWindow->killTimer( m_delayedDrawTimer ); + m_bMyUpdate = true; + m_delayedDrawTimer = m_pDiffTextWindow->startTimer( afterMilliSecs ); +} + +void DiffTextWindow::timerEvent(QTimerEvent*) +{ + killTimer(d->m_delayedDrawTimer); + d->m_delayedDrawTimer = 0; + + if ( d->m_bMyUpdate ) + { + int fontHeight = fontMetrics().height(); + + if ( d->m_selection.oldLastLine != -1 ) + { + int lastLine; + int firstLine; + if ( d->m_selection.oldFirstLine != -1 ) + { + firstLine = min3( d->m_selection.oldFirstLine, d->m_selection.lastLine, d->m_selection.oldLastLine ); + lastLine = max3( d->m_selection.oldFirstLine, d->m_selection.lastLine, d->m_selection.oldLastLine ); + } + else + { + firstLine = min2( d->m_selection.lastLine, d->m_selection.oldLastLine ); + lastLine = max2( d->m_selection.lastLine, d->m_selection.oldLastLine ); + } + int y1 = ( firstLine - d->m_firstLine ) * fontHeight; + int y2 = min2( height(), ( lastLine - d->m_firstLine + 1 ) * fontHeight ); + + if ( y10 ) + { + QRect invalidRect = QRect( 0, y1, width(), y2-y1 ); + update( invalidRect ); + } + } + + d->m_bMyUpdate = false; + } + + if ( d->m_scrollDeltaX != 0 || d->m_scrollDeltaY != 0 ) + { + d->m_selection.end( d->m_selection.lastLine + d->m_scrollDeltaY, d->m_selection.lastPos + d->m_scrollDeltaX ); + emit scroll( d->m_scrollDeltaX, d->m_scrollDeltaY ); + killTimer(d->m_delayedDrawTimer); + d->m_delayedDrawTimer = startTimer(50); + } +} + +void DiffTextWindow::resetSelection() +{ + d->m_selection.reset(); + update(); +} + +void DiffTextWindow::convertToLinePos( int x, int y, int& line, int& pos ) +{ + const QFontMetrics& fm = fontMetrics(); + int fontHeight = fm.height(); + int fontWidth = fm.width('W'); + int xOffset = ( d->leftInfoWidth() - d->m_firstColumn ) * fontWidth; + + int yOffset = - d->m_firstLine * fontHeight; + + line = ( y - yOffset ) / fontHeight; + if ( ! d->m_pOptionDialog->m_bRightToLeftLanguage ) + pos = ( x - xOffset ) / fontWidth; + else + pos = ( (width() - 1 - x) - xOffset ) / fontWidth; +} + +int Selection::firstPosInLine(int l) +{ + assert( firstLine != -1 ); + + int l1 = firstLine; + int l2 = lastLine; + int p1 = firstPos; + int p2 = lastPos; + if ( l1>l2 ){ std::swap(l1,l2); std::swap(p1,p2); } + if ( l1==l2 && p1>p2 ){ std::swap(p1,p2); } + + if ( l==l1 ) + return p1; + return 0; +} + +int Selection::lastPosInLine(int l) +{ + assert( firstLine != -1 ); + + int l1 = firstLine; + int l2 = lastLine; + int p1 = firstPos; + int p2 = lastPos; + + if ( l1>l2 ){ std::swap(l1,l2); std::swap(p1,p2); } + if ( l1==l2 && p1>p2 ){ std::swap(p1,p2); } + + if ( l==l2 ) + return p2; + return INT_MAX; +} + +bool Selection::within( int l, int p ) +{ + if ( firstLine == -1 ) return false; + int l1 = firstLine; + int l2 = lastLine; + int p1 = firstPos; + int p2 = lastPos; + if ( l1>l2 ){ std::swap(l1,l2); std::swap(p1,p2); } + if ( l1==l2 && p1>p2 ){ std::swap(p1,p2); } + if( l1 <= l && l <= l2 ) + { + if ( l1==l2 ) + return p>=p1 && p=p1; + if ( l==l2 ) + return pl2 ){ std::swap(l1,l2); } + + return ( l1 <= l && l <= l2 ); +} + + +void DiffTextWindowData::writeLine( + MyPainter& p, + const LineData* pld, + const DiffList* pLineDiff1, + const DiffList* pLineDiff2, + int line, + int whatChanged, + int whatChanged2, + int srcLineIdx, + int wrapLineOffset, + int wrapLineLength, + bool bWrapLine, + const QRect& invalidRect, + int deviceWidth + ) +{ + QFont normalFont = p.font(); + QFont diffFont = normalFont; + diffFont.setItalic( m_pOptionDialog->m_bItalicForDeltas ); + const QFontMetrics& fm = p.fontMetrics(); + int fontHeight = fm.height(); + int fontAscent = fm.ascent(); + int fontDescent = fm.descent(); + int fontWidth = fm.width('W'); + + int xOffset = (leftInfoWidth() - m_firstColumn)*fontWidth; + int yOffset = (line-m_firstLine) * fontHeight; + + QRect lineRect( 0, yOffset, deviceWidth, fontHeight ); + if ( ! invalidRect.intersects( lineRect ) ) + { + return; + } + + int fastSelectorLine1 = m_pDiffTextWindow->convertDiff3LineIdxToLine(m_fastSelectorLine1); + int fastSelectorLine2 = m_pDiffTextWindow->convertDiff3LineIdxToLine(m_fastSelectorLine1+m_fastSelectorNofLines)-1; + + bool bFastSelectionRange = (line>=fastSelectorLine1 && line<= fastSelectorLine2 ); + QColor bgColor = m_pOptionDialog->m_bgColor; + QColor diffBgColor = m_pOptionDialog->m_diffBgColor; + + if ( bFastSelectionRange ) + { + bgColor = m_pOptionDialog->m_currentRangeBgColor; + diffBgColor = m_pOptionDialog->m_currentRangeDiffBgColor; + } + + if ( yOffset+fontHeightm_fgColor; + if ( changed == 2 ) { + c = m_cDiff2; + } else if ( changed == 1 ) { + c = m_cDiff1; + } else if ( changed == 3 ) { + c = m_cDiffBoth; + } + + p.fillRect( leftInfoWidth()*fontWidth, yOffset, deviceWidth, fontHeight, bgColor ); + + if (pld!=0) + { + // First calculate the "changed" information for each character. + int i=0; + std::vector charChanged( pld->size ); + if ( pLineDiff1!=0 || pLineDiff2 != 0 ) + { + Merger merger( pLineDiff1, pLineDiff2 ); + while( ! merger.isEndReached() && isize ) + { + if ( i < pld->size ) + { + charChanged[i] = merger.whatChanged(); + ++i; + } + merger.next(); + } + } + + QString s=" "; + // Convert tabs + int outPos = 0; + + QString lineString( pld->pLine, pld->size ); + int lineLength = m_bWordWrap ? wrapLineOffset+wrapLineLength : lineString.length(); + + for( i=wrapLineOffset; im_tabSize ); + s[0] = ' '; + } + else + { + s[0] = lineString[i]; + } + + QColor c = m_pOptionDialog->m_fgColor; + int cchanged = charChanged[i] | whatChanged; + + if ( cchanged == 2 ) { + c = m_cDiff2; + } else if ( cchanged == 1 ) { + c = m_cDiff1; + } else if ( cchanged == 3 ) { + c = m_cDiffBoth; + } + + if ( c!=m_pOptionDialog->m_fgColor && whatChanged2==0 && !m_pOptionDialog->m_bShowWhiteSpace ) + { + // The user doesn't want to see highlighted white space. + c = m_pOptionDialog->m_fgColor; + } + + QRect outRect( xOffset + fontWidth*outPos, yOffset, fontWidth*spaces, fontHeight ); + if ( m_pOptionDialog->m_bRightToLeftLanguage ) + outRect = QRect( deviceWidth-1-(xOffset + fontWidth*outPos), yOffset, -fontWidth*spaces, fontHeight ).normalized(); + if ( invalidRect.intersects( outRect ) ) + { + if( !m_selection.within( line, outPos ) ) + { + + if( c!=m_pOptionDialog->m_fgColor ) + { + QColor lightc = diffBgColor; + p.fillRect( xOffset + fontWidth*outPos, yOffset, + fontWidth*spaces, fontHeight, lightc ); + p.setFont(diffFont); + } + + p.setPen( c ); + if ( s[0]==' ' && c!=m_pOptionDialog->m_fgColor && charChanged[i]!=0 ) + { + if ( m_pOptionDialog->m_bShowWhiteSpaceCharacters && m_pOptionDialog->m_bShowWhiteSpace) + { + p.fillRect( xOffset + fontWidth*outPos, yOffset+fontAscent, + fontWidth*spaces-1, fontDescent, c ); // QT3 + //fontWidth*spaces-1, fontDescent, c ); // QT4 + } + } + else + { + p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, s ); + } + p.setFont(normalFont); + } + else + { + p.fillRect( xOffset + fontWidth*outPos, yOffset, + fontWidth*(spaces), fontHeight, m_pDiffTextWindow->palette().highlight() ); + + p.setPen( m_pDiffTextWindow->palette().highlightedText().color() ); + p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, s ); + + m_selection.bSelectionContainsData = true; + } + } + + outPos += spaces; + } + + if( m_selection.lineWithin( line ) && m_selection.lineWithin( line+1 ) ) + { + p.fillRect( xOffset + fontWidth*outPos, yOffset, + deviceWidth, fontHeight, m_pDiffTextWindow->palette().highlight() ); + } + } + + p.fillRect( 0, yOffset, leftInfoWidth()*fontWidth, fontHeight, m_pOptionDialog->m_bgColor ); + + xOffset = (m_lineNumberWidth+2)*fontWidth; + int xLeft = m_lineNumberWidth*fontWidth; + p.setPen( m_pOptionDialog->m_fgColor ); + if ( pld!=0 ) + { + if ( m_pOptionDialog->m_bShowLineNumbers && !bWrapLine ) + { + QString num; + num.sprintf( "%0*d", m_lineNumberWidth, srcLineIdx+1); + p.drawText( 0, yOffset + fontAscent, num ); + //p.drawLine( xLeft -1, yOffset, xLeft -1, yOffset+fontHeight-1 ); + } + if ( !bWrapLine || wrapLineLength>0 ) + { + p.setPen( QPen( m_pOptionDialog->m_fgColor, 0, bWrapLine ? Qt::DotLine : Qt::SolidLine) ); + p.drawLine( xOffset +1, yOffset, xOffset +1, yOffset+fontHeight-1 ); + p.setPen( QPen( m_pOptionDialog->m_fgColor, 0, Qt::SolidLine) ); + } + } + if ( c!=m_pOptionDialog->m_fgColor && whatChanged2==0 )//&& whatChanged==0 ) + { + if ( m_pOptionDialog->m_bShowWhiteSpace ) + { + p.setBrushOrigin(0,0); + p.fillRect( xLeft, yOffset, fontWidth*2-1, fontHeight, QBrush(c,Qt::Dense5Pattern) ); + } + } + else + { + p.fillRect( xLeft, yOffset, fontWidth*2-1, fontHeight, c==m_pOptionDialog->m_fgColor ? bgColor : c ); + } + + if ( bFastSelectionRange ) + { + p.fillRect( xOffset + fontWidth-1, yOffset, 3, fontHeight, m_pOptionDialog->m_fgColor ); + } + + // Check if line needs a manual diff help mark + ManualDiffHelpList::const_iterator ci; + for( ci = m_pManualDiffHelpList->begin(); ci!=m_pManualDiffHelpList->end(); ++ci) + { + const ManualDiffHelpEntry& mdhe=*ci; + int rangeLine1 = -1; + int rangeLine2 = -1; + if (m_winIdx==1 ) { rangeLine1 = mdhe.lineA1; rangeLine2= mdhe.lineA2; } + if (m_winIdx==2 ) { rangeLine1 = mdhe.lineB1; rangeLine2= mdhe.lineB2; } + if (m_winIdx==3 ) { rangeLine1 = mdhe.lineC1; rangeLine2= mdhe.lineC2; } + if ( rangeLine1>=0 && rangeLine2>=0 && srcLineIdx >= rangeLine1 && srcLineIdx <= rangeLine2 ) + { + p.fillRect( xOffset - fontWidth, yOffset, fontWidth-1, fontHeight, m_pOptionDialog->m_manualHelpRangeColor ); + break; + } + } +} + +void DiffTextWindow::paintEvent( QPaintEvent* e ) +{ + if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || + ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) + return; + + QRect invalidRect = e->rect(); + if ( invalidRect.isEmpty() ) + return; + + bool bOldSelectionContainsData = d->m_selection.bSelectionContainsData; + d->m_selection.bSelectionContainsData = false; + + int endLine = min2( d->m_firstLine + getNofVisibleLines()+2, getNofLines() ); + + //if ( invalidRect.size()==size() ) + { // double buffering, obsolete with Qt4 + //QPainter painter(this); // Remove for Qt4 + //QPixmap pixmap( invalidRect.size() );// Remove for Qt4 + + 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.setFont( font() ); + p.QPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); + + d->draw( p, invalidRect, width(), d->m_firstLine, endLine ); + // 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 + } +// else +// { // no double buffering +// MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); +// p.setFont( font() ); +// p.QPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); +// d->draw( p, invalidRect, width(), d->m_firstLine, endLine ); +// } + + + d->m_oldFirstLine = d->m_firstLine; + d->m_oldFirstColumn = d->m_firstColumn; + d->m_selection.oldLastLine = -1; + if ( d->m_selection.oldFirstLine !=-1 ) + d->m_selection.oldFirstLine = -1; + + if( !bOldSelectionContainsData && d->m_selection.bSelectionContainsData ) + emit newSelection(); +} + +void DiffTextWindow::print( MyPainter& p, const QRect&, int firstLine, int nofLinesPerPage ) +{ + if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || + ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) + return; + resetSelection(); +// MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); + int oldFirstLine = d->m_firstLine; + d->m_firstLine = firstLine; + QRect invalidRect = QRect(0,0,1000000000,1000000000); + QColor bgColor = d->m_pOptionDialog->m_bgColor; + d->m_pOptionDialog->m_bgColor = Qt::white; + d->draw( p, invalidRect, p.window().width(), firstLine, min2(firstLine+nofLinesPerPage,getNofLines()) ); + d->m_pOptionDialog->m_bgColor = bgColor; + d->m_firstLine = oldFirstLine; +} + +void DiffTextWindowData::draw( MyPainter& p, const QRect& invalidRect, int deviceWidth, int beginLine, int endLine ) +{ + m_lineNumberWidth = m_pOptionDialog->m_bShowLineNumbers ? (int)log10((double)m_size)+1 : 0; + + if ( m_winIdx==1 ) + { + m_cThis = m_pOptionDialog->m_colorA; + m_cDiff1 = m_pOptionDialog->m_colorB; + m_cDiff2 = m_pOptionDialog->m_colorC; + } + if ( m_winIdx==2 ) + { + m_cThis = m_pOptionDialog->m_colorB; + m_cDiff1 = m_pOptionDialog->m_colorC; + m_cDiff2 = m_pOptionDialog->m_colorA; + } + if ( m_winIdx==3 ) + { + m_cThis = m_pOptionDialog->m_colorC; + m_cDiff1 = m_pOptionDialog->m_colorA; + m_cDiff2 = m_pOptionDialog->m_colorB; + } + m_cDiffBoth = m_pOptionDialog->m_colorForConflict; // Conflict color + + p.setPen( m_cThis ); + + for ( int line = beginLine; line 0 && m_diff3WrapLineVector[line-1].pD3L == d3l; + } + else + { + d3l = (*m_pDiff3LineVector)[line]; + } + DiffList* pFineDiff1; + DiffList* pFineDiff2; + int changed=0; + int changed2=0; + + int srcLineIdx=-1; + getLineInfo( *d3l, srcLineIdx, pFineDiff1, pFineDiff2, changed, changed2 ); + + writeLine( + p, // QPainter + srcLineIdx == -1 ? 0 : &m_pLineData[srcLineIdx], // Text in this line + pFineDiff1, + pFineDiff2, + line, // Line on the screen + changed, + changed2, + srcLineIdx, + wrapLineOffset, + wrapLineLength, + bWrapLine, + invalidRect, + deviceWidth + ); + } +} + +QString DiffTextWindowData::getString( int d3lIdx ) +{ + if ( d3lIdx<0 || d3lIdx>=(int)m_pDiff3LineVector->size() ) + return QString(); + const Diff3Line* d3l = (*m_pDiff3LineVector)[d3lIdx]; + DiffList* pFineDiff1; + DiffList* pFineDiff2; + int changed=0; + int changed2=0; + int lineIdx; + getLineInfo( *d3l, lineIdx, pFineDiff1, pFineDiff2, changed, changed2 ); + + if (lineIdx==-1) return QString(); + else + { + const LineData* ld = &m_pLineData[lineIdx]; + return QString( ld->pLine, ld->size ); + } + return QString(); +} + +QString DiffTextWindowData::getLineString( int line ) +{ + if ( m_bWordWrap ) + { + int d3LIdx = m_pDiffTextWindow->convertLineToDiff3LineIdx(line); + return getString( d3LIdx ).mid( m_diff3WrapLineVector[line].wrapLineOffset, m_diff3WrapLineVector[line].wrapLineLength ); + } + else + { + return getString( line ); + } +} + +void DiffTextWindowData::getLineInfo( + const Diff3Line& d3l, + int& lineIdx, + DiffList*& pFineDiff1, DiffList*& pFineDiff2, // return values + int& changed, int& changed2 + ) +{ + changed=0; + changed2=0; + bool bAEqB = d3l.bAEqB || ( d3l.bWhiteLineA && d3l.bWhiteLineB ); + bool bAEqC = d3l.bAEqC || ( d3l.bWhiteLineA && d3l.bWhiteLineC ); + bool bBEqC = d3l.bBEqC || ( d3l.bWhiteLineB && d3l.bWhiteLineC ); + if ( m_winIdx == 1 ) { + lineIdx=d3l.lineA; + pFineDiff1=d3l.pFineAB; + pFineDiff2=d3l.pFineCA; + changed |= ((d3l.lineB==-1)!=(lineIdx==-1) ? 1 : 0) + + ((d3l.lineC==-1)!=(lineIdx==-1) && m_bTriple ? 2 : 0); + changed2 |= ( bAEqB ? 0 : 1 ) + (bAEqC || !m_bTriple ? 0 : 2); + } + else if ( m_winIdx == 2 ) { + lineIdx=d3l.lineB; + pFineDiff1=d3l.pFineBC; + pFineDiff2=d3l.pFineAB; + changed |= ((d3l.lineC==-1)!=(lineIdx==-1) && m_bTriple ? 1 : 0) + + ((d3l.lineA==-1)!=(lineIdx==-1) ? 2 : 0); + changed2 |= ( bBEqC || !m_bTriple ? 0 : 1 ) + (bAEqB ? 0 : 2); + } + else if ( m_winIdx == 3 ) { + lineIdx=d3l.lineC; + pFineDiff1=d3l.pFineCA; + pFineDiff2=d3l.pFineBC; + changed |= ((d3l.lineA==-1)!=(lineIdx==-1) ? 1 : 0) + + ((d3l.lineB==-1)!=(lineIdx==-1) ? 2 : 0); + changed2 |= ( bAEqC ? 0 : 1 ) + (bBEqC ? 0 : 2); + } + else assert(false); +} + + + +void DiffTextWindow::resizeEvent( QResizeEvent* e ) +{ + QSize s = e->size(); + QFontMetrics fm = fontMetrics(); + int visibleLines = s.height()/fm.height()-2; + int visibleColumns = s.width()/fm.width('W') - d->leftInfoWidth(); + emit resizeSignal( visibleColumns, visibleLines ); + QWidget::resizeEvent(e); +} + +int DiffTextWindow::getNofVisibleLines() +{ + QFontMetrics fm = fontMetrics(); + int fmh = fm.height(); + int h = height(); + return h/fmh -1;//height()/fm.height()-2; +} + +int DiffTextWindow::getNofVisibleColumns() +{ + QFontMetrics fm = fontMetrics(); + return width()/fm.width('W') - d->leftInfoWidth(); +} + +QString DiffTextWindow::getSelection() +{ + QString selectionString; + + int line=0; + int lineIdx=0; + + int it; + int vectorSize = d->m_bWordWrap ? d->m_diff3WrapLineVector.size() : d->m_pDiff3LineVector->size(); + for( it=0; itm_bWordWrap ? d->m_diff3WrapLineVector[it].pD3L : (*d->m_pDiff3LineVector)[it]; + if ( d->m_winIdx == 1 ) { lineIdx=d3l->lineA; } + else if ( d->m_winIdx == 2 ) { lineIdx=d3l->lineB; } + else if ( d->m_winIdx == 3 ) { lineIdx=d3l->lineC; } + else assert(false); + + if( lineIdx != -1 ) + { + const QChar* pLine = d->m_pLineData[lineIdx].pLine; + int size = d->m_pLineData[lineIdx].size; + QString lineString = QString( pLine, size ); + + if ( d->m_bWordWrap ) + { + size = d->m_diff3WrapLineVector[it].wrapLineLength; + lineString = lineString.mid( d->m_diff3WrapLineVector[it].wrapLineOffset, size ); + } + + // Consider tabs + int outPos = 0; + for( int i=0; im_pOptionDialog->m_tabSize ); + } + + if( d->m_selection.within( line, outPos ) ) + { + selectionString += lineString[i]; + } + + outPos += spaces; + } + + if( d->m_selection.within( line, outPos ) && + !( d->m_bWordWrap && it+1m_diff3WrapLineVector[it+1].pD3L ) + ) + { + #ifdef _WIN32 + selectionString += '\r'; + #endif + selectionString += '\n'; + } + } + + ++line; + } + + return selectionString; +} + +bool DiffTextWindow::findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) +{ + int it = d3vLine; + int endIt = bDirDown ? (int)d->m_pDiff3LineVector->size() : -1; + int step = bDirDown ? 1 : -1; + int startPos = posInLine; + + for( ; it!=endIt; it+=step ) + { + QString line = d->getString( it ); + if ( !line.isEmpty() ) + { + int pos = line.indexOf( s, startPos, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); + if ( pos != -1 ) + { + d3vLine = it; + posInLine = pos; + return true; + } + + startPos = 0; + } + } + return false; +} + +void DiffTextWindow::convertD3LCoordsToLineCoords( int d3LIdx, int d3LPos, int& line, int& pos ) +{ + if( d->m_bWordWrap ) + { + int wrapPos = d3LPos; + int wrapLine = convertDiff3LineIdxToLine(d3LIdx); + while ( wrapPos > d->m_diff3WrapLineVector[wrapLine].wrapLineLength ) + { + wrapPos -= d->m_diff3WrapLineVector[wrapLine].wrapLineLength; + ++wrapLine; + } + pos = wrapPos; + line = wrapLine; + } + else + { + pos = d3LPos; + line = d3LIdx; + } +} + +void DiffTextWindow::convertLineCoordsToD3LCoords( int line, int pos, int& d3LIdx, int& d3LPos ) +{ + if( d->m_bWordWrap ) + { + d3LPos = pos; + d3LIdx = convertLineToDiff3LineIdx( line ); + int wrapLine = convertDiff3LineIdxToLine(d3LIdx); // First wrap line belonging to this d3LIdx + while ( wrapLine < line ) + { + d3LPos += d->m_diff3WrapLineVector[wrapLine].wrapLineLength; + ++wrapLine; + } + } + else + { + d3LPos = pos; + d3LIdx = line; + } +} + + +void DiffTextWindow::setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p ) +{ + d->m_selection.reset(); + if ( lastLine >= getNofLines() ) + { + lastLine = getNofLines()-1; + + const Diff3Line* d3l = (*d->m_pDiff3LineVector)[convertLineToDiff3LineIdx(lastLine)]; + int line = -1; + if ( d->m_winIdx==1 ) line = d3l->lineA; + if ( d->m_winIdx==2 ) line = d3l->lineB; + if ( d->m_winIdx==3 ) line = d3l->lineC; + if (line>=0) + endPos = d->m_pLineData[line].width( d->m_pOptionDialog->m_tabSize); + } + + if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 ) + { + QString s1 = d->getString(firstLine); + int firstWrapLine = convertDiff3LineIdxToLine(firstLine); + int wrapStartPos = startPos; + while ( wrapStartPos > d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength ) + { + wrapStartPos -= d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength; + s1 = s1.mid(d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength); + ++firstWrapLine; + } + + QString s2 = d->getString(lastLine); + int lastWrapLine = convertDiff3LineIdxToLine(lastLine); + int wrapEndPos = endPos; + while ( wrapEndPos > d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength ) + { + wrapEndPos -= d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength; + s2 = s2.mid(d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength); + ++lastWrapLine; + } + + d->m_selection.start( firstWrapLine, convertToPosOnScreen( s1, wrapStartPos, d->m_pOptionDialog->m_tabSize ) ); + d->m_selection.end( lastWrapLine, convertToPosOnScreen( s2, wrapEndPos, d->m_pOptionDialog->m_tabSize ) ); + l=firstWrapLine; + p=wrapStartPos; + } + else + { + d->m_selection.start( firstLine, convertToPosOnScreen( d->getString(firstLine), startPos, d->m_pOptionDialog->m_tabSize ) ); + d->m_selection.end( lastLine, convertToPosOnScreen( d->getString(lastLine), endPos, d->m_pOptionDialog->m_tabSize ) ); + l=firstLine; + p=startPos; + } + update(); +} + +int DiffTextWindowData::convertLineOnScreenToLineInSource( int lineOnScreen, e_CoordType coordType, bool bFirstLine ) +{ + int line=-1; + if (lineOnScreen>=0) + { + if (coordType==eWrapCoords) return lineOnScreen; + int d3lIdx = m_pDiffTextWindow->convertLineToDiff3LineIdx( lineOnScreen ); + if ( !bFirstLine && d3lIdx >= (int)m_pDiff3LineVector->size() ) + d3lIdx = m_pDiff3LineVector->size()-1; + if (coordType==eD3LLineCoords) return d3lIdx; + while ( line<0 && d3lIdx<(int)m_pDiff3LineVector->size() && d3lIdx>=0 ) + { + const Diff3Line* d3l = (*m_pDiff3LineVector)[d3lIdx]; + if ( m_winIdx==1 ) line = d3l->lineA; + if ( m_winIdx==2 ) line = d3l->lineB; + if ( m_winIdx==3 ) line = d3l->lineC; + if ( bFirstLine ) + ++d3lIdx; + else + --d3lIdx; + } + if (coordType==eFileCoords) return line; + } + return line; +} + + +void DiffTextWindow::getSelectionRange( int* pFirstLine, int* pLastLine, e_CoordType coordType ) +{ + if (pFirstLine) + *pFirstLine = d->convertLineOnScreenToLineInSource( d->m_selection.beginLine(), coordType, true ); + if (pLastLine) + *pLastLine = d->convertLineOnScreenToLineInSource( d->m_selection.endLine(), coordType, false ); +} + +// Returns the number of wrapped lines +// if pWrappedLines != 0 then the stringlist will contain the wrapped lines. +int wordWrap( const QString& origLine, int nofColumns, Diff3WrapLine* pDiff3WrapLine ) +{ + if (nofColumns<=0) + nofColumns = 1; + + int nofNeededLines = 0; + int length = origLine.length(); + + if (length==0) + { + nofNeededLines = 1; + if( pDiff3WrapLine ) + { + pDiff3WrapLine->wrapLineOffset=0; + pDiff3WrapLine->wrapLineLength=0; + } + } + else + { + int pos = 0; + + while ( pos < length ) + { + int wrapPos = pos + nofColumns; + + if ( length-pos <= nofColumns ) + { + wrapPos = length; + } + else + { + int wsPos = max2( origLine.lastIndexOf( ' ', wrapPos ), origLine.lastIndexOf( '\t', wrapPos ) ); + + if ( wsPos > pos ) + { + // Wrap line at wsPos + wrapPos = wsPos; + } + } + + if ( pDiff3WrapLine ) + { + pDiff3WrapLine->wrapLineOffset = pos; + pDiff3WrapLine->wrapLineLength = wrapPos-pos; + ++pDiff3WrapLine; + } + + pos = wrapPos; + + ++nofNeededLines; + } + } + return nofNeededLines; +} + +void DiffTextWindow::convertSelectionToD3LCoords() +{ + if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || !isVisible() || d->m_selection.isEmpty() ) + { + return; + } + + // convert the d->m_selection to unwrapped coordinates: Later restore to new coords + int firstD3LIdx, firstD3LPos; + QString s = d->getLineString( d->m_selection.beginLine() ); + int firstPosInText = convertToPosInText( s, d->m_selection.beginPos(), d->m_pOptionDialog->m_tabSize ); + convertLineCoordsToD3LCoords( d->m_selection.beginLine(), firstPosInText, firstD3LIdx, firstD3LPos ); + + int lastD3LIdx, lastD3LPos; + s = d->getLineString( d->m_selection.endLine() ); + int lastPosInText = convertToPosInText( s, d->m_selection.endPos(), d->m_pOptionDialog->m_tabSize ); + convertLineCoordsToD3LCoords( d->m_selection.endLine(), lastPosInText, lastD3LIdx, lastD3LPos ); + + //d->m_selection.reset(); + d->m_selection.start( firstD3LIdx, firstD3LPos ); + d->m_selection.end( lastD3LIdx, lastD3LPos ); +} + +void DiffTextWindow::recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns ) +{ + if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || !isVisible() ) + { + d->m_bWordWrap = bWordWrap; + if (!bWordWrap) d->m_diff3WrapLineVector.resize( 0 ); + return; + } + + d->m_bWordWrap = bWordWrap; + + if ( bWordWrap ) + { + d->m_diff3WrapLineVector.resize( wrapLineVectorSize ); + + if (nofVisibleColumns<0) + nofVisibleColumns = getNofVisibleColumns(); + else + nofVisibleColumns-= d->leftInfoWidth(); + int i; + int wrapLineIdx = 0; + int size = d->m_pDiff3LineVector->size(); + for( i=0; igetString( i ); + int linesNeeded = wordWrap( s, nofVisibleColumns, wrapLineVectorSize==0 ? 0 : &d->m_diff3WrapLineVector[wrapLineIdx] ); + Diff3Line& d3l = *(*d->m_pDiff3LineVector)[i]; + if ( d3l.linesNeededForDisplay0 ) + { + int j; + for( j=0; jm_diff3WrapLineVector[wrapLineIdx]; + d3wl.diff3LineIndex = i; + d3wl.pD3L = (*d->m_pDiff3LineVector)[i]; + if ( j>=linesNeeded ) + { + d3wl.wrapLineOffset=0; + d3wl.wrapLineLength=0; + } + } + } + } + + if ( wrapLineVectorSize>0 ) + { + d->m_firstLine = min2( d->m_firstLine, wrapLineVectorSize-1 ); + d->m_firstColumn = 0; + d->m_pDiffTextWindowFrame->setFirstLine( d->m_firstLine ); + } + } + else + { + d->m_diff3WrapLineVector.resize( 0 ); + } + + if ( !d->m_selection.isEmpty() && ( !d->m_bWordWrap || wrapLineVectorSize>0 ) ) + { + // Assume unwrapped coordinates + //( Why? ->Conversion to unwrapped coords happened a few lines above in this method. + // Also see KDiff3App::recalcWordWrap() on the role of wrapLineVectorSize) + + // Wrap them now. + + // convert the d->m_selection to unwrapped coordinates. + int firstLine, firstPos; + convertD3LCoordsToLineCoords( d->m_selection.beginLine(), d->m_selection.beginPos(), firstLine, firstPos ); + + int lastLine, lastPos; + convertD3LCoordsToLineCoords( d->m_selection.endLine(), d->m_selection.endPos(), lastLine, lastPos ); + + //d->m_selection.reset(); + d->m_selection.start( firstLine, convertToPosOnScreen( d->getLineString( firstLine ), firstPos, d->m_pOptionDialog->m_tabSize ) ); + d->m_selection.end( lastLine, convertToPosOnScreen( d->getLineString( lastLine ),lastPos, d->m_pOptionDialog->m_tabSize ) ); + } +} + + +class DiffTextWindowFrameData +{ +public: + DiffTextWindow* m_pDiffTextWindow; + QLineEdit* m_pFileSelection; + QPushButton* m_pBrowseButton; + OptionDialog* m_pOptionDialog; + QLabel* m_pLabel; + QLabel* m_pTopLine; + QWidget* m_pTopLineWidget; +}; + +DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ) + : QWidget( pParent ) +{ + d = new DiffTextWindowFrameData; + setAutoFillBackground(true); + d->m_pOptionDialog = pOptionDialog; + d->m_pTopLineWidget = new QWidget(this); + d->m_pFileSelection = new QLineEdit(d->m_pTopLineWidget); + d->m_pBrowseButton = new QPushButton( "...",d->m_pTopLineWidget ); + d->m_pBrowseButton->setFixedWidth( 30 ); + connect(d->m_pBrowseButton,SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked())); + connect(d->m_pFileSelection,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); + + d->m_pLabel = new QLabel("A:",d->m_pTopLineWidget); + 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); + pHL->setMargin(2); + pHL->setSpacing(2); + + pHL->addWidget( d->m_pLabel, 0 ); + pHL->addWidget( d->m_pFileSelection, 1 ); + pHL->addWidget( d->m_pBrowseButton, 0 ); + pHL->addWidget( d->m_pTopLine, 0 ); + + QVBoxLayout* pVL = new QVBoxLayout( this ); + pVL->setMargin(0); + pVL->setSpacing(0); + pVL->addWidget( d->m_pTopLineWidget, 0 ); + pVL->addWidget( d->m_pDiffTextWindow, 1 ); + + d->m_pDiffTextWindow->installEventFilter( this ); + d->m_pFileSelection->installEventFilter( this ); + d->m_pBrowseButton->installEventFilter( this ); + init(); +} + +DiffTextWindowFrame::~DiffTextWindowFrame() +{ + delete d; +} + +void DiffTextWindowFrame::init() +{ + DiffTextWindow* pDTW = d->m_pDiffTextWindow; + if ( pDTW ) + { + QString s = QDir::toNativeSeparators( pDTW->d->m_filename ); + d->m_pFileSelection->setText( s ); + QString winId = pDTW->d->m_winIdx==1 ? + ( pDTW->d->m_bTriple?"A (Base)":"A") : + ( pDTW->d->m_winIdx==2 ? "B" : "C" ); + d->m_pLabel->setText( winId + ":" ); + } +} + +// Search for the first visible line (search loop needed when no line exist for this file.) +int DiffTextWindow::calcTopLineInFile( int firstLine ) +{ + int l=-1; + for ( int i = convertLineToDiff3LineIdx(firstLine); i<(int)d->m_pDiff3LineVector->size(); ++i ) + { + const Diff3Line* d3l = (*d->m_pDiff3LineVector)[i]; + l = d3l->getLineInFile(d->m_winIdx); + if (l!=-1) break; + } + return l; +} + +void DiffTextWindowFrame::setFirstLine( int firstLine ) +{ + DiffTextWindow* pDTW = d->m_pDiffTextWindow; + if ( pDTW && pDTW->d->m_pDiff3LineVector ) + { + QString s= i18n("Top line"); + int lineNumberWidth = (int)log10((double)pDTW->d->m_size)+1; + + int l=pDTW->calcTopLineInFile(firstLine); + + int w = d->m_pTopLine->fontMetrics().width( + s+" "+QString().fill('0',lineNumberWidth)); + d->m_pTopLine->setMinimumWidth( w ); + + if (l==-1) + s = i18n("End"); + else + s += " " + QString::number( l+1 ); + + d->m_pTopLine->setText( s ); + d->m_pTopLine->repaint(); + } +} + +DiffTextWindow* DiffTextWindowFrame::getDiffTextWindow() +{ + return d->m_pDiffTextWindow; +} + +bool DiffTextWindowFrame::eventFilter( QObject* o, QEvent* e ) +{ + DiffTextWindow* pDTW = d->m_pDiffTextWindow; + if ( e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut ) + { + QColor c1 = d->m_pOptionDialog->m_bgColor; + QColor c2 = pDTW->d->m_cThis; + QPalette p = d->m_pTopLineWidget->palette(); + if ( e->type()==QEvent::FocusOut ) + std::swap(c1,c2); + + p.setColor(QPalette::Window, c2); + setPalette( p ); + + p.setColor(QPalette::WindowText, c1); + d->m_pLabel->setPalette( p ); + d->m_pTopLine->setPalette( p ); + } + if (o == d->m_pFileSelection && e->type()==QEvent::Drop) + { + QDropEvent* d = static_cast(e); + + if ( d->mimeData()->hasUrls() ) + { + QList lst = d->mimeData()->urls(); + + if ( lst.count() > 0 ) + { + static_cast(o)->setText( lst[0].toString() ); + static_cast(o)->setFocus(); + emit fileNameChanged( lst[0].toString(), pDTW->d->m_winIdx ); + return true; + } + } + } + return false; +} + +void DiffTextWindowFrame::slotReturnPressed() +{ + DiffTextWindow* pDTW = d->m_pDiffTextWindow; + if ( pDTW->d->m_filename != d->m_pFileSelection->text() ) + { + emit fileNameChanged( d->m_pFileSelection->text(), pDTW->d->m_winIdx ); + } +} + +void DiffTextWindowFrame::slotBrowseButtonClicked() +{ + QString current = d->m_pFileSelection->text(); + + KURL newURL = KFileDialog::getOpenURL( current, 0, this); + if ( !newURL.isEmpty() ) + { + DiffTextWindow* pDTW = d->m_pDiffTextWindow; + emit fileNameChanged( newURL.url(), pDTW->d->m_winIdx ); + } +} + +//#include "difftextwindow.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/difftextwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/difftextwindow.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,136 @@ +/*************************************************************************** + difftextwindow.h - description + ------------------- + begin : Mon Mar 18 2002 + copyright : (C) 2002-2005 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef DIFFTEXTWINDOW_H +#define DIFFTEXTWINDOW_H + +#include "diff.h" + +#include + +class QStatusBar; +class OptionDialog; +class DiffTextWindowData; +class DiffTextWindowFrame; + +class DiffTextWindow : public QWidget +{ + Q_OBJECT +public: + DiffTextWindow( + DiffTextWindowFrame* pParent, + QStatusBar* pStatusBar, + OptionDialog* pOptionDialog, + int winIdx + ); + ~DiffTextWindow(); + void init( + const QString& fileName, + const LineData* pLineData, + int size, + const Diff3LineVector* pDiff3LineVector, + const ManualDiffHelpList* pManualDiffHelpList, + bool bTriple + ); + void reset(); + void convertToLinePos( int x, int y, int& line, int& pos ); + + QString getSelection(); + int getFirstLine(); + int calcTopLineInFile( int firstLine ); + + int getNofColumns(); + int getNofLines(); + int getNofVisibleLines(); + int getNofVisibleColumns(); + + int convertLineToDiff3LineIdx( int line ); + int convertDiff3LineIdxToLine( int d3lIdx ); + + void convertD3LCoordsToLineCoords( int d3LIdx, int d3LPos, int& line, int& pos ); + void convertLineCoordsToD3LCoords( int line, int pos, int& d3LIdx, int& d3LPos ); + + void convertSelectionToD3LCoords(); + + bool findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); + void setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p ); + void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType ); + + void setPaintingAllowed( bool bAllowPainting ); + void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns ); + void print( MyPainter& painter, const QRect& r, int firstLine, int nofLinesPerPage ); +signals: + void resizeSignal( int nofVisibleColumns, int nofVisibleLines ); + void scroll( int deltaX, int deltaY ); + void newSelection(); + void selectionEnd(); + void setFastSelectorLine( int line ); + void gotFocus(); + void lineClicked( int winIdx, int line ); + +public slots: + void setFirstLine( int line ); + void setFirstColumn( int col ); + void resetSelection(); + void setFastSelectorRange( int line1, int nofLines ); + +protected: + virtual void mousePressEvent ( QMouseEvent * ); + virtual void mouseReleaseEvent ( QMouseEvent * ); + virtual void mouseMoveEvent ( QMouseEvent * ); + virtual void mouseDoubleClickEvent ( QMouseEvent * e ); + + virtual void paintEvent( QPaintEvent* ); + virtual void dragEnterEvent( QDragEnterEvent* e ); + virtual void focusInEvent( QFocusEvent* e ); + + virtual void resizeEvent( QResizeEvent* ); + virtual void timerEvent(QTimerEvent*); + +private: + DiffTextWindowData* d; + void showStatusLine( int line ); + friend class DiffTextWindowFrame; +}; + + +class DiffTextWindowFrameData; + +class DiffTextWindowFrame : public QWidget +{ + Q_OBJECT +public: + DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ); + ~DiffTextWindowFrame(); + DiffTextWindow* getDiffTextWindow(); + void init(); + void setFirstLine(int firstLine); +signals: + void fileNameChanged(const QString&, int); +protected: + bool eventFilter( QObject*, QEvent* ); + //void paintEvent(QPaintEvent*); +private slots: + void slotReturnPressed(); + void slotBrowseButtonClicked(); +private: + DiffTextWindowFrameData* d; +}; + + +#endif + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/directorymergewindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/directorymergewindow.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,3025 @@ +/*************************************************************************** + directorymergewindow.cpp + ----------------- + begin : Sat Oct 19 2002 + copyright : (C) 2002-2005 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "directorymergewindow.h" +#include "optiondialog.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include +#include +#include + +#include +#include +//#include + +static bool conflictingFileTypes(MergeFileInfos& mfi); +/* +class StatusInfo : public QListView +{ +public: + StatusInfo(QWidget* pParent) : QListView( pParent, "StatusInfo", Qt::WShowModal ) + { + addColumn(""); + setSorting(-1); //disable sorting + } + + QListViewItem* m_pLast; + QListViewItem* last() + { + if (firstChild()==0) return 0; + else return m_pLast; + } + + void addText(const QString& s ) + { + if (firstChild()==0) m_pLast = new QListViewItem( this, s ); + else m_pLast = new QListViewItem( this, last(), s ); + } +}; +*/ +class StatusInfo : public QTextEdit +{ +public: + StatusInfo(QWidget* pParent) : QTextEdit( pParent ) + { + setObjectName("StatusInfo"); + setWindowFlags(Qt::Dialog); + setWordWrapMode(QTextOption::NoWrap); + setReadOnly(true); + showMaximized(); + } + + bool isEmpty(){ + return toPlainText().isEmpty(); } + + void addText(const QString& s ) + { + append(s); + } + + void show() + { + moveCursor ( QTextCursor::End ); + ensureCursorVisible(); + + QTextEdit::show(); + } +}; + + +class TempRemover +{ +public: + TempRemover( const QString& origName, FileAccess& fa ); + ~TempRemover(); + QString name() { return m_name; } + bool success() { return m_bSuccess; } +private: + QString m_name; + bool m_bTemp; + bool m_bSuccess; +}; +TempRemover::TempRemover(const QString& origName, FileAccess& fa) +{ + if ( fa.isLocal() ) + { + m_name = origName; + m_bTemp = false; + m_bSuccess = true; + } + else + { + m_name = FileAccess::tempFileName(); + m_bSuccess = fa.copyFile( m_name ); + m_bTemp = m_bSuccess; + } +} +TempRemover::~TempRemover() +{ + if ( m_bTemp && ! m_name.isEmpty() ) + FileAccess::removeTempFile(m_name); +} + +void DirectoryMergeWindow::fastFileComparison( + FileAccess& fi1, FileAccess& fi2, + bool& bEqual, bool& bError, QString& status ) +{ + ProgressProxy pp; + status = ""; + bEqual = false; + bError = true; + + if ( !m_bFollowFileLinks ) + { + if ( fi1.isSymLink() != fi2.isSymLink() ) + { + status = i18n("Mix of links and normal files."); + return; + } + else if ( fi1.isSymLink() && fi2.isSymLink() ) + { + bError = false; + bEqual = fi1.readLink() == fi2.readLink(); + status = i18n("Link: "); + return; + } + } + + if ( fi1.size()!=fi2.size() ) + { + bEqual = false; + status = i18n("Size. "); + return; + } + else if ( m_pOptions->m_bDmTrustSize ) + { + bEqual = true; + return; + } + + if ( m_pOptions->m_bDmTrustDate ) + { + bEqual = ( fi1.lastModified() == fi2.lastModified() && fi1.size()==fi2.size() ); + bError = false; + status = i18n("Date & Size: "); + return; + } + + QString fileName1 = fi1.absFilePath(); + QString fileName2 = fi2.absFilePath(); + TempRemover tr1( fileName1, fi1 ); + if ( !tr1.success() ) + { + status = i18n("Creating temp copy of %1 failed.").arg(fileName1); + return; + } + TempRemover tr2( fileName2, fi2 ); + if ( !tr2.success() ) + { + status = i18n("Creating temp copy of %1 failed.").arg(fileName2); + return; + } + + std::vector buf1(100000); + std::vector buf2(buf1.size()); + + QFile file1( tr1.name() ); + + if ( ! file1.open(QIODevice::ReadOnly) ) + { + status = i18n("Opening %1 failed.").arg(fileName1); + return; + } + + QFile file2( tr2.name() ); + + if ( ! file2.open(QIODevice::ReadOnly) ) + { + status = i18n("Opening %1 failed.").arg(fileName2); + return; + } + + pp.setInformation( i18n("Comparing file..."), 0, false ); + typedef qint64 t_FileSize; + t_FileSize fullSize = file1.size(); + t_FileSize sizeLeft = fullSize; + + while( sizeLeft>0 && ! pp.wasCancelled() ) + { + int len = min2( sizeLeft, (t_FileSize)buf1.size() ); + if( len != file1.read( &buf1[0], len ) ) + { + status = i18n("Error reading from %1").arg(fileName1); + return; + } + + if( len != file2.read( &buf2[0], len ) ) + { + status = i18n("Error reading from %1").arg(fileName2); + return; + } + + if ( memcmp( &buf1[0], &buf2[0], len ) != 0 ) + { + bError = false; + return; + } + sizeLeft-=len; + pp.setCurrent(double(fullSize-sizeLeft)/fullSize, false ); + } + + // If the program really arrives here, then the files are really equal. + bError = false; + bEqual = true; +} + +static int s_NameCol = 0; +static int s_ACol = 1; +static int s_BCol = 2; +static int s_CCol = 3; +static int s_OpCol = 4; +static int s_OpStatusCol = 5; +static int s_UnsolvedCol = 6; // Nr of unsolved conflicts (for 3 input files) +static int s_SolvedCol = 7; // Nr of auto-solvable conflicts (for 3 input files) +static int s_NonWhiteCol = 8; // Nr of nonwhite deltas (for 2 input files) +static int s_WhiteCol = 9; // Nr of white deltas (for 2 input files) + +// Previously Q3ListViewItem::paintCell(p,cg,column,width,align); +class DirectoryMergeWindow::DirMergeItemDelegate : public QItemDelegate +{ + DirectoryMergeWindow* m_pDMW; +public: + DirMergeItemDelegate(DirectoryMergeWindow* pParent) + : QItemDelegate(pParent), m_pDMW(pParent) + { + } + void paint( QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index ) const + { + int column = index.column(); + if (column == s_ACol || column == s_BCol || column == s_CCol ) + { + QVariant value = index.data( Qt::DecorationRole ); + QPixmap icon; + if ( value.isValid() ) + { + if (value.type() == QVariant::Icon) + { + icon = qvariant_cast(value).pixmap(16,16); + //icon = qvariant_cast(value); + //decorationRect = QRect(QPoint(0, 0), icon.actualSize(option.decorationSize, iconMode, iconState)); + } + else + { + icon = qvariant_cast(value); + //decorationRect = QRect(QPoint(0, 0), option.decorationSize).intersected(pixmap.rect()); + } + } + + int x = option.rect.left(); + int y = option.rect.top(); + //QPixmap icon = value.value(); //pixmap(column); + if ( !icon.isNull() ) + { + int yOffset = (sizeHint(option,index).height() - icon.height()) / 2; + p->drawPixmap( x+2, y+yOffset, icon ); + + QTreeWidgetItem* pTWI = reinterpret_cast( index.internalPointer() ); + DirMergeItem* pDMI = static_cast(pTWI); + int i = pDMI==m_pDMW->m_pSelection1Item && column == m_pDMW->m_selection1Column ? 1 : + pDMI==m_pDMW->m_pSelection2Item && column == m_pDMW->m_selection2Column ? 2 : + pDMI==m_pDMW->m_pSelection3Item && column == m_pDMW->m_selection3Column ? 3 : + 0; + if ( i!=0 ) + { + OptionDialog* pOD = m_pDMW->m_pOptions; + QColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC ); + p->setPen( c );// highlight() ); + p->drawRect( x+2, y+yOffset, icon.width(), icon.height()); + p->setPen( QPen( c, 0, Qt::DotLine) ); + p->drawRect( x+1, y+yOffset-1, icon.width()+2, icon.height()+2); + p->setPen( Qt::white ); + QString s( QChar('A'+i-1) ); + p->drawText( x+2 + (icon.width() - p->fontMetrics().width(s))/2, + y+yOffset + (icon.height() + p->fontMetrics().ascent())/2-1, + s ); + } + else + { + p->setPen( m_pDMW->palette().background().color() ); + p->drawRect( x+1, y+yOffset-1, icon.width()+2, icon.height()+2); + } + return; + } + } + QStyleOptionViewItem option2 = option; + if ( column>=s_UnsolvedCol ) + { + option2.displayAlignment = Qt::AlignRight; + } + QItemDelegate::paint( p, option2, index ); + } +}; + + +DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ) + : QTreeWidget( pParent ) +{ + setItemDelegate( new DirMergeItemDelegate(this) ); + connect( this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(onDoubleClick(QTreeWidgetItem*))); + connect( this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(onCurrentChanged(QTreeWidgetItem*))); + connect( this, SIGNAL(expanded(const QModelIndex&)), this, SLOT(onExpanded())); + m_pOptions = pOptions; + m_pIconLoader = pIconLoader; + m_pDirectoryMergeInfo = 0; + m_bAllowResizeEvents = true; + m_bSimulatedMergeStarted=false; + m_bRealMergeStarted=false; + m_bError = false; + m_bSyncMode = false; + m_pStatusInfo = new StatusInfo(0); + m_pStatusInfo->hide(); + m_bScanning = false; + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + m_bCaseSensitive = true; + + QStringList sl; + sl << i18n("Name") << "A" << "B" << "C" << i18n("Operation") << i18n("Status") + << i18n("Unsolved") << i18n("Solved") << i18n("Nonwhite") << i18n("White") << ""; + setHeaderLabels(sl); + + //TODO setColumnAlignment( s_UnsolvedCol, Qt::AlignRight ); + //setColumnAlignment( s_SolvedCol, Qt::AlignRight ); + //setColumnAlignment( s_NonWhiteCol, Qt::AlignRight ); + //setColumnAlignment( s_WhiteCol, Qt::AlignRight ); +} + +DirectoryMergeWindow::~DirectoryMergeWindow() +{ +} + + +int DirectoryMergeWindow::totalColumnWidth() +{ + int w=0; + for (int i=0; itoImage().convertToFormat(QImage::Format_ARGB32); + QImage img2 = pm2->toImage().convertToFormat(QImage::Format_ARGB32); + + for (int y = 0; y < img1.height(); y++) + { + quint32 *line1 = reinterpret_cast(img1.scanLine(y)); + quint32 *line2 = reinterpret_cast(img2.scanLine(y)); + for (int x = 0; x < img1.width(); x++) + { + if ( qAlpha( line2[x] ) >0 ) + line1[x] = (line2[x] | 0xff000000); + } + } + return QPixmap::fromImage(img1); +} + +// like pixCombiner but let the pm1 color shine through +static QPixmap pixCombiner2( const QPixmap* pm1, const QPixmap* pm2 ) +{ + QPixmap pix=*pm1; + QPainter p(&pix); + p.setOpacity(0.5); + p.drawPixmap( 0,0,*pm2 ); + p.end(); + + return pix; +} + +static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles, + int& nofDirs, int& nofEqualFiles, int& nofManualMerges ) +{ + if ( i->m_pMFI->m_bDirA || i->m_pMFI->m_bDirB || i->m_pMFI->m_bDirC ) + { + ++nofDirs; + } + else + { + ++nofFiles; + if ( i->m_pMFI->m_bEqualAB && (!bThreeDirs || i->m_pMFI->m_bEqualAC )) + { + ++nofEqualFiles; + } + else + { + if ( i->m_pMFI->m_eMergeOperation==eMergeABCToDest || i->m_pMFI->m_eMergeOperation==eMergeABToDest ) + ++nofManualMerges; + } + } + for( int childIdx=0; childIdxchildCount(); ++childIdx ) + calcDirStatus( bThreeDirs, static_cast(i->child(childIdx)), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); +} + +static QString sortString(const QString& s, bool bCaseSensitive) +{ + if (bCaseSensitive) + return s; + else + return s.toUpper(); +} + +bool DirectoryMergeWindow::init + ( + FileAccess& dirA, + FileAccess& dirB, + FileAccess& dirC, + FileAccess& dirDest, + bool bDirectoryMerge + ) +{ + if ( m_pOptions->m_bDmFullAnalysis ) + { + // 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; + m_bFollowDirLinks = m_pOptions->m_bDmFollowDirLinks; + m_bFollowFileLinks = m_pOptions->m_bDmFollowFileLinks; + m_bSimulatedMergeStarted=false; + m_bRealMergeStarted=false; + m_bError=false; + m_bDirectoryMerge = bDirectoryMerge; + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + m_bCaseSensitive = m_pOptions->m_bDmCaseSensitiveFilenameComparison; + + clear(); + + m_mergeItemList.clear(); + m_currentItemForOperation = m_mergeItemList.end(); + + m_dirA = dirA; + m_dirB = dirB; + m_dirC = dirC; + m_dirDest = dirDest; + + m_pDirShowIdenticalFiles->setChecked(true); + m_pDirShowDifferentFiles->setChecked(true); + m_pDirShowFilesOnlyInA->setChecked(true); + m_pDirShowFilesOnlyInB->setChecked(true); + m_pDirShowFilesOnlyInC->setChecked(true); + + // Check if all input directories exist and are valid. The dest dir is not tested now. + // The test will happen only when we are going to write to it. + if ( !m_dirA.isDir() || !m_dirB.isDir() || + (m_dirC.isValid() && !m_dirC.isDir()) ) + { + QString text( i18n("Opening of directories failed:") ); + text += "\n\n"; + if ( !dirA.isDir() ) + { text += i18n("Dir A \"%1\" does not exist or is not a directory.\n").arg(m_dirA.prettyAbsPath()); } + + if ( !dirB.isDir() ) + { text += i18n("Dir B \"%1\" does not exist or is not a directory.\n").arg(m_dirB.prettyAbsPath()); } + + if ( m_dirC.isValid() && !m_dirC.isDir() ) + { text += i18n("Dir C \"%1\" does not exist or is not a directory.\n").arg(m_dirC.prettyAbsPath()); } + + KMessageBox::sorry( this, text, i18n("Directory Open Error") ); + return false; + } + + if ( m_dirC.isValid() && + (m_dirDest.prettyAbsPath() == m_dirA.prettyAbsPath() || m_dirDest.prettyAbsPath()==m_dirB.prettyAbsPath() ) ) + { + KMessageBox::error(this, + i18n( "The destination directory must not be the same as A or B when " + "three directories are merged.\nCheck again before continuing."), + i18n("Parameter Warning")); + return false; + } + + m_bScanning = true; + statusBarMessage(i18n("Scanning directories...")); + + m_bSyncMode = m_pOptions->m_bDmSyncMode && !m_dirC.isValid() && !m_dirDest.isValid(); + + if ( m_dirDest.isValid() ) + m_dirDestInternal = m_dirDest; + else + m_dirDestInternal = m_dirC.isValid() ? m_dirC : m_dirB; + + QString origCurrentDirectory = QDir::currentPath(); + + m_fileMergeMap.clear(); + t_DirectoryList::iterator i; + + // calc how many directories will be read: + double nofScans = ( m_dirA.isValid() ? 1 : 0 )+( m_dirB.isValid() ? 1 : 0 )+( m_dirC.isValid() ? 1 : 0 ); + int currentScan = 0; + +//TODO setColumnWidthMode(s_UnsolvedCol, Q3ListView::Manual); +// setColumnWidthMode(s_SolvedCol, Q3ListView::Manual); +// setColumnWidthMode(s_WhiteCol, Q3ListView::Manual); +// setColumnWidthMode(s_NonWhiteCol, Q3ListView::Manual); + setColumnHidden( s_CCol, !m_dirC.isValid() ); + setColumnHidden( s_WhiteCol, !m_pOptions->m_bDmFullAnalysis ); + setColumnHidden( s_NonWhiteCol, !m_pOptions->m_bDmFullAnalysis ); + setColumnHidden( s_UnsolvedCol, !m_pOptions->m_bDmFullAnalysis ); + setColumnHidden( s_SolvedCol, !( m_pOptions->m_bDmFullAnalysis && m_dirC.isValid() ) ); + + bool bListDirSuccessA = true; + bool bListDirSuccessB = true; + bool bListDirSuccessC = true; + if ( m_dirA.isValid() ) + { + pp.setInformation(i18n("Reading Directory A")); + pp.setSubRangeTransformation(currentScan/nofScans, (currentScan+1)/nofScans); + ++currentScan; + + t_DirectoryList dirListA; + bListDirSuccessA = m_dirA.listDir( &dirListA, + m_pOptions->m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, + m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, + m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, + m_pOptions->m_bDmUseCvsIgnore); + + for (i=dirListA.begin(); i!=dirListA.end();++i ) + { + MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(), m_bCaseSensitive)]; + //std::cout <filePath()<m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, + m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, + m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, + m_pOptions->m_bDmUseCvsIgnore); + + for (i=dirListB.begin(); i!=dirListB.end();++i ) + { + MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(), m_bCaseSensitive)]; + mfi.m_bExistsInB = true; + mfi.m_fileInfoB = *i; + } + } + + e_MergeOperation eDefaultMergeOp; + if ( m_dirC.isValid() ) + { + pp.setInformation(i18n("Reading Directory C")); + pp.setSubRangeTransformation(currentScan/nofScans, (currentScan+1)/nofScans); + ++currentScan; + + t_DirectoryList dirListC; + bListDirSuccessC = m_dirC.listDir( &dirListC, + m_pOptions->m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, + m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, + m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, + m_pOptions->m_bDmUseCvsIgnore); + + for (i=dirListC.begin(); i!=dirListC.end();++i ) + { + MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(),m_bCaseSensitive)]; + mfi.m_bExistsInC = true; + mfi.m_fileInfoC = *i; + } + + eDefaultMergeOp = eMergeABCToDest; + } + else + eDefaultMergeOp = m_bSyncMode ? eMergeToAB : eMergeABToDest; + + bool bContinue = true; + if ( !bListDirSuccessA || !bListDirSuccessB || !bListDirSuccessC ) + { + QString s = i18n("Some subdirectories were not readable in"); + if ( !bListDirSuccessA ) s += "\nA: " + m_dirA.prettyAbsPath(); + if ( !bListDirSuccessB ) s += "\nB: " + m_dirB.prettyAbsPath(); + if ( !bListDirSuccessC ) s += "\nC: " + m_dirC.prettyAbsPath(); + s+="\n"; + s+= i18n("Check the permissions of the subdirectories."); + bContinue = KMessageBox::Continue == KMessageBox::warningContinueCancel( this, s ); + } + + if ( bContinue ) + { + prepareListView(pp); + + for( int childIdx = 0; childIdxnextSibling() ) + { + DirMergeItem* pDMI = static_cast( topLevelItem(childIdx) ); + calcSuggestedOperation( *pDMI->m_pMFI, eDefaultMergeOp ); + } + } + //else + //{ + // setSelected( 0, true ); + //} + + for (int i=0;i(pParent); + if (pSplitter!=0) + { + QList sizes = pSplitter->sizes(); + int total = sizes[0] + sizes[1]; + sizes[0]=total*6/10; + sizes[1]=total - sizes[0]; + pSplitter->setSizes( sizes ); + } + + sortItems(0,Qt::AscendingOrder); + + m_bScanning = false; + statusBarMessage(i18n("Ready.")); + + if ( bContinue ) + { + // Generate a status report + int nofFiles=0; + int nofDirs=0; + int nofEqualFiles=0; + int nofManualMerges=0; + for( int childIdx = 0; childIdx(topLevelItem(childIdx)), + nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); + + QString s; + s = i18n("Directory Comparison Status") + "\n\n" + + i18n("Number of subdirectories:") +" "+ QString::number(nofDirs) + "\n"+ + i18n("Number of equal files:") +" "+ QString::number(nofEqualFiles) + "\n"+ + i18n("Number of different files:") +" "+ QString::number(nofFiles-nofEqualFiles); + + if ( m_dirC.isValid() ) + s += "\n" + i18n("Number of manual merges:") +" "+ QString::number(nofManualMerges); + KMessageBox::information( this, s ); + if ( topLevelItemCount()>0 ) + topLevelItem(0)->setSelected(true); + } + + return true; +} + +void DirectoryMergeWindow::onExpanded() +{ + resizeColumnToContents(s_NameCol); +} + + +void DirectoryMergeWindow::slotChooseAEverywhere(){ setAllMergeOperations( eCopyAToDest ); } + +void DirectoryMergeWindow::slotChooseBEverywhere(){ setAllMergeOperations( eCopyBToDest ); } + +void DirectoryMergeWindow::slotChooseCEverywhere(){ setAllMergeOperations( eCopyCToDest ); } + +void DirectoryMergeWindow::slotAutoChooseEverywhere() +{ + e_MergeOperation eDefaultMergeOp = m_dirC.isValid() ? eMergeABCToDest : + m_bSyncMode ? eMergeToAB : eMergeABToDest; + setAllMergeOperations(eDefaultMergeOp ); +} + +void DirectoryMergeWindow::slotNoOpEverywhere(){ setAllMergeOperations(eNoOperation); } + +static void setListViewItemOpen( QTreeWidgetItem* p, bool bOpen ) +{ + if ( p->childCount() > 0 ) + { + for( int childIdx=0; childIdxchildCount(); ++childIdx ) + setListViewItemOpen( p->child(childIdx), bOpen ); + + p->setExpanded( bOpen ); + } +} + +void DirectoryMergeWindow::slotFoldAllSubdirs() +{ + for( int i=0; i(pLVI); + MergeFileInfos& mfi = *pDMI->m_pMFI; + + mfi.setMergeOperation(eMergeOp ); +} + +// Merge current item (merge mode) +void DirectoryMergeWindow::slotCurrentDoNothing() { setMergeOperation(currentItem(), eNoOperation ); } +void DirectoryMergeWindow::slotCurrentChooseA() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyAToB : eCopyAToDest ); } +void DirectoryMergeWindow::slotCurrentChooseB() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyBToA : eCopyBToDest ); } +void DirectoryMergeWindow::slotCurrentChooseC() { setMergeOperation(currentItem(), eCopyCToDest ); } +void DirectoryMergeWindow::slotCurrentMerge() +{ + bool bThreeDirs = m_dirC.isValid(); + setMergeOperation(currentItem(), bThreeDirs ? eMergeABCToDest : eMergeABToDest ); +} +void DirectoryMergeWindow::slotCurrentDelete() { setMergeOperation(currentItem(), eDeleteFromDest ); } +// Sync current item +void DirectoryMergeWindow::slotCurrentCopyAToB() { setMergeOperation(currentItem(), eCopyAToB ); } +void DirectoryMergeWindow::slotCurrentCopyBToA() { setMergeOperation(currentItem(), eCopyBToA ); } +void DirectoryMergeWindow::slotCurrentDeleteA() { setMergeOperation(currentItem(), eDeleteA ); } +void DirectoryMergeWindow::slotCurrentDeleteB() { setMergeOperation(currentItem(), eDeleteB ); } +void DirectoryMergeWindow::slotCurrentDeleteAAndB() { setMergeOperation(currentItem(), eDeleteAB ); } +void DirectoryMergeWindow::slotCurrentMergeToA() { setMergeOperation(currentItem(), eMergeToA ); } +void DirectoryMergeWindow::slotCurrentMergeToB() { setMergeOperation(currentItem(), eMergeToB ); } +void DirectoryMergeWindow::slotCurrentMergeToAAndB() { setMergeOperation(currentItem(), eMergeToAB ); } + + +void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e ) +{ + if ( (e->QInputEvent::modifiers() & Qt::ControlModifier)!=0 ) + { + bool bThreeDirs = m_dirC.isValid(); + + QTreeWidgetItem* lvi = currentItem(); + DirMergeItem* pDMI = lvi==0 ? 0 : static_cast(lvi); + MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; + + if ( pMFI==0 ) return; + bool bMergeMode = bThreeDirs || !m_bSyncMode; + bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI); + + if ( bMergeMode ) + { + switch(e->key()) + { + 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; + } + } + else + { + switch(e->key()) + { + 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; + default: break; + } + } + } + else if ( e->key()==Qt::Key_Return || e->key()==Qt::Key_Enter ) + { + onDoubleClick( currentItem() ); + return; + } + + QTreeWidget::keyPressEvent(e); +} + +void DirectoryMergeWindow::focusInEvent(QFocusEvent*) +{ + updateAvailabilities(); +} +void DirectoryMergeWindow::focusOutEvent(QFocusEvent*) +{ + updateAvailabilities(); +} + +void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOperation ) +{ + if ( KMessageBox::Yes == KMessageBox::warningYesNo(this, + i18n("This affects all merge operations."), + i18n("Changing All Merge Operations"),i18n("C&ontinue"), i18n("&Cancel") ) ) + { + for( int i=0; i( topLevelItem(i) ); + calcSuggestedOperation( *pDMI->m_pMFI, eDefaultOperation ); + } + } +} + + +void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) +{ + std::map dateMap; + + if( mfi.m_bExistsInA ) + { + mfi.m_bLinkA = mfi.m_fileInfoA.isSymLink(); + mfi.m_bDirA = mfi.m_fileInfoA.isDir(); + dateMap[ mfi.m_fileInfoA.lastModified() ] = 0; + } + if( mfi.m_bExistsInB ) + { + mfi.m_bLinkB = mfi.m_fileInfoB.isSymLink(); + mfi.m_bDirB = mfi.m_fileInfoB.isDir(); + dateMap[ mfi.m_fileInfoB.lastModified() ] = 1; + } + if( mfi.m_bExistsInC ) + { + mfi.m_bLinkC = mfi.m_fileInfoC.isSymLink(); + mfi.m_bDirC = mfi.m_fileInfoC.isDir(); + dateMap[ mfi.m_fileInfoC.lastModified() ] = 2; + } + + if ( m_pOptions->m_bDmFullAnalysis ) + { + if( mfi.m_bExistsInA && mfi.m_bDirA || mfi.m_bExistsInB && mfi.m_bDirB || mfi.m_bExistsInC && mfi.m_bDirC ) + { + // If any input is a directory, don't start any comparison. + mfi.m_bEqualAB=mfi.m_bExistsInA && mfi.m_bExistsInB; + mfi.m_bEqualAC=mfi.m_bExistsInA && mfi.m_bExistsInC; + mfi.m_bEqualBC=mfi.m_bExistsInB && mfi.m_bExistsInC; + } + else + { + emit startDiffMerge( + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + "", + "","","",&mfi.m_totalDiffStatus + ); + 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 ) + { + if( mfi.m_bDirA ) mfi.m_bEqualAB=true; + else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoB, mfi.m_bEqualAB, bError, eqStatus ); + } + if( mfi.m_bExistsInA && mfi.m_bExistsInC ) + { + if( mfi.m_bDirA ) mfi.m_bEqualAC=true; + else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoC, mfi.m_bEqualAC, bError, eqStatus ); + } + if( mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + if (mfi.m_bEqualAB && mfi.m_bEqualAC) + mfi.m_bEqualBC = true; + else + { + if( mfi.m_bDirB ) mfi.m_bEqualBC=true; + else fastFileComparison( mfi.m_fileInfoB, mfi.m_fileInfoC, mfi.m_bEqualBC, bError, eqStatus ); + } + } + } + + if (mfi.m_bLinkA!=mfi.m_bLinkB) mfi.m_bEqualAB=false; + if (mfi.m_bLinkA!=mfi.m_bLinkC) mfi.m_bEqualAC=false; + if (mfi.m_bLinkB!=mfi.m_bLinkC) mfi.m_bEqualBC=false; + + if (mfi.m_bDirA!=mfi.m_bDirB) mfi.m_bEqualAB=false; + if (mfi.m_bDirA!=mfi.m_bDirC) mfi.m_bEqualAC=false; + if (mfi.m_bDirB!=mfi.m_bDirC) mfi.m_bEqualBC=false; + + assert(eNew==0 && eMiddle==1 && eOld==2); + + // The map automatically sorts the keys. + int age = eNew; + std::map::reverse_iterator i; + for( i=dateMap.rbegin(); i!=dateMap.rend(); ++i ) + { + int n = i->second; + if ( n==0 && mfi.m_ageA==eNotThere ) + { + mfi.m_ageA = (e_Age)age; ++age; + if ( mfi.m_bEqualAB ) { mfi.m_ageB = mfi.m_ageA; ++age; } + if ( mfi.m_bEqualAC ) { mfi.m_ageC = mfi.m_ageA; ++age; } + } + else if ( n==1 && mfi.m_ageB==eNotThere ) + { + mfi.m_ageB = (e_Age)age; ++age; + if ( mfi.m_bEqualAB ) { mfi.m_ageA = mfi.m_ageB; ++age; } + if ( mfi.m_bEqualBC ) { mfi.m_ageC = mfi.m_ageB; ++age; } + } + else if ( n==2 && mfi.m_ageC==eNotThere) + { + mfi.m_ageC = (e_Age)age; ++age; + if ( mfi.m_bEqualAC ) { mfi.m_ageA = mfi.m_ageC; ++age; } + if ( mfi.m_bEqualBC ) { mfi.m_ageB = mfi.m_ageC; ++age; } + } + } + + // The checks below are necessary when the dates of the file are equal but the + // files are not. One wouldn't expect this to happen, yet it happens sometimes. + if ( mfi.m_bExistsInC && mfi.m_ageC==eNotThere ) + { + mfi.m_ageC = (e_Age)age; ++age; + mfi.m_bConflictingAges = true; + } + if ( mfi.m_bExistsInB && mfi.m_ageB==eNotThere ) + { + mfi.m_ageB = (e_Age)age; ++age; + mfi.m_bConflictingAges = true; + } + if ( mfi.m_bExistsInA && mfi.m_ageA==eNotThere ) + { + mfi.m_ageA = (e_Age)age; ++age; + mfi.m_bConflictingAges = true; + } + + if ( mfi.m_ageA != eOld && mfi.m_ageB != eOld && mfi.m_ageC != eOld ) + { + if (mfi.m_ageA == eMiddle) mfi.m_ageA = eOld; + if (mfi.m_ageB == eMiddle) mfi.m_ageB = eOld; + if (mfi.m_ageC == eMiddle) mfi.m_ageC = eOld; + } +} + +static QPixmap* s_pm_dir; +static QPixmap* s_pm_file; + +static QPixmap* pmNotThere; +static QPixmap* pmNew; +static QPixmap* pmOld; +static QPixmap* pmMiddle; + +static QPixmap* pmLink; + +static QPixmap* pmDirLink; +static QPixmap* pmFileLink; + +static QPixmap* pmNewLink; +static QPixmap* pmOldLink; +static QPixmap* pmMiddleLink; + +static QPixmap* pmNewDir; +static QPixmap* pmMiddleDir; +static QPixmap* pmOldDir; + +static QPixmap* pmNewDirLink; +static QPixmap* pmMiddleDirLink; +static QPixmap* pmOldDirLink; + + +static QPixmap colorToPixmap(QColor c) +{ + QPixmap pm(16,16); + QPainter p(&pm); + p.setPen( Qt::black ); + p.setBrush( c ); + p.drawRect(0,0,pm.width(),pm.height()); + return pm; +} + +static void initPixmaps( QColor newest, QColor oldest, QColor middle, QColor notThere ) +{ + if (pmNew==0) + { + pmNotThere = new QPixmap; + pmNew = new QPixmap; + pmOld = new QPixmap; + pmMiddle = new QPixmap; + + #include "xpm/link_arrow.xpm" + pmLink = new QPixmap(link_arrow); + + pmDirLink = new QPixmap; + pmFileLink = new QPixmap; + + pmNewLink = new QPixmap; + pmOldLink = new QPixmap; + pmMiddleLink = new QPixmap; + + pmNewDir = new QPixmap; + pmMiddleDir = new QPixmap; + pmOldDir = new QPixmap; + + pmNewDirLink = new QPixmap; + pmMiddleDirLink = new QPixmap; + pmOldDirLink = new QPixmap; + } + + + *pmNotThere = colorToPixmap(notThere); + *pmNew = colorToPixmap(newest); + *pmOld = colorToPixmap(oldest); + *pmMiddle = colorToPixmap(middle); + + *pmDirLink = pixCombiner( s_pm_dir, pmLink); + *pmFileLink = pixCombiner( s_pm_file, pmLink ); + + *pmNewLink = pixCombiner( pmNew, pmLink); + *pmOldLink = pixCombiner( pmOld, pmLink); + *pmMiddleLink = pixCombiner( pmMiddle, pmLink); + + *pmNewDir = pixCombiner2( pmNew, s_pm_dir); + *pmMiddleDir = pixCombiner2( pmMiddle, s_pm_dir); + *pmOldDir = pixCombiner2( pmOld, s_pm_dir); + + *pmNewDirLink = pixCombiner( pmNewDir, pmLink); + *pmMiddleDirLink = pixCombiner( pmMiddleDir, pmLink); + *pmOldDirLink = pixCombiner( pmOldDir, pmLink); +} + + +static void setOnePixmap( QTreeWidgetItem* pLVI, int col, e_Age eAge, bool bLink, bool bDir ) +{ + static QPixmap* ageToPm[]= { pmNew, pmMiddle, pmOld, pmNotThere, s_pm_file }; + static QPixmap* ageToPmLink[]= { pmNewLink, pmMiddleLink, pmOldLink, pmNotThere, pmFileLink }; + static QPixmap* ageToPmDir[]= { pmNewDir, pmMiddleDir, pmOldDir, pmNotThere, s_pm_dir }; + static QPixmap* ageToPmDirLink[]={ pmNewDirLink, pmMiddleDirLink, pmOldDirLink, pmNotThere, pmDirLink }; + + QPixmap** ppPm = bDir ? ( bLink ? ageToPmDirLink : ageToPmDir ): + ( bLink ? ageToPmLink : ageToPm ); + + pLVI->setIcon( col, *ppPm[eAge] ); +} + +static void setPixmaps( MergeFileInfos& mfi, bool bCheckC ) +{ + setOnePixmap( mfi.m_pDMI, s_NameCol, eAgeEnd, + mfi.m_bLinkA || mfi.m_bLinkB || mfi.m_bLinkC, + mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC + ); + + if ( mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC ) + { + mfi.m_ageA=eNotThere; + mfi.m_ageB=eNotThere; + mfi.m_ageC=eNotThere; + int age = eNew; + if ( mfi.m_bExistsInC ) + { + mfi.m_ageC = (e_Age)age; + if (mfi.m_bEqualAC) mfi.m_ageA = (e_Age)age; + if (mfi.m_bEqualBC) mfi.m_ageB = (e_Age)age; + ++age; + } + if ( mfi.m_bExistsInB && mfi.m_ageB==eNotThere ) + { + mfi.m_ageB = (e_Age)age; + if (mfi.m_bEqualAB) mfi.m_ageA = (e_Age)age; + ++age; + } + if ( mfi.m_bExistsInA && mfi.m_ageA==eNotThere ) + { + mfi.m_ageA = (e_Age)age; + } + if ( mfi.m_ageA != eOld && mfi.m_ageB != eOld && mfi.m_ageC != eOld ) + { + if (mfi.m_ageA == eMiddle) mfi.m_ageA = eOld; + if (mfi.m_ageB == eMiddle) mfi.m_ageB = eOld; + if (mfi.m_ageC == eMiddle) mfi.m_ageC = eOld; + } + } + + setOnePixmap( mfi.m_pDMI, s_ACol, mfi.m_ageA, mfi.m_bLinkA, mfi.m_bDirA ); + setOnePixmap( mfi.m_pDMI, s_BCol, mfi.m_ageB, mfi.m_bLinkB, mfi.m_bDirB ); + if ( bCheckC ) + setOnePixmap( mfi.m_pDMI, s_CCol, mfi.m_ageC, mfi.m_bLinkC, mfi.m_bDirC ); +} + +static QTreeWidgetItem* nextSibling(const QTreeWidgetItem* p) +{ + QTreeWidgetItem* pParent = p->parent(); + if ( pParent ) + { + int currentIdx = pParent->indexOfChild( const_cast(p) ); + if ( currentIdx+1 < pParent->childCount() ) + return pParent->child(currentIdx+1); + } + else + { + QTreeWidget* pParentTreeWidget = p->treeWidget(); + if ( pParentTreeWidget ) + { + int currentIdx = pParentTreeWidget->indexOfTopLevelItem( const_cast(p) ); + if ( currentIdx+1 < pParentTreeWidget->topLevelItemCount() ) + return pParentTreeWidget->topLevelItem(currentIdx+1); + } + } + return 0; +} + +// Iterate through the complete tree. Start by specifying QListView::firstChild(). +static QTreeWidgetItem* treeIterator( QTreeWidgetItem* p, bool bVisitChildren=true, bool bFindInvisible=false ) +{ + if( p!=0 ) + { + do + { + if ( bVisitChildren && p->childCount() != 0 ) p = p->child(0); + else + { + QTreeWidgetItem* pNextSibling = nextSibling(p); + if ( pNextSibling ) + p = pNextSibling; + else + { + p = p->parent(); + while ( p!=0 ) + { + QTreeWidgetItem* pNextSibling = nextSibling(p); + if( pNextSibling ) { p = pNextSibling; break; } + else { p = p->parent(); } + } + } + } + } + while( p && p->isHidden() && !bFindInvisible ); + } + return p; +} + +void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) +{ + static bool bFirstTime = true; + if (bFirstTime) + { + #include "xpm/file.xpm" + #include "xpm/folder.xpm" + s_pm_dir = new QPixmap( m_pIconLoader->loadIcon("folder", KIcon::Small ) ); + if (s_pm_dir->size()!=QSize(16,16)) + { + delete s_pm_dir; + s_pm_dir = new QPixmap( folder_pm ); + } + s_pm_file= new QPixmap( file_pm ); + bFirstTime=false; + } + + clear(); + initPixmaps( m_pOptions->m_newestFileColor, m_pOptions->m_oldestFileColor, + m_pOptions->m_midAgeFileColor, m_pOptions->m_missingFileColor ); + + setRootIsDecorated( true ); + + bool bCheckC = m_dirC.isValid(); + + std::map::iterator j; + int nrOfFiles = m_fileMergeMap.size(); + int currentIdx = 1; + QTime t; + t.start(); + for( j=m_fileMergeMap.begin(); j!=m_fileMergeMap.end(); ++j ) + { + MergeFileInfos& mfi = j->second; + + mfi.m_subPath = mfi.m_fileInfoA.exists() ? mfi.m_fileInfoA.filePath() : + mfi.m_fileInfoB.exists() ? mfi.m_fileInfoB.filePath() : + mfi.m_fileInfoC.exists() ? mfi.m_fileInfoC.filePath() : + QString(""); + + // const QString& fileName = j->first; + const QString& fileName = mfi.m_subPath; + + pp.setInformation( + i18n("Processing ") + QString::number(currentIdx) +" / "+ QString::number(nrOfFiles) + +"\n" + fileName, double(currentIdx) / nrOfFiles, false ); + if ( pp.wasCancelled() ) break; + ++currentIdx; + + + // The comparisons and calculations for each file take place here. + compareFilesAndCalcAges( mfi ); + + bool bEqual = bCheckC ? mfi.m_bEqualAB && mfi.m_bEqualAC : mfi.m_bEqualAB; + //bool bDir = mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC; + + //if ( m_pOptions->m_bDmShowOnlyDeltas && !bDir && bEqual ) + // continue; + + // Get dirname from fileName: Search for "/" from end: + int pos = fileName.lastIndexOf('/'); + QString dirPart; + QString filePart; + if (pos==-1) + { + // Top dir + filePart = fileName; + } + else + { + dirPart = fileName.left(pos); + filePart = fileName.mid(pos+1); + } + + if ( dirPart.isEmpty() ) // Top level + { + new DirMergeItem( this, filePart, &mfi ); + } + else + { + MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // parent + assert(dirMfi.m_pDMI!=0); + new DirMergeItem( dirMfi.m_pDMI, filePart, &mfi ); + mfi.m_pParent = &dirMfi; + + if ( !bEqual ) // Set all parents to "not equal" + { + MergeFileInfos* p = mfi.m_pParent; + while(p!=0) + { + bool bChange = false; + if ( !mfi.m_bEqualAB && p->m_bEqualAB ){ p->m_bEqualAB = false; bChange=true; } + if ( !mfi.m_bEqualAC && p->m_bEqualAC ){ p->m_bEqualAC = false; bChange=true; } + if ( !mfi.m_bEqualBC && p->m_bEqualBC ){ p->m_bEqualBC = false; bChange=true; } + + if ( bChange ) + setPixmaps( *p, bCheckC ); + else + break; + + p = p->m_pParent; + } + } + } + + setPixmaps( mfi, bCheckC ); + } + + /*if ( m_pOptions->m_bDmShowOnlyDeltas ) + { + // Remove all equals. (Search tree depth first) + QListViewItem* p = firstChild(); + while( p!=0 && firstChild() != 0 ) + { + QListViewItem* pParent = p->parent(); + QListViewItem* pNextSibling = p->nextSibling(); + + DirMergeItem* pDMI = static_cast(p); + bool bDirEqual = bCheckC ? pDMI->m_pMFI->m_bEqualAB && pDMI->m_pMFI->m_bEqualAC + : pDMI->m_pMFI->m_bEqualAB; + if ( pDMI!=0 && pDMI->m_pMFI->m_bDirA && bDirEqual ) + { + delete p; + p=0; + } + + if ( p!=0 && p->firstChild() != 0 ) p = p->firstChild(); + else if ( pNextSibling!=0 ) p = pNextSibling; + else + { + p=pParent; + while ( p!=0 ) + { + if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; } + else { p = p->parent(); } + } + } + } + }*/ +} + +static bool conflictingFileTypes(MergeFileInfos& mfi) +{ + // Now check if file/dir-types fit. + if ( mfi.m_bLinkA || mfi.m_bLinkB || mfi.m_bLinkC ) + { + if ( mfi.m_bExistsInA && ! mfi.m_bLinkA || + mfi.m_bExistsInB && ! mfi.m_bLinkB || + mfi.m_bExistsInC && ! mfi.m_bLinkC ) + { + return true; + } + } + + if ( mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC ) + { + if ( mfi.m_bExistsInA && ! mfi.m_bDirA || + mfi.m_bExistsInB && ! mfi.m_bDirB || + mfi.m_bExistsInC && ! mfi.m_bDirC ) + { + return true; + } + } + return false; +} + +void DirectoryMergeWindow::calcSuggestedOperation( MergeFileInfos& mfi, e_MergeOperation eDefaultMergeOp ) +{ + bool bCheckC = m_dirC.isValid(); + bool bCopyNewer = m_pOptions->m_bDmCopyNewer; + bool bOtherDest = !( m_dirDestInternal.absFilePath() == m_dirA.absFilePath() || + m_dirDestInternal.absFilePath() == m_dirB.absFilePath() || + bCheckC && m_dirDestInternal.absFilePath() == m_dirC.absFilePath() ); + + + if ( eDefaultMergeOp == eMergeABCToDest && !bCheckC ) { eDefaultMergeOp = eMergeABToDest; } + if ( eDefaultMergeOp == eMergeToAB && bCheckC ) { assert(false); } + + if ( eDefaultMergeOp == eMergeToA || eDefaultMergeOp == eMergeToB || + eDefaultMergeOp == eMergeABCToDest || eDefaultMergeOp == eMergeABToDest || eDefaultMergeOp == eMergeToAB ) + { + if ( !bCheckC ) + { + if ( mfi.m_bEqualAB ) + { + mfi.setMergeOperation( bOtherDest ? eCopyBToDest : eNoOperation ); + } + else if ( mfi.m_bExistsInA && mfi.m_bExistsInB ) + { + if ( !bCopyNewer || mfi.m_bDirA ) + mfi.setMergeOperation( eDefaultMergeOp ); + else if ( bCopyNewer && mfi.m_bConflictingAges ) + { + mfi.setMergeOperation( eConflictingAges ); + } + else + { + if ( mfi.m_ageA == eNew ) + mfi.setMergeOperation( eDefaultMergeOp == eMergeToAB ? eCopyAToB : eCopyAToDest ); + else + mfi.setMergeOperation( eDefaultMergeOp == eMergeToAB ? eCopyBToA : eCopyBToDest ); + } + } + else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB ) + { + if ( eDefaultMergeOp==eMergeABToDest ) mfi.setMergeOperation( eCopyBToDest ); + else if ( eDefaultMergeOp==eMergeToB ) mfi.setMergeOperation( eNoOperation ); + else mfi.setMergeOperation( eCopyBToA ); + } + else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB ) + { + if ( eDefaultMergeOp==eMergeABToDest ) mfi.setMergeOperation( eCopyAToDest ); + else if ( eDefaultMergeOp==eMergeToA ) mfi.setMergeOperation( eNoOperation ); + else mfi.setMergeOperation( eCopyAToB ); + } + else //if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB ) + { + mfi.setMergeOperation( eNoOperation ); assert(false); + } + } + else + { + if ( mfi.m_bEqualAB && mfi.m_bEqualAC ) + { + mfi.setMergeOperation( bOtherDest ? eCopyCToDest : eNoOperation ); + } + else if ( mfi.m_bExistsInA && mfi.m_bExistsInB && mfi.m_bExistsInC) + { + if ( mfi.m_bEqualAB ) + mfi.setMergeOperation( eCopyCToDest ); + else if ( mfi.m_bEqualAC ) + mfi.setMergeOperation( eCopyBToDest ); + else if ( mfi.m_bEqualBC ) + mfi.setMergeOperation( eCopyCToDest ); + else + mfi.setMergeOperation( eMergeABCToDest ); + } + else if ( mfi.m_bExistsInA && mfi.m_bExistsInB && !mfi.m_bExistsInC ) + { + if ( mfi.m_bEqualAB ) + mfi.setMergeOperation( eDeleteFromDest ); + else + mfi.setMergeOperation( eCopyBToDest ); + } + else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + if ( mfi.m_bEqualAC ) + mfi.setMergeOperation( eDeleteFromDest ); + else + mfi.setMergeOperation( eCopyCToDest ); + } + else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + if ( mfi.m_bEqualBC ) + mfi.setMergeOperation( eCopyCToDest ); + else + mfi.setMergeOperation( eMergeABCToDest ); + } + else if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + mfi.setMergeOperation( eCopyCToDest ); + } + else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB && !mfi.m_bExistsInC ) + { + mfi.setMergeOperation( eCopyBToDest ); + } + else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB && !mfi.m_bExistsInC) + { + mfi.setMergeOperation( eDeleteFromDest ); + } + else //if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB && !mfi.m_bExistsInC ) + { + mfi.setMergeOperation( eNoOperation ); assert(false); + } + } + + // Now check if file/dir-types fit. + if ( conflictingFileTypes(mfi) ) + { + mfi.setMergeOperation( eConflictingFileTypes ); + } + } + else + { + e_MergeOperation eMO = eDefaultMergeOp; + switch ( eDefaultMergeOp ) + { + case eConflictingFileTypes: + case eConflictingAges: + case eDeleteA: + case eDeleteB: + case eDeleteAB: + case eDeleteFromDest: + case eNoOperation: break; + case eCopyAToB: if ( !mfi.m_bExistsInA ) { eMO = eDeleteB; } break; + case eCopyBToA: if ( !mfi.m_bExistsInB ) { eMO = eDeleteA; } break; + case eCopyAToDest: if ( !mfi.m_bExistsInA ) { eMO = eDeleteFromDest; } break; + case eCopyBToDest: if ( !mfi.m_bExistsInB ) { eMO = eDeleteFromDest; } break; + case eCopyCToDest: if ( !mfi.m_bExistsInC ) { eMO = eDeleteFromDest; } break; + + case eMergeToA: + case eMergeToB: + case eMergeToAB: + case eMergeABCToDest: + case eMergeABToDest: + default: + assert(false); + } + mfi.setMergeOperation( eMO ); + } +} + +void DirectoryMergeWindow::onDoubleClick( QTreeWidgetItem* lvi ) +{ + if (lvi==0) return; + + if ( m_bDirectoryMerge ) + mergeCurrentFile(); + else + compareCurrentFile(); +} + +void DirectoryMergeWindow::onCurrentChanged(QTreeWidgetItem* lvi) +{ + if ( lvi==0 ) return; + + DirMergeItem* pDMI = static_cast(lvi); + + MergeFileInfos& mfi = *pDMI->m_pMFI; + assert( mfi.m_pDMI==pDMI ); + + m_pDirectoryMergeInfo->setInfo( m_dirA, m_dirB, m_dirC, m_dirDestInternal, mfi ); +} + +void DirectoryMergeWindow::mousePressEvent( QMouseEvent* e ) +{ + QTreeWidget::mousePressEvent(e); + int c = columnAt( e->x() ); + QTreeWidgetItem* lvi = itemAt( e->pos() ); + QPoint p = e->globalPos(); + if ( lvi==0 ) return; + + DirMergeItem* pDMI = static_cast(lvi); + + MergeFileInfos& mfi = *pDMI->m_pMFI; + assert( mfi.m_pDMI==pDMI ); + + if ( c==s_OpCol ) + { + bool bThreeDirs = m_dirC.isValid(); + + KPopupMenu m(this); + if ( bThreeDirs ) + { + m_pDirCurrentDoNothing->plug(&m); + int count=0; + if ( mfi.m_bExistsInA ) { m_pDirCurrentChooseA->plug(&m); ++count; } + if ( mfi.m_bExistsInB ) { m_pDirCurrentChooseB->plug(&m); ++count; } + if ( mfi.m_bExistsInC ) { m_pDirCurrentChooseC->plug(&m); ++count; } + if ( !conflictingFileTypes(mfi) && count>1 ) m_pDirCurrentMerge->plug(&m); + m_pDirCurrentDelete->plug(&m); + } + else if ( m_bSyncMode ) + { + m_pDirCurrentSyncDoNothing->plug(&m); + if ( mfi.m_bExistsInA ) m_pDirCurrentSyncCopyAToB->plug(&m); + if ( mfi.m_bExistsInB ) m_pDirCurrentSyncCopyBToA->plug(&m); + if ( mfi.m_bExistsInA ) m_pDirCurrentSyncDeleteA->plug(&m); + if ( mfi.m_bExistsInB ) m_pDirCurrentSyncDeleteB->plug(&m); + if ( mfi.m_bExistsInA && mfi.m_bExistsInB ) + { + m_pDirCurrentSyncDeleteAAndB->plug(&m); + if ( !conflictingFileTypes(mfi)) + { + m_pDirCurrentSyncMergeToA->plug(&m); + m_pDirCurrentSyncMergeToB->plug(&m); + m_pDirCurrentSyncMergeToAAndB->plug(&m); + } + } + } + else + { + m_pDirCurrentDoNothing->plug(&m); + if ( mfi.m_bExistsInA ) { m_pDirCurrentChooseA->plug(&m); } + if ( mfi.m_bExistsInB ) { m_pDirCurrentChooseB->plug(&m); } + if ( !conflictingFileTypes(mfi) && mfi.m_bExistsInA && mfi.m_bExistsInB ) m_pDirCurrentMerge->plug(&m); + m_pDirCurrentDelete->plug(&m); + } + + m.exec( p ); + } + else if ( c == s_ACol || c==s_BCol || c==s_CCol ) + { + QString itemPath; + if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } + else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } + else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } + + if (!itemPath.isEmpty()) + { + selectItemAndColumn( pDMI, c, e->button()==Qt::RightButton ); + } + } +} + +void DirectoryMergeWindow::contextMenuEvent(QContextMenuEvent* e) +{ + QTreeWidgetItem* lvi = itemAt( e->pos() ); + int c = columnAt( e->x() ); + QPoint p = e->globalPos(); + if ( lvi==0 ) return; + + DirMergeItem* pDMI = static_cast(lvi); + + MergeFileInfos& mfi = *pDMI->m_pMFI; + assert( mfi.m_pDMI==pDMI ); + if ( c == s_ACol || c==s_BCol || c==s_CCol ) + { + QString itemPath; + if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } + else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } + else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } + + if (!itemPath.isEmpty()) + { + selectItemAndColumn(pDMI, c, true); + KPopupMenu m(this); + m_pDirCompareExplicit->plug(&m); + m_pDirMergeExplicit->plug(&m); + +#ifndef _WIN32 + m.exec( p ); +#else + void showShellContextMenu( const QString&, QPoint, QWidget*, QMenu* ); + showShellContextMenu( itemPath, p, this, &m ); +#endif + } + } +} + +static QString getFileName( DirMergeItem* pDMI, int column ) +{ + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + return column == s_ACol ? mfi.m_fileInfoA.absFilePath() : + column == s_BCol ? mfi.m_fileInfoB.absFilePath() : + column == s_CCol ? mfi.m_fileInfoC.absFilePath() : + QString(""); + } + return ""; +} + +static bool isDir( DirMergeItem* pDMI, int column ) +{ + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + return column == s_ACol ? mfi.m_bDirA : + column == s_BCol ? mfi.m_bDirB : + mfi.m_bDirC; + } + return false; +} + + +void DirectoryMergeWindow::selectItemAndColumn(DirMergeItem* pDMI, int c, bool bContextMenu) +{ + if ( bContextMenu && ( + pDMI==m_pSelection1Item && c==m_selection1Column && m_pSelection2Item==0 || + pDMI==m_pSelection2Item && c==m_selection2Column && m_pSelection3Item==0 || + pDMI==m_pSelection3Item && c==m_selection3Column ) ) + return; + + DirMergeItem* pOld1=m_pSelection1Item; + DirMergeItem* pOld2=m_pSelection2Item; + DirMergeItem* pOld3=m_pSelection3Item; + + bool bReset = false; + + if ( m_pSelection1Item ) + { + if (isDir( m_pSelection1Item, m_selection1Column )!=isDir( pDMI, c )) + bReset = true; + } + + if ( bReset || m_pSelection3Item!=0 || + pDMI==m_pSelection1Item && c==m_selection1Column || + pDMI==m_pSelection2Item && c==m_selection2Column || + pDMI==m_pSelection3Item && c==m_selection3Column) + { + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + } + else if ( m_pSelection1Item==0 ) + { + m_pSelection1Item = pDMI; + m_selection1Column = c; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + } + else if ( m_pSelection2Item==0 ) + { + m_pSelection2Item = pDMI; + m_selection2Column = c; + m_pSelection3Item = 0; + } + else if ( m_pSelection3Item==0 ) + { + m_pSelection3Item = pDMI; + m_selection3Column = c; + } + if (pOld1) dataChanged( indexFromItem( pOld1, s_ACol ), indexFromItem( pOld1, s_CCol ) ); + if (pOld2) dataChanged( indexFromItem( pOld2, s_ACol ), indexFromItem( pOld2, s_CCol ) ); + if (pOld3) dataChanged( indexFromItem( pOld3, s_ACol ), indexFromItem( pOld3, s_CCol ) ); + if (m_pSelection1Item) dataChanged( indexFromItem( m_pSelection1Item, s_ACol ), indexFromItem( m_pSelection1Item, s_CCol ) ); + if (m_pSelection2Item) dataChanged( indexFromItem( m_pSelection2Item, s_ACol ), indexFromItem( m_pSelection2Item, s_CCol ) ); + if (m_pSelection3Item) dataChanged( indexFromItem( m_pSelection3Item, s_ACol ), indexFromItem( m_pSelection3Item, s_CCol ) ); + emit updateAvailabilities(); +} + +DirMergeItem::DirMergeItem( QTreeWidget* pParent, const QString& fileName, MergeFileInfos* pMFI ) +: QTreeWidgetItem( pParent, QStringList() << fileName << "" << "" << "" << i18n("To do.") << "" ) +{ + init(pMFI); +} + +DirMergeItem::DirMergeItem( DirMergeItem* pParent, const QString& fileName, MergeFileInfos* pMFI ) +: QTreeWidgetItem( pParent, QStringList() << fileName << "" << "" << "" << i18n("To do.") << "" ) +{ + init(pMFI); +} + + +void DirMergeItem::init(MergeFileInfos* pMFI) +{ + pMFI->m_pDMI = this; + m_pMFI = pMFI; + TotalDiffStatus& tds = pMFI->m_totalDiffStatus; + if ( m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC ) + { + } + else + { + setText( s_UnsolvedCol, QString::number( tds.nofUnsolvedConflicts ) ); + setText( s_SolvedCol, QString::number( tds.nofSolvedConflicts ) ); + setText( s_NonWhiteCol, QString::number( tds.nofUnsolvedConflicts + tds.nofSolvedConflicts - tds.nofWhitespaceConflicts ) ); + setText( s_WhiteCol, QString::number( tds.nofWhitespaceConflicts ) ); + } +} + +bool DirMergeItem::operator<(const QTreeWidgetItem& i) const +{ + int col = treeWidget()->sortColumn(); + const DirMergeItem* pDMI = static_cast(&i); + bool bDir1 = m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC; + bool bDir2 = pDMI->m_pMFI->m_bDirA || pDMI->m_pMFI->m_bDirB || pDMI->m_pMFI->m_bDirC; + if ( m_pMFI==0 || pDMI->m_pMFI==0 || bDir1 == bDir2 ) + { + if(col==s_UnsolvedCol || col==s_SolvedCol || col==s_NonWhiteCol || col==s_WhiteCol) + return text(col).toInt() > i.text(col).toInt(); + else + return QTreeWidgetItem::operator<(i); + } + else + return bDir1; +} + + +DirMergeItem::~DirMergeItem() +{ + m_pMFI->m_pDMI = 0; +} + +void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp ) +{ + if ( eMOp != m_eMergeOperation ) + { + m_bOperationComplete = false; + m_pDMI->setText( s_OpStatusCol, "" ); + } + + m_eMergeOperation = eMOp; + QString s; + bool bDir = m_bDirA || m_bDirB || m_bDirC; + if( m_pDMI!=0 ) + { + switch( m_eMergeOperation ) + { + case eNoOperation: s=""; m_pDMI->setText(s_OpCol,""); break; + case eCopyAToB: s=i18n("Copy A to B"); break; + case eCopyBToA: s=i18n("Copy B to A"); break; + case eDeleteA: s=i18n("Delete A"); break; + case eDeleteB: s=i18n("Delete B"); break; + case eDeleteAB: s=i18n("Delete A & B"); break; + case eMergeToA: s=i18n("Merge to A"); break; + case eMergeToB: s=i18n("Merge to B"); break; + case eMergeToAB: s=i18n("Merge to A & B"); break; + case eCopyAToDest: s="A"; break; + case eCopyBToDest: s="B"; break; + case eCopyCToDest: s="C"; break; + case eDeleteFromDest: s=i18n("Delete (if exists)"); break; + case eMergeABCToDest: s= bDir ? i18n("Merge") : i18n("Merge (manual)"); break; + case eMergeABToDest: s= bDir ? i18n("Merge") : i18n("Merge (manual)"); break; + case eConflictingFileTypes: s=i18n("Error: Conflicting File Types"); break; + case eConflictingAges: s=i18n("Error: Dates are equal but files are not."); break; + default: assert(false); break; + } + m_pDMI->setText(s_OpCol,s); + + e_MergeOperation eChildrenMergeOp = m_eMergeOperation; + if ( eChildrenMergeOp == eConflictingFileTypes ) eChildrenMergeOp = eMergeABCToDest; + for( int childIdx=0; childIdxchildCount(); ++childIdx ) + { + QTreeWidgetItem* p = m_pDMI->child(childIdx); + DirMergeItem* pDMI = static_cast( p ); + DirectoryMergeWindow* pDMW = static_cast( p->treeWidget() ); + pDMW->calcSuggestedOperation( *pDMI->m_pMFI, eChildrenMergeOp ); + } + } +} + +void DirectoryMergeWindow::compareCurrentFile() +{ + if (!canContinue()) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); + return; + } + + if ( currentItem() != 0 ) + { + DirMergeItem* pDMI = static_cast( currentItem() ); + MergeFileInfos& mfi = *pDMI->m_pMFI; + if ( !(mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC) ) + { + emit startDiffMerge( + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + "", + "","","",0 + ); + } + } + emit updateAvailabilities(); +} + + +void DirectoryMergeWindow::slotCompareExplicitlySelectedFiles() +{ + if ( ! isDir(m_pSelection1Item,m_selection1Column) && !canContinue() ) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); + return; + } + + emit startDiffMerge( + getFileName( m_pSelection1Item, m_selection1Column ), + getFileName( m_pSelection2Item, m_selection2Column ), + getFileName( m_pSelection3Item, m_selection3Column ), + "", + "","","",0 + ); + m_pSelection1Item=0; + m_pSelection2Item=0; + m_pSelection3Item=0; + + emit updateAvailabilities(); + update(); +} + +void DirectoryMergeWindow::slotMergeExplicitlySelectedFiles() +{ + if ( ! isDir(m_pSelection1Item,m_selection1Column) && !canContinue() ) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); + return; + } + + QString fn1 = getFileName( m_pSelection1Item, m_selection1Column ); + QString fn2 = getFileName( m_pSelection2Item, m_selection2Column ); + QString fn3 = getFileName( m_pSelection3Item, m_selection3Column ); + + emit startDiffMerge( fn1, fn2, fn3, + fn3.isEmpty() ? fn2 : fn3, + "","","",0 + ); + m_pSelection1Item=0; + m_pSelection2Item=0; + m_pSelection3Item=0; + + emit updateAvailabilities(); + update(); +} + +bool DirectoryMergeWindow::isFileSelected() +{ + if ( currentItem() != 0 ) + { + DirMergeItem* pDMI = static_cast( currentItem() ); + MergeFileInfos& mfi = *pDMI->m_pMFI; + return ! (mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC || conflictingFileTypes(mfi) ); + } + return false; +} + +void DirectoryMergeWindow::mergeResultSaved(const QString& fileName) +{ + DirMergeItem* pCurrentItemForOperation = (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) + ? 0 + : *m_currentItemForOperation; + + if ( pCurrentItemForOperation!=0 && pCurrentItemForOperation->m_pMFI==0 ) + { + KMessageBox::error( this, i18n("This should never happen: \n\nmergeResultSaved: m_pMFI=0\n\nIf you know how to reproduce this, please contact the program author."),i18n("Program Error") ); + return; + } + if ( pCurrentItemForOperation!=0 && fileName == fullNameDest(*pCurrentItemForOperation->m_pMFI) ) + { + if ( pCurrentItemForOperation->m_pMFI->m_eMergeOperation==eMergeToAB ) + { + MergeFileInfos& mfi = *pCurrentItemForOperation->m_pMFI; + bool bSuccess = copyFLD( fullNameB(mfi), fullNameA(mfi) ); + if (!bSuccess) + { + KMessageBox::error(this, i18n("An error occurred while copying.\n"), i18n("Error") ); + m_pStatusInfo->setWindowTitle(i18n("Merge Error")); + m_pStatusInfo->show(); + //if ( m_pStatusInfo->firstChild()!=0 ) + // m_pStatusInfo->ensureItemVisible( m_pStatusInfo->last() ); + m_bError = true; + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Error.") ); + mfi.m_eMergeOperation = eCopyBToA; + return; + } + } + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Done.") ); + pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; + if ( m_mergeItemList.size()==1 ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + } + } + + emit updateAvailabilities(); +} + +bool DirectoryMergeWindow::canContinue() +{ + bool bCanContinue=false; + checkIfCanContinue( &bCanContinue ); + if ( bCanContinue && !m_bError ) + { + DirMergeItem* pCurrentItemForOperation = + (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) ? 0 : *m_currentItemForOperation; + + if ( pCurrentItemForOperation!=0 && ! pCurrentItemForOperation->m_pMFI->m_bOperationComplete ) + { + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Not saved.") ); + pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; + if ( m_mergeItemList.size()==1 ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + } + } + } + return bCanContinue; +} + +bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ) +{ + bool bCreateBackups = m_pOptions->m_bDmCreateBakFiles; + // First decide destname + QString destName; + switch( mfi.m_eMergeOperation ) + { + case eNoOperation: break; + case eDeleteAB: break; + case eMergeToAB: // let the user save in B. In mergeResultSaved() the file will be copied to A. + case eMergeToB: + case eDeleteB: + case eCopyAToB: destName = fullNameB(mfi); break; + case eMergeToA: + case eDeleteA: + case eCopyBToA: destName = fullNameA(mfi); break; + case eMergeABToDest: + case eMergeABCToDest: + case eCopyAToDest: + case eCopyBToDest: + case eCopyCToDest: + case eDeleteFromDest: destName = fullNameDest(mfi); break; + default: + KMessageBox::error( this, i18n("Unknown merge operation. (This must never happen!)"), i18n("Error") ); + assert(false); + } + + bool bSuccess = false; + bSingleFileMerge = false; + switch( mfi.m_eMergeOperation ) + { + case eNoOperation: bSuccess = true; break; + case eCopyAToDest: + case eCopyAToB: bSuccess = copyFLD( fullNameA(mfi), destName ); break; + case eCopyBToDest: + case eCopyBToA: bSuccess = copyFLD( fullNameB(mfi), destName ); break; + case eCopyCToDest: bSuccess = copyFLD( fullNameC(mfi), destName ); break; + case eDeleteFromDest: + case eDeleteA: + case eDeleteB: bSuccess = deleteFLD( destName, bCreateBackups ); break; + case eDeleteAB: bSuccess = deleteFLD( fullNameA(mfi), bCreateBackups ) && + deleteFLD( fullNameB(mfi), bCreateBackups ); break; + case eMergeABToDest: + case eMergeToA: + case eMergeToAB: + case eMergeToB: bSuccess = mergeFLD( fullNameA(mfi), fullNameB(mfi), "", + destName, bSingleFileMerge ); + break; + case eMergeABCToDest:bSuccess = mergeFLD( + mfi.m_bExistsInA ? fullNameA(mfi) : QString(""), + mfi.m_bExistsInB ? fullNameB(mfi) : QString(""), + mfi.m_bExistsInC ? fullNameC(mfi) : QString(""), + destName, bSingleFileMerge ); + break; + default: + KMessageBox::error( this, i18n("Unknown merge operation."), i18n("Error") ); + assert(false); + } + + return bSuccess; +} + + +// Check if the merge can start, and prepare the m_mergeItemList which then contains all +// items that must be merged. +void DirectoryMergeWindow::prepareMergeStart( QTreeWidgetItem* pBegin, QTreeWidgetItem* pEnd, bool bVerbose ) +{ + if ( bVerbose ) + { + int status = KMessageBox::warningYesNoCancel(this, + i18n("The merge is about to begin.\n\n" + "Choose \"Do it\" if you have read the instructions and know what you are doing.\n" + "Choosing \"Simulate it\" will tell you what would happen.\n\n" + "Be aware that this program still has beta status " + "and there is NO WARRANTY whatsoever! Make backups of your vital data!"), + i18n("Starting Merge"), i18n("Do It"), i18n("Simulate It") ); + if (status==KMessageBox::Yes) m_bRealMergeStarted = true; + else if (status==KMessageBox::No ) m_bSimulatedMergeStarted = true; + else return; + } + else + { + m_bRealMergeStarted = true; + } + + m_mergeItemList.clear(); + if (pBegin == 0) + return; + + for( QTreeWidgetItem* p = pBegin; p!= pEnd; p = treeIterator( p ) ) + { + DirMergeItem* pDMI = static_cast(p); + + if ( pDMI && ! pDMI->m_pMFI->m_bOperationComplete ) + { + m_mergeItemList.push_back(pDMI); + + if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingFileTypes ) + { + scrollToItem( pDMI, QAbstractItemView::EnsureVisible ); + pDMI->setSelected( true ); + KMessageBox::error(this, i18n("The highlighted item has a different type in the different directories. Select what to do."), i18n("Error")); + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + return; + } + if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingAges ) + { + scrollToItem ( pDMI, QAbstractItemView::EnsureVisible ); + pDMI->setSelected( true ); + KMessageBox::error(this, i18n("The modification dates of the file are equal but the files are not. Select what to do."), i18n("Error")); + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + return; + } + } + } + + m_currentItemForOperation = m_mergeItemList.begin(); + return; +} + +void DirectoryMergeWindow::slotRunOperationForCurrentItem() +{ + if ( ! canContinue() ) return; + + bool bVerbose = false; + if ( m_mergeItemList.empty() ) + { + QTreeWidgetItem* pBegin = currentItem(); + QTreeWidgetItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no children) + + prepareMergeStart( pBegin, pEnd, bVerbose ); + mergeContinue(true, bVerbose); + } + else + mergeContinue(false, bVerbose); +} + +void DirectoryMergeWindow::slotRunOperationForAllItems() +{ + if ( ! canContinue() ) return; + + bool bVerbose = true; + if ( m_mergeItemList.empty() ) + { + QTreeWidgetItem* pBegin = topLevelItemCount()>0 ? topLevelItem(0) : 0; + + prepareMergeStart( pBegin, 0, bVerbose ); + mergeContinue(true, bVerbose); + } + else + mergeContinue(false, bVerbose); +} + +void DirectoryMergeWindow::mergeCurrentFile() +{ + if (!canContinue()) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible because directory merge is currently running."),i18n("Operation Not Possible")); + return; + } + + if ( isFileSelected() ) + { + DirMergeItem* pDMI = static_cast( currentItem() ); + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + m_mergeItemList.clear(); + m_mergeItemList.push_back( pDMI ); + m_currentItemForOperation=m_mergeItemList.begin(); + bool bDummy=false; + mergeFLD( + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + fullNameDest(mfi), + bDummy + ); + } + } + emit updateAvailabilities(); +} + + +// When bStart is true then m_currentItemForOperation must still be processed. +// When bVerbose is true then a messagebox will tell when the merge is complete. +void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose) +{ + ProgressProxy pp; + if ( m_mergeItemList.empty() ) + return; + + int nrOfItems = 0; + int nrOfCompletedItems = 0; + int nrOfCompletedSimItems = 0; + + // Count the number of completed items (for the progress bar). + for( MergeItemList::iterator i = m_mergeItemList.begin(); i!=m_mergeItemList.end(); ++i ) + { + DirMergeItem* pDMI = *i; + ++nrOfItems; + if ( pDMI->m_pMFI->m_bOperationComplete ) + ++nrOfCompletedItems; + if ( pDMI->m_pMFI->m_bSimOpComplete ) + ++nrOfCompletedSimItems; + } + + m_pStatusInfo->hide(); + m_pStatusInfo->clear(); + + DirMergeItem* pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation; + + bool bContinueWithCurrentItem = bStart; // true for first item, else false + bool bSkipItem = false; + if ( !bStart && m_bError && pCurrentItemForOperation!=0 ) + { + int status = KMessageBox::warningYesNoCancel(this, + i18n("There was an error in the last step.\n" + "Do you want to continue with the item that caused the error or do you want to skip this item?"), + i18n("Continue merge after an error"), i18n("Continue With Last Item"), i18n("Skip Item") ); + if (status==KMessageBox::Yes) bContinueWithCurrentItem = true; + else if (status==KMessageBox::No ) bSkipItem = true; + else return; + m_bError = false; + } + + bool bSuccess = true; + bool bSingleFileMerge = false; + bool bSim = m_bSimulatedMergeStarted; + while( bSuccess ) + { + if ( pCurrentItemForOperation==0 ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + break; + } + + if ( pCurrentItemForOperation!=0 && !bContinueWithCurrentItem ) + { + if ( bSim ) + { + if( pCurrentItemForOperation->childCount()==0 ) + { + pCurrentItemForOperation->m_pMFI->m_bSimOpComplete = true; + } + } + else + { + if( pCurrentItemForOperation->childCount()==0 ) + { + if( !pCurrentItemForOperation->m_pMFI->m_bOperationComplete ) + { + pCurrentItemForOperation->setText( s_OpStatusCol, bSkipItem ? i18n("Skipped.") : i18n("Done.") ); + pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; + bSkipItem = false; + } + } + else + { + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("In progress...") ); + } + } + } + + if ( ! bContinueWithCurrentItem ) + { + // Depth first + QTreeWidgetItem* 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" + QTreeWidgetItem* pParent = pPrevItem->parent(); + bool bDone = true; + while ( bDone && pParent!=0 ) + { + for( int childIdx = 0; childIdxchildCount(); ++childIdx ) + { + DirMergeItem* pDMI = static_cast(pParent->child(childIdx)); + if ( !bSim && ! pDMI->m_pMFI->m_bOperationComplete || bSim && pDMI->m_pMFI->m_bSimOpComplete ) + { + bDone=false; + break; + } + } + if ( bDone ) + { + if (bSim) + static_cast(pParent)->m_pMFI->m_bSimOpComplete = bDone; + else + { + pParent->setText( s_OpStatusCol, i18n("Done.") ); + static_cast(pParent)->m_pMFI->m_bOperationComplete = bDone; + } + } + pParent = pParent->parent(); + } + } + } + + if ( pCurrentItemForOperation == 0 ) // end? + { + if ( m_bRealMergeStarted ) + { + if (bVerbose) + { + KMessageBox::information( this, i18n("Merge operation complete."), i18n("Merge Complete") ); + } + m_bRealMergeStarted = false; + m_pStatusInfo->setWindowTitle(i18n("Merge Complete")); + } + if ( m_bSimulatedMergeStarted ) + { + m_bSimulatedMergeStarted = false; + QTreeWidgetItem* p = topLevelItemCount()>0 ? topLevelItem(0) : 0; + for( ; p!=0; p=treeIterator(p) ) + { + static_cast(p)->m_pMFI->m_bSimOpComplete = false; + } + m_pStatusInfo->setWindowTitle(i18n("Simulated merge complete: Check if you agree with the proposed operations.")); + m_pStatusInfo->show(); + } + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + return; + } + + MergeFileInfos& mfi = *pCurrentItemForOperation->m_pMFI; + + pp.setInformation( mfi.m_subPath, + bSim ? double(nrOfCompletedSimItems)/nrOfItems : double(nrOfCompletedItems)/nrOfItems, + false // bRedrawUpdate + ); + + bSuccess = executeMergeOperation( mfi, bSingleFileMerge ); // Here the real operation happens. + + if ( bSuccess ) + { + if(bSim) ++nrOfCompletedSimItems; + else ++nrOfCompletedItems; + bContinueWithCurrentItem = false; + } + + if( pp.wasCancelled() ) + break; + } // end while + + //g_pProgressDialog->hide(); + + setCurrentItem( pCurrentItemForOperation ); + scrollToItem( pCurrentItemForOperation, EnsureVisible ); + if ( !bSuccess && !bSingleFileMerge ) + { + KMessageBox::error(this, i18n("An error occurred. Press OK to see detailed information.\n"), i18n("Error") ); + m_pStatusInfo->setWindowTitle(i18n("Merge Error")); + m_pStatusInfo->show(); + //if ( m_pStatusInfo->firstChild()!=0 ) + // m_pStatusInfo->ensureItemVisible( m_pStatusInfo->last() ); + m_bError = true; + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Error.") ); + } + else + { + m_bError = false; + } + emit updateAvailabilities(); + + if ( m_currentItemForOperation==m_mergeItemList.end() ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + } +} + +void DirectoryMergeWindow::allowResizeEvents(bool bAllowResizeEvents ) +{ + m_bAllowResizeEvents = bAllowResizeEvents; +} + +void DirectoryMergeWindow::resizeEvent( QResizeEvent* e ) +{ + if (m_bAllowResizeEvents) + QTreeWidget::resizeEvent(e); +} + +bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) +{ + FileAccess fi(name, true); + if ( !fi.exists() ) + return true; + + if ( bCreateBackup ) + { + bool bSuccess = renameFLD( name, name+".orig" ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error: While deleting %1: Creating backup failed.").arg(name) ); + return false; + } + } + else + { + if ( fi.isDir() && !fi.isSymLink() ) + m_pStatusInfo->addText(i18n("delete directory recursively( %1 )").arg(name)); + else + m_pStatusInfo->addText(i18n("delete( %1 )").arg(name)); + + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + if ( fi.isDir() && !fi.isSymLink() )// recursive directory delete only for real dirs, not symlinks + { + t_DirectoryList dirList; + bool bSuccess = fi.listDir( &dirList, false, true, "*", "", "", false, false ); // not recursive, find hidden files + + if ( !bSuccess ) + { + // No Permission to read directory or other error. + m_pStatusInfo->addText( i18n("Error: delete dir operation failed while trying to read the directory.") ); + return false; + } + + t_DirectoryList::iterator it; // create list iterator + + for ( it=dirList.begin(); it!=dirList.end(); ++it ) // for each file... + { + FileAccess& fi2 = *it; + if ( fi2.fileName() == "." || fi2.fileName()==".." ) + continue; + bSuccess = deleteFLD( fi2.absFilePath(), false ); + if (!bSuccess) break; + } + if (bSuccess) + { + bSuccess = FileAccess::removeDir( name ); + if ( !bSuccess ) + { + m_pStatusInfo->addText( i18n("Error: rmdir( %1 ) operation failed.").arg(name)); + return false; + } + } + } + else + { + bool bSuccess = FileAccess::removeFile( name ); + if ( !bSuccess ) + { + m_pStatusInfo->addText( i18n("Error: delete operation failed.") ); + return false; + } + } + } + return true; +} + +bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC,const QString& nameDest, bool& bSingleFileMerge ) +{ + FileAccess fi(nameA); + if (fi.isDir()) + { + return makeDir(nameDest); + } + + // Make sure that the dir exists, into which we will save the file later. + int pos=nameDest.lastIndexOf('/'); + if ( pos>0 ) + { + QString parentName = nameDest.left(pos); + bool bSuccess = makeDir(parentName, true /*quiet*/); + if (!bSuccess) + return false; + } + + m_pStatusInfo->addText(i18n("manual merge( %1, %2, %3 -> %4)").arg(nameA).arg(nameB).arg(nameC).arg(nameDest)); + if ( m_bSimulatedMergeStarted ) + { + m_pStatusInfo->addText(i18n(" Note: After a manual merge the user should continue by pressing F7.") ); + return true; + } + + bSingleFileMerge = true; + (*m_currentItemForOperation)->setText( s_OpStatusCol, i18n("In progress...") ); + scrollToItem( *m_currentItemForOperation, EnsureVisible ); + + emit startDiffMerge( nameA, nameB, nameC, nameDest, "","","",0 ); + + return false; +} + +bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destName ) +{ + if ( srcName == destName ) + return true; + + if ( FileAccess(destName, true).exists() ) + { + bool bSuccess = deleteFLD( destName, m_pOptions->m_bDmCreateBakFiles ); + if ( !bSuccess ) + { + m_pStatusInfo->addText(i18n("Error: copy( %1 -> %2 ) failed." + "Deleting existing destination failed.").arg(srcName).arg(destName)); + return false; + } + } + + FileAccess fi( srcName ); + + if ( fi.isSymLink() && (fi.isDir() && !m_bFollowDirLinks || !fi.isDir() && !m_bFollowFileLinks) ) + { + m_pStatusInfo->addText(i18n("copyLink( %1 -> %2 )").arg(srcName).arg(destName)); +#ifdef _WIN32 + // What are links? +#else + if ( m_bSimulatedMergeStarted ) + { + return true; + } + FileAccess destFi(destName); + if ( !destFi.isLocal() || !fi.isLocal() ) + { + m_pStatusInfo->addText(i18n("Error: copyLink failed: Remote links are not yet supported.")); + return false; + } + QString linkTarget = fi.readLink(); + bool bSuccess = FileAccess::symLink( linkTarget, destName ); + if (!bSuccess) + m_pStatusInfo->addText(i18n("Error: copyLink failed.")); + return bSuccess; +#endif + } + + if ( fi.isDir() ) + { + bool bSuccess = makeDir( destName ); + return bSuccess; + } + + int pos=destName.lastIndexOf('/'); + if ( pos>0 ) + { + QString parentName = destName.left(pos); + bool bSuccess = makeDir(parentName, true /*quiet*/); + if (!bSuccess) + return false; + } + + m_pStatusInfo->addText(i18n("copy( %1 -> %2 )").arg(srcName).arg(destName)); + + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + FileAccess faSrc ( srcName ); + bool bSuccess = faSrc.copyFile( destName ); + if (! bSuccess ) m_pStatusInfo->addText( faSrc.getStatusText() ); + return bSuccess; +} + +// Rename is not an operation that can be selected by the user. +// It will only be used to create backups. +// Hence it will delete an existing destination without making a backup (of the old backup.) +bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& destName ) +{ + if ( srcName == destName ) + return true; + + if ( FileAccess(destName, true).exists() ) + { + bool bSuccess = deleteFLD( destName, false /*no backup*/ ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error during rename( %1 -> %2 ): " + "Cannot delete existing destination." ).arg(srcName).arg(destName)); + return false; + } + } + + m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").arg(srcName).arg(destName)); + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + bool bSuccess = FileAccess( srcName ).rename( destName ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error: Rename failed.") ); + return false; + } + + return true; +} + +bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet ) +{ + FileAccess fi(name, true); + if( fi.exists() && fi.isDir() ) + return true; + + if( fi.exists() && !fi.isDir() ) + { + bool bSuccess = deleteFLD( name, true ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error during makeDir of %1. " + "Cannot delete existing file." ).arg(name)); + return false; + } + } + + int pos=name.lastIndexOf('/'); + if ( pos>0 ) + { + QString parentName = name.left(pos); + bool bSuccess = makeDir(parentName,true); + if (!bSuccess) + return false; + } + + if ( ! bQuiet ) + m_pStatusInfo->addText(i18n("makeDir( %1 )").arg(name)); + + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + bool bSuccess = FileAccess::makeDir( name ); + if ( bSuccess == false ) + { + m_pStatusInfo->addText( i18n("Error while creating directory.") ); + return false; + } + return true; +} + + +DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent ) +: QFrame(pParent) +{ + QVBoxLayout *topLayout = new QVBoxLayout( this ); + topLayout->setMargin(0); + + QGridLayout *grid = new QGridLayout(); + topLayout->addLayout(grid); + grid->setColumnStretch(1,10); + + int line=0; + + m_pA = new QLabel("A",this); grid->addWidget( m_pA,line, 0 ); + m_pInfoA = new QLabel(this); grid->addWidget( m_pInfoA,line,1 ); ++line; + m_pB = new QLabel("B",this); grid->addWidget( m_pB,line, 0 ); + m_pInfoB = new QLabel(this); grid->addWidget( m_pInfoB,line,1 ); ++line; + m_pC = new QLabel("C",this); grid->addWidget( m_pC,line, 0 ); + m_pInfoC = new QLabel(this); grid->addWidget( m_pInfoC,line,1 ); ++line; + m_pDest = new QLabel(i18n("Dest"),this); grid->addWidget( m_pDest,line, 0 ); + m_pInfoDest = new QLabel(this); grid->addWidget( m_pInfoDest,line,1 ); ++line; + + m_pInfoList = new QTreeWidget(this); topLayout->addWidget( m_pInfoList ); + m_pInfoList->setHeaderLabels( QStringList() << i18n("Dir") << i18n("Type") << i18n("Size") + << i18n("Attr") << i18n("Last Modification") << i18n("Link-Destination") ); + setMinimumSize( 100,100 ); + + m_pInfoList->installEventFilter(this); + m_pInfoList->setRootIsDecorated( false ); +} + +bool DirectoryMergeInfo::eventFilter(QObject*o, QEvent* e) +{ + if ( e->type()==QEvent::FocusIn && o==m_pInfoList ) + emit gotFocus(); + return false; +} + +static void addListViewItem( QTreeWidget* pListView, const QString& dir, + const QString& basePath, FileAccess& fi ) +{ + if ( basePath.isEmpty() ) + { + return; + } + else + { + if ( fi.exists() ) + { + QString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss"); + + new QTreeWidgetItem( + pListView, + QStringList() << dir << + QString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : "") << + QString::number(fi.size()) << + QString(fi.isReadable() ? "r" : " ") + (fi.isWritable()?"w" : " ") +#ifdef _WIN32 + /*Future: Use GetFileAttributes()*/ << +#else + + (fi.isExecutable()?"x" : " ") << +#endif + dateString << + QString(fi.isSymLink() ? (" -> " + fi.readLink()) : QString("")) + ); + } + else + { + new QTreeWidgetItem( + pListView, + QStringList() << dir << + i18n("not available") << + "" << + "" << + "" << + "" + ); + } + } +} + +void DirectoryMergeInfo::setInfo( + const FileAccess& dirA, + const FileAccess& dirB, + const FileAccess& dirC, + const FileAccess& dirDest, + MergeFileInfos& mfi ) +{ + bool bHideDest = false; + if ( dirA.absFilePath()==dirDest.absFilePath() ) + { + m_pA->setText( i18n("A (Dest): ") ); bHideDest=true; + } + else + m_pA->setText( !dirC.isValid() ? QString("A: ") : i18n("A (Base): ")); + + m_pInfoA->setText( dirA.prettyAbsPath() ); + + if ( dirB.absFilePath()==dirDest.absFilePath() ) + { + m_pB->setText( i18n("B (Dest): ") ); bHideDest=true; + } + else + m_pB->setText( "B: " ); + m_pInfoB->setText( dirB.prettyAbsPath() ); + + if ( dirC.absFilePath()==dirDest.absFilePath() ) + { + m_pC->setText( i18n("C (Dest): ") ); bHideDest=true; + } + else + m_pC->setText( "C: " ); + m_pInfoC->setText( dirC.prettyAbsPath() ); + + m_pDest->setText( i18n("Dest: ") ); m_pInfoDest->setText( dirDest.prettyAbsPath() ); + + if (!dirC.isValid()) { m_pC->hide(); m_pInfoC->hide(); } + else { m_pC->show(); m_pInfoC->show(); } + + if (!dirDest.isValid()||bHideDest) { m_pDest->hide(); m_pInfoDest->hide(); } + else { m_pDest->show(); m_pInfoDest->show(); } + + m_pInfoList->clear(); + addListViewItem( m_pInfoList, "A", dirA.prettyAbsPath(), mfi.m_fileInfoA ); + addListViewItem( m_pInfoList, "B", dirB.prettyAbsPath(), mfi.m_fileInfoB ); + addListViewItem( m_pInfoList, "C", dirC.prettyAbsPath(), mfi.m_fileInfoC ); + if (!bHideDest) + { + FileAccess fiDest( dirDest.prettyAbsPath() + "/" + mfi.m_subPath, true ); + addListViewItem( m_pInfoList, i18n("Dest"), dirDest.prettyAbsPath(), fiDest ); + } + for (int i=0;icolumnCount();++i) + m_pInfoList->resizeColumnToContents ( i ); +} + +QTextStream& operator<<( QTextStream& ts, MergeFileInfos& mfi ) +{ + ts << "{\n"; + ValueMap vm; + vm.writeEntry( "SubPath", mfi.m_subPath ); + vm.writeEntry( "ExistsInA", mfi.m_bExistsInA ); + vm.writeEntry( "ExistsInB", mfi.m_bExistsInB ); + vm.writeEntry( "ExistsInC", mfi.m_bExistsInC ); + vm.writeEntry( "EqualAB", mfi.m_bEqualAB ); + vm.writeEntry( "EqualAC", mfi.m_bEqualAC ); + vm.writeEntry( "EqualBC", mfi.m_bEqualBC ); + //DirMergeItem* m_pDMI; + //MergeFileInfos* m_pParent; + vm.writeEntry( "MergeOperation", (int) mfi.m_eMergeOperation ); + vm.writeEntry( "DirA", mfi.m_bDirA ); + vm.writeEntry( "DirB", mfi.m_bDirB ); + vm.writeEntry( "DirC", mfi.m_bDirC ); + vm.writeEntry( "LinkA", mfi.m_bLinkA ); + vm.writeEntry( "LinkB", mfi.m_bLinkB ); + vm.writeEntry( "LinkC", mfi.m_bLinkC ); + vm.writeEntry( "OperationComplete", mfi.m_bOperationComplete ); + //bool m_bSimOpComplete ); + + vm.writeEntry( "AgeA", (int) mfi.m_ageA ); + vm.writeEntry( "AgeB", (int) mfi.m_ageB ); + vm.writeEntry( "AgeC", (int) mfi.m_ageC ); + vm.writeEntry( "ConflictingAges", mfi.m_bConflictingAges ); // Equal age but files are not! + + //FileAccess m_fileInfoA; + //FileAccess m_fileInfoB; + //FileAccess m_fileInfoC; + + //TotalDiffStatus m_totalDiffStatus; + + vm.save(ts); + + ts << "}\n"; + + return ts; +} + +void DirectoryMergeWindow::slotSaveMergeState() +{ + //slotStatusMsg(i18n("Saving Directory Merge State ...")); + + //QString s = KFileDialog::getSaveURL( QDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); + QString s = KFileDialog::getSaveFileName( QDir::currentPath(), 0, this, i18n("Save Directory Merge State As...") ); + if(!s.isEmpty()) + { + m_dirMergeStateFilename = s; + + + QFile file(m_dirMergeStateFilename); + bool bSuccess = file.open( QIODevice::WriteOnly ); + if ( bSuccess ) + { + QTextStream ts( &file ); + + QTreeWidgetItemIterator it( this ); + while ( *it ) { + DirMergeItem* item = static_cast(*it); + MergeFileInfos* pMFI = item->m_pMFI; + ts << *pMFI; + ++it; + } + } + } + + //slotStatusMsg(i18n("Ready.")); + +} + +void DirectoryMergeWindow::slotLoadMergeState() +{ +} + +void DirectoryMergeWindow::updateFileVisibilities() +{ + bool bShowIdentical = m_pDirShowIdenticalFiles->isChecked(); + bool bShowDifferent = m_pDirShowDifferentFiles->isChecked(); + bool bShowOnlyInA = m_pDirShowFilesOnlyInA->isChecked(); + bool bShowOnlyInB = m_pDirShowFilesOnlyInB->isChecked(); + bool bShowOnlyInC = m_pDirShowFilesOnlyInC->isChecked(); + bool bThreeDirs = m_dirC.isValid(); + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + + QTreeWidgetItem* p = topLevelItemCount()>0 ? topLevelItem(0) : 0; + while(p) + { + DirMergeItem* pDMI = static_cast(p); + MergeFileInfos* pMFI = pDMI->m_pMFI; + bool bDir = pMFI->m_bDirA || pMFI->m_bDirB || pMFI->m_bDirC; + bool bExistsEverywhere = pMFI->m_bExistsInA && pMFI->m_bExistsInB && (pMFI->m_bExistsInC || !bThreeDirs); + int existCount = int(pMFI->m_bExistsInA) + int(pMFI->m_bExistsInB) + int(pMFI->m_bExistsInC); + bool bVisible = + ( bShowIdentical && bExistsEverywhere && pMFI->m_bEqualAB && (pMFI->m_bEqualAC || !bThreeDirs) ) + || ( (bShowDifferent||bDir) && existCount>=2 && (!pMFI->m_bEqualAB || !(pMFI->m_bEqualAC || !bThreeDirs))) + || ( bShowOnlyInA && pMFI->m_bExistsInA && !pMFI->m_bExistsInB && !pMFI->m_bExistsInC ) + || ( bShowOnlyInB && !pMFI->m_bExistsInA && pMFI->m_bExistsInB && !pMFI->m_bExistsInC ) + || ( bShowOnlyInC && !pMFI->m_bExistsInA && !pMFI->m_bExistsInB && pMFI->m_bExistsInC ); + + QString fileName = pMFI->m_subPath.section( '/', -1 ); + bVisible = bVisible && ( + bDir && ! wildcardMultiMatch( m_pOptions->m_DmDirAntiPattern, fileName, m_bCaseSensitive ) + || wildcardMultiMatch( m_pOptions->m_DmFilePattern, fileName, m_bCaseSensitive ) + && !wildcardMultiMatch( m_pOptions->m_DmFileAntiPattern, fileName, m_bCaseSensitive ) ); + + p->setHidden(!bVisible); + p = treeIterator( p, true, true ); + } +} + +void DirectoryMergeWindow::slotShowIdenticalFiles() { m_pOptions->m_bDmShowIdenticalFiles=m_pDirShowIdenticalFiles->isChecked(); + updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowDifferentFiles() { updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowFilesOnlyInA() { updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowFilesOnlyInB() { updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowFilesOnlyInC() { updateFileVisibilities(); } + +void DirectoryMergeWindow::slotSynchronizeDirectories() { } +void DirectoryMergeWindow::slotChooseNewerFiles() { } + +void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ) +{ +#include "xpm/startmerge.xpm" +#include "xpm/showequalfiles.xpm" +#include "xpm/showfilesonlyina.xpm" +#include "xpm/showfilesonlyinb.xpm" +#include "xpm/showfilesonlyinc.xpm" + DirectoryMergeWindow* p = this; + + m_pDirStartOperation = new KAction(i18n("Start/Continue Directory Merge"), Qt::Key_F7, p, SLOT(slotRunOperationForAllItems()), ac, "dir_start_operation"); + m_pDirRunOperationForCurrentItem = new KAction(i18n("Run Operation for Current Item"), Qt::Key_F6, p, SLOT(slotRunOperationForCurrentItem()), ac, "dir_run_operation_for_current_item"); + m_pDirCompareCurrent = new KAction(i18n("Compare Selected File"), 0, p, SLOT(compareCurrentFile()), ac, "dir_compare_current"); + m_pDirMergeCurrent = new KAction(i18n("Merge Current File"), 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"); + m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, p, SLOT(slotSaveMergeState()), ac, "dir_save_merge_state"); + m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, p, SLOT(slotLoadMergeState()), ac, "dir_load_merge_state"); + m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, p, SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere"); + m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, p, SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere"); + m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, p, SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere"); + m_pDirAutoChoiceEverywhere = new KAction(i18n("Auto-Choose Operation for All Items"), 0, p, SLOT(slotAutoChooseEverywhere()), ac, "dir_autochoose_everywhere"); + m_pDirDoNothingEverywhere = new KAction(i18n("No Operation for All Items"), 0, p, SLOT(slotNoOpEverywhere()), ac, "dir_nothing_everywhere"); + +// m_pDirSynchronizeDirectories = new KToggleAction(i18n("Synchronize Directories"), 0, this, SLOT(slotSynchronizeDirectories()), ac, "dir_synchronize_directories"); +// m_pDirChooseNewerFiles = new KToggleAction(i18n("Copy Newer Files Instead of Merging"), 0, this, SLOT(slotChooseNewerFiles()), ac, "dir_choose_newer_files"); + + m_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), 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"), 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 ); + + m_pDirCompareExplicit = new KAction(i18n("Compare Explicitly Selected Files"), 0, p, SLOT(slotCompareExplicitlySelectedFiles()), ac, "dir_compare_explicitly_selected_files"); + m_pDirMergeExplicit = new KAction(i18n("Merge Explicitly Selected Files"), 0, p, SLOT(slotMergeExplicitlySelectedFiles()), ac, "dir_merge_explicitly_selected_files"); + + m_pDirCurrentDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_do_nothing"); + m_pDirCurrentChooseA = new KAction(i18n("A"), 0, p, SLOT(slotCurrentChooseA()), ac, "dir_current_choose_a"); + m_pDirCurrentChooseB = new KAction(i18n("B"), 0, p, SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b"); + m_pDirCurrentChooseC = new KAction(i18n("C"), 0, p, SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c"); + m_pDirCurrentMerge = new KAction(i18n("Merge"), 0, p, SLOT(slotCurrentMerge()), ac, "dir_current_merge"); + m_pDirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, p, SLOT(slotCurrentDelete()), ac, "dir_current_delete"); + + m_pDirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing"); + m_pDirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, p, SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" ); + m_pDirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, p, SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" ); + m_pDirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, p, SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a"); + m_pDirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, p, SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b"); + m_pDirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, p, SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b"); + m_pDirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, p, SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a"); + m_pDirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, p, SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b"); + m_pDirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, p, SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b"); + + +} + + +void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, + KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ) +{ + m_pDirStartOperation->setEnabled( bDirCompare ); + m_pDirRunOperationForCurrentItem->setEnabled( bDirCompare ); + m_pDirFoldAll->setEnabled( bDirCompare ); + m_pDirUnfoldAll->setEnabled( bDirCompare ); + + m_pDirCompareCurrent->setEnabled( bDirCompare && isVisible() && isFileSelected() ); + + m_pDirMergeCurrent->setEnabled( bDirCompare && isVisible() && isFileSelected() + || bDiffWindowVisible ); + + m_pDirRescan->setEnabled( bDirCompare ); + + m_pDirAutoChoiceEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirDoNothingEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirChooseAEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirChooseBEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirChooseCEverywhere->setEnabled( bDirCompare && isVisible() ); + + bool bThreeDirs = m_dirC.isValid(); + + QTreeWidgetItem* lvi = currentItem(); + DirMergeItem* pDMI = lvi==0 ? 0 : static_cast(lvi); + MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; + + bool bItemActive = bDirCompare && isVisible() && pMFI!=0;// && hasFocus(); + bool bMergeMode = bThreeDirs || !m_bSyncMode; + bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI); + + bool bDirWindowHasFocus = isVisible() && hasFocus(); + + m_pDirShowIdenticalFiles->setEnabled( bDirCompare && isVisible() ); + m_pDirShowDifferentFiles->setEnabled( bDirCompare && isVisible() ); + m_pDirShowFilesOnlyInA->setEnabled( bDirCompare && isVisible() ); + m_pDirShowFilesOnlyInB->setEnabled( bDirCompare && isVisible() ); + m_pDirShowFilesOnlyInC->setEnabled( bDirCompare && isVisible() && bThreeDirs ); + + m_pDirCompareExplicit->setEnabled( bDirCompare && isVisible() && m_pSelection2Item!=0 ); + m_pDirMergeExplicit->setEnabled( bDirCompare && isVisible() && m_pSelection2Item!=0 ); + + m_pDirCurrentDoNothing->setEnabled( bItemActive && bMergeMode ); + m_pDirCurrentChooseA->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInA ); + m_pDirCurrentChooseB->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInB ); + m_pDirCurrentChooseC->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInC ); + m_pDirCurrentMerge->setEnabled( bItemActive && bMergeMode && !bFTConflict ); + m_pDirCurrentDelete->setEnabled( bItemActive && bMergeMode ); + if ( bDirWindowHasFocus ) + { + chooseA->setEnabled( bItemActive && pMFI->m_bExistsInA ); + chooseB->setEnabled( bItemActive && pMFI->m_bExistsInB ); + chooseC->setEnabled( bItemActive && pMFI->m_bExistsInC ); + chooseA->setChecked( false ); + chooseB->setChecked( false ); + chooseC->setChecked( false ); + } + + m_pDirCurrentSyncDoNothing->setEnabled( bItemActive && !bMergeMode ); + m_pDirCurrentSyncCopyAToB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA ); + m_pDirCurrentSyncCopyBToA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB ); + m_pDirCurrentSyncDeleteA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA ); + m_pDirCurrentSyncDeleteB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB ); + m_pDirCurrentSyncDeleteAAndB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB && pMFI->m_bExistsInB ); + m_pDirCurrentSyncMergeToA->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); + m_pDirCurrentSyncMergeToB->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); + m_pDirCurrentSyncMergeToAAndB->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); +} + + +//#include "directorymergewindow.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/directorymergewindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/directorymergewindow.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,356 @@ +/*************************************************************************** + directorymergewindow.h + ------------------- + begin : Sat Oct 19 2002 + copyright : (C) 2002-2005 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef DIRECTORY_MERGE_WINDOW_H +#define DIRECTORY_MERGE_WINDOW_H + +#include +#include +#include +#include "common.h" +#include "fileaccess.h" +#include "diff.h" //TotalDiffStatus + +class OptionDialog; +class KIconLoader; +class StatusInfo; +class DirectoryMergeInfo; +class OneDirectoryInfo; +class QLabel; +class KAction; +class KToggleAction; +class KActionCollection; +class TotalDiffStatus; + +enum e_MergeOperation +{ + eTitleId, + eNoOperation, + // Operations in sync mode (with only two directories): + eCopyAToB, eCopyBToA, eDeleteA, eDeleteB, eDeleteAB, eMergeToA, eMergeToB, eMergeToAB, + + // Operations in merge mode (with two or three directories) + eCopyAToDest, eCopyBToDest, eCopyCToDest, eDeleteFromDest, eMergeABCToDest, + eMergeABToDest, + eConflictingFileTypes, // Error + eConflictingAges // Equal age but files are not! +}; + +class DirMergeItem; + +enum e_Age { eNew, eMiddle, eOld, eNotThere, eAgeEnd }; + +class MergeFileInfos +{ +public: + MergeFileInfos(){ m_bEqualAB=false; m_bEqualAC=false; m_bEqualBC=false; + m_pDMI=0; m_pParent=0; + m_bExistsInA=false;m_bExistsInB=false;m_bExistsInC=false; + m_bDirA=false; m_bDirB=false; m_bDirC=false; + m_bLinkA=false; m_bLinkB=false; m_bLinkC=false; + m_bOperationComplete=false; m_bSimOpComplete = false; + m_eMergeOperation=eNoOperation; + m_ageA = eNotThere; m_ageB=eNotThere; m_ageC=eNotThere; + m_bConflictingAges=false; } + bool operator>( const MergeFileInfos& ); + QString m_subPath; + + bool m_bExistsInA; + bool m_bExistsInB; + bool m_bExistsInC; + bool m_bEqualAB; + bool m_bEqualAC; + bool m_bEqualBC; + DirMergeItem* m_pDMI; + MergeFileInfos* m_pParent; + e_MergeOperation m_eMergeOperation; + void setMergeOperation( e_MergeOperation eMOp ); + bool m_bDirA; + bool m_bDirB; + bool m_bDirC; + bool m_bLinkA; + bool m_bLinkB; + bool m_bLinkC; + bool m_bOperationComplete; + bool m_bSimOpComplete; + e_Age m_ageA; + e_Age m_ageB; + e_Age m_ageC; + bool m_bConflictingAges; // Equal age but files are not! + + FileAccess m_fileInfoA; + FileAccess m_fileInfoB; + FileAccess m_fileInfoC; + + TotalDiffStatus m_totalDiffStatus; +}; + +class DirMergeItem : public QTreeWidgetItem +{ +public: + DirMergeItem( QTreeWidget* pParent, const QString&, MergeFileInfos*); + DirMergeItem( DirMergeItem* pParent, const QString&, MergeFileInfos*); + ~DirMergeItem(); + MergeFileInfos* m_pMFI; + virtual bool operator<( const QTreeWidgetItem& other ) const; + //virtual void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ); + void init(MergeFileInfos* pMFI); +}; + +class DirectoryMergeWindow : public QTreeWidget +{ + Q_OBJECT +public: + DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ); + ~DirectoryMergeWindow(); + void setDirectoryMergeInfo(DirectoryMergeInfo* p){ m_pDirectoryMergeInfo=p; } + bool init( + FileAccess& dirA, + FileAccess& dirB, + FileAccess& dirC, + FileAccess& dirDest, + bool bDirectoryMerge + ); + bool isFileSelected(); + void allowResizeEvents(bool bAllowResizeEvents); + bool isDirectoryMergeInProgress() { return m_bRealMergeStarted; } + int totalColumnWidth(); + bool isSyncMode() { return m_bSyncMode; } + bool isScanning() { return m_bScanning; } + void initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ); + void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, + KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ); + void updateFileVisibilities(); + + virtual void mousePressEvent( QMouseEvent* e ); + virtual void keyPressEvent( QKeyEvent* e ); + virtual void focusInEvent( QFocusEvent* e ); + virtual void focusOutEvent( QFocusEvent* e ); + virtual void contextMenuEvent( QContextMenuEvent* e ); + QString getDirNameA(){ return m_dirA.prettyAbsPath(); } + QString getDirNameB(){ return m_dirB.prettyAbsPath(); } + QString getDirNameC(){ return m_dirC.prettyAbsPath(); } + QString getDirNameDest(){ return m_dirDest.prettyAbsPath(); } + +public slots: + void reload(); + void mergeCurrentFile(); + void compareCurrentFile(); + void slotRunOperationForAllItems(); + void slotRunOperationForCurrentItem(); + void mergeResultSaved(const QString& fileName); + void slotChooseAEverywhere(); + void slotChooseBEverywhere(); + void slotChooseCEverywhere(); + void slotAutoChooseEverywhere(); + void slotNoOpEverywhere(); + void slotFoldAllSubdirs(); + void slotUnfoldAllSubdirs(); + void slotShowIdenticalFiles(); + void slotShowDifferentFiles(); + void slotShowFilesOnlyInA(); + void slotShowFilesOnlyInB(); + void slotShowFilesOnlyInC(); + + void slotSynchronizeDirectories(); + void slotChooseNewerFiles(); + + void slotCompareExplicitlySelectedFiles(); + void slotMergeExplicitlySelectedFiles(); + + // Merge current item (merge mode) + void slotCurrentDoNothing(); + void slotCurrentChooseA(); + void slotCurrentChooseB(); + void slotCurrentChooseC(); + void slotCurrentMerge(); + void slotCurrentDelete(); + // Sync current item + void slotCurrentCopyAToB(); + void slotCurrentCopyBToA(); + void slotCurrentDeleteA(); + void slotCurrentDeleteB(); + void slotCurrentDeleteAAndB(); + void slotCurrentMergeToA(); + void slotCurrentMergeToB(); + void slotCurrentMergeToAAndB(); + + void slotSaveMergeState(); + void slotLoadMergeState(); + +protected: + class DirMergeItemDelegate; + void mergeContinue( bool bStart, bool bVerbose ); + void resizeEvent(QResizeEvent* e); + bool m_bAllowResizeEvents; + + void prepareListView(ProgressProxy& pp); + void calcSuggestedOperation( MergeFileInfos& mfi, e_MergeOperation eDefaultOperation ); + void setAllMergeOperations( e_MergeOperation eDefaultOperation ); + friend class MergeFileInfos; + + bool canContinue(); + void prepareMergeStart( QTreeWidgetItem* pBegin, QTreeWidgetItem* pEnd, bool bVerbose ); + bool executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ); + + void scanDirectory( const QString& dirName, t_DirectoryList& dirList ); + void scanLocalDirectory( const QString& dirName, t_DirectoryList& dirList ); + void fastFileComparison( FileAccess& fi1, FileAccess& fi2, + bool& bEqual, bool& bError, QString& status ); + void compareFilesAndCalcAges( MergeFileInfos& mfi ); + + QString fullNameA( const MergeFileInfos& mfi ) + { return m_dirA.absFilePath() + "/" + mfi.m_subPath; } + QString fullNameB( const MergeFileInfos& mfi ) + { return m_dirB.absFilePath() + "/" + mfi.m_subPath; } + QString fullNameC( const MergeFileInfos& mfi ) + { return m_dirC.absFilePath() + "/" + mfi.m_subPath; } + QString fullNameDest( const MergeFileInfos& mfi ) + { return m_dirDestInternal.absFilePath() + "/" + mfi.m_subPath; } + + bool copyFLD( const QString& srcName, const QString& destName ); + bool deleteFLD( const QString& name, bool bCreateBackup ); + bool makeDir( const QString& name, bool bQuiet=false ); + bool renameFLD( const QString& srcName, const QString& destName ); + bool mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC, + const QString& nameDest, bool& bSingleFileMerge ); + + FileAccess m_dirA; + FileAccess m_dirB; + FileAccess m_dirC; + FileAccess m_dirDest; + FileAccess m_dirDestInternal; + + QString m_dirMergeStateFilename; + + std::map m_fileMergeMap; + + bool m_bFollowDirLinks; + bool m_bFollowFileLinks; + bool m_bSimulatedMergeStarted; + bool m_bRealMergeStarted; + bool m_bError; + bool m_bSyncMode; + bool m_bDirectoryMerge; // if true, then merge is the default operation, otherwise it's diff. + bool m_bCaseSensitive; + + bool m_bScanning; // true while in init() + + OptionDialog* m_pOptions; + KIconLoader* m_pIconLoader; + DirectoryMergeInfo* m_pDirectoryMergeInfo; + StatusInfo* m_pStatusInfo; + + typedef std::list MergeItemList; + MergeItemList m_mergeItemList; + MergeItemList::iterator m_currentItemForOperation; + + DirMergeItem* m_pSelection1Item; + int m_selection1Column; + DirMergeItem* m_pSelection2Item; + int m_selection2Column; + DirMergeItem* m_pSelection3Item; + int m_selection3Column; + void selectItemAndColumn(DirMergeItem* pDMI, int c, bool bContextMenu); + friend class DirMergeItem; + + KAction* m_pDirStartOperation; + KAction* m_pDirRunOperationForCurrentItem; + KAction* m_pDirCompareCurrent; + KAction* m_pDirMergeCurrent; + KAction* m_pDirRescan; + KAction* m_pDirChooseAEverywhere; + KAction* m_pDirChooseBEverywhere; + KAction* m_pDirChooseCEverywhere; + KAction* m_pDirAutoChoiceEverywhere; + KAction* m_pDirDoNothingEverywhere; + KAction* m_pDirFoldAll; + KAction* m_pDirUnfoldAll; + + KToggleAction* m_pDirShowIdenticalFiles; + KToggleAction* m_pDirShowDifferentFiles; + KToggleAction* m_pDirShowFilesOnlyInA; + KToggleAction* m_pDirShowFilesOnlyInB; + KToggleAction* m_pDirShowFilesOnlyInC; + + KToggleAction* m_pDirSynchronizeDirectories; + KToggleAction* m_pDirChooseNewerFiles; + + KAction* m_pDirCompareExplicit; + KAction* m_pDirMergeExplicit; + + KAction* m_pDirCurrentDoNothing; + KAction* m_pDirCurrentChooseA; + KAction* m_pDirCurrentChooseB; + KAction* m_pDirCurrentChooseC; + KAction* m_pDirCurrentMerge; + KAction* m_pDirCurrentDelete; + + KAction* m_pDirCurrentSyncDoNothing; + KAction* m_pDirCurrentSyncCopyAToB; + KAction* m_pDirCurrentSyncCopyBToA; + KAction* m_pDirCurrentSyncDeleteA; + KAction* m_pDirCurrentSyncDeleteB; + KAction* m_pDirCurrentSyncDeleteAAndB; + KAction* m_pDirCurrentSyncMergeToA; + KAction* m_pDirCurrentSyncMergeToB; + KAction* m_pDirCurrentSyncMergeToAAndB; + + KAction* m_pDirSaveMergeState; + KAction* m_pDirLoadMergeState; +signals: + void startDiffMerge(QString fn1,QString fn2, QString fn3, QString ofn, QString,QString,QString,TotalDiffStatus*); + void checkIfCanContinue( bool* pbContinue ); + void updateAvailabilities(); + void statusBarMessage( const QString& msg ); +protected slots: + void onDoubleClick( QTreeWidgetItem* lvi ); + void onCurrentChanged(QTreeWidgetItem*); + void onExpanded(); +}; + +class DirectoryMergeInfo : public QFrame +{ + Q_OBJECT +public: + DirectoryMergeInfo( QWidget* pParent ); + void setInfo( + const FileAccess& APath, + const FileAccess& BPath, + const FileAccess& CPath, + const FileAccess& DestPath, + MergeFileInfos& mfi ); + QTreeWidget* getInfoList() {return m_pInfoList;} + virtual bool eventFilter( QObject* o, QEvent* e ); +signals: + void gotFocus(); +private: + QLabel* m_pInfoA; + QLabel* m_pInfoB; + QLabel* m_pInfoC; + QLabel* m_pInfoDest; + + QLabel* m_pA; + QLabel* m_pB; + QLabel* m_pC; + QLabel* m_pDest; + + QTreeWidget* m_pInfoList; +}; + + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/directorymergewindow_old.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/directorymergewindow_old.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2983 @@ +/*************************************************************************** + directorymergewindow.cpp + ----------------- + begin : Sat Oct 19 2002 + copyright : (C) 2002-2005 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "directorymergewindow.h" +#include "optiondialog.h" +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +//#include + +static bool conflictingFileTypes(MergeFileInfos& mfi); +/* +class StatusInfo : public QListView +{ +public: + StatusInfo(QWidget* pParent) : QListView( pParent, "StatusInfo", Qt::WShowModal ) + { + addColumn(""); + setSorting(-1); //disable sorting + } + + QListViewItem* m_pLast; + QListViewItem* last() + { + if (firstChild()==0) return 0; + else return m_pLast; + } + + void addText(const QString& s ) + { + if (firstChild()==0) m_pLast = new QListViewItem( this, s ); + else m_pLast = new QListViewItem( this, last(), s ); + } +}; +*/ +class StatusInfo : public QTextEdit +{ +public: + StatusInfo(QWidget* pParent) : QTextEdit( pParent, "StatusInfo" ) + { + setWindowFlags(Qt::Dialog); + setWordWrapMode(QTextOption::NoWrap); + setReadOnly(true); + showMaximized(); + } + + bool isEmpty(){ return text().isEmpty(); } + + void addText(const QString& s ) + { + append(s); + } + + void show() + { + moveCursor ( QTextCursor::End ); + ensureCursorVisible(); + + QTextEdit::show(); + } +}; + + +class TempRemover +{ +public: + TempRemover( const QString& origName, FileAccess& fa ); + ~TempRemover(); + QString name() { return m_name; } + bool success() { return m_bSuccess; } +private: + QString m_name; + bool m_bTemp; + bool m_bSuccess; +}; +TempRemover::TempRemover(const QString& origName, FileAccess& fa) +{ + if ( fa.isLocal() ) + { + m_name = origName; + m_bTemp = false; + m_bSuccess = true; + } + else + { + m_name = FileAccess::tempFileName(); + m_bSuccess = fa.copyFile( m_name ); + m_bTemp = m_bSuccess; + } +} +TempRemover::~TempRemover() +{ + if ( m_bTemp && ! m_name.isEmpty() ) + FileAccess::removeTempFile(m_name); +} + +void DirectoryMergeWindow::fastFileComparison( + FileAccess& fi1, FileAccess& fi2, + bool& bEqual, bool& bError, QString& status ) +{ + ProgressProxy pp; + status = ""; + bEqual = false; + bError = true; + + if ( !m_bFollowFileLinks ) + { + if ( fi1.isSymLink() != fi2.isSymLink() ) + { + status = i18n("Mix of links and normal files."); + return; + } + else if ( fi1.isSymLink() && fi2.isSymLink() ) + { + bError = false; + bEqual = fi1.readLink() == fi2.readLink(); + status = i18n("Link: "); + return; + } + } + + if ( fi1.size()!=fi2.size() ) + { + bEqual = false; + status = i18n("Size. "); + return; + } + else if ( m_pOptions->m_bDmTrustSize ) + { + bEqual = true; + return; + } + + if ( m_pOptions->m_bDmTrustDate ) + { + bEqual = ( fi1.lastModified() == fi2.lastModified() && fi1.size()==fi2.size() ); + bError = false; + status = i18n("Date & Size: "); + return; + } + + QString fileName1 = fi1.absFilePath(); + QString fileName2 = fi2.absFilePath(); + TempRemover tr1( fileName1, fi1 ); + if ( !tr1.success() ) + { + status = i18n("Creating temp copy of %1 failed.").arg(fileName1); + return; + } + TempRemover tr2( fileName2, fi2 ); + if ( !tr2.success() ) + { + status = i18n("Creating temp copy of %1 failed.").arg(fileName2); + return; + } + + std::vector buf1(100000); + std::vector buf2(buf1.size()); + + QFile file1( tr1.name() ); + + if ( ! file1.open(QIODevice::ReadOnly) ) + { + status = i18n("Opening %1 failed.").arg(fileName1); + return; + } + + QFile file2( tr2.name() ); + + if ( ! file2.open(QIODevice::ReadOnly) ) + { + status = i18n("Opening %1 failed.").arg(fileName2); + return; + } + + pp.setInformation( i18n("Comparing file..."), 0, false ); + typedef QFile::Offset t_FileSize; + t_FileSize fullSize = file1.size(); + t_FileSize sizeLeft = fullSize; + + while( sizeLeft>0 && ! pp.wasCancelled() ) + { + int len = min2( sizeLeft, (t_FileSize)buf1.size() ); + if( len != file1.readBlock( &buf1[0], len ) ) + { + status = i18n("Error reading from %1").arg(fileName1); + return; + } + + if( len != file2.readBlock( &buf2[0], len ) ) + { + status = i18n("Error reading from %1").arg(fileName2); + return; + } + + if ( memcmp( &buf1[0], &buf2[0], len ) != 0 ) + { + bError = false; + return; + } + sizeLeft-=len; + pp.setCurrent(double(fullSize-sizeLeft)/fullSize, false ); + } + + // If the program really arrives here, then the files are really equal. + bError = false; + bEqual = true; +} + + + + + +static int s_nameCol = 0; +static int s_ACol = 1; +static int s_BCol = 2; +static int s_CCol = 3; +static int s_OpCol = 4; +static int s_OpStatusCol = 5; +static int s_UnsolvedCol = 6; // Nr of unsolved conflicts (for 3 input files) +static int s_SolvedCol = 7; // Nr of auto-solvable conflicts (for 3 input files) +static int s_NonWhiteCol = 8; // Nr of nonwhite deltas (for 2 input files) +static int s_WhiteCol = 9; // Nr of white deltas (for 2 input files) +DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ) + : Q3ListView( pParent ) +{ + 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; + m_bAllowResizeEvents = true; + m_bSimulatedMergeStarted=false; + m_bRealMergeStarted=false; + m_bError = false; + m_bSyncMode = false; + m_pStatusInfo = new StatusInfo(0); + m_pStatusInfo->hide(); + m_bScanning = false; + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + m_bCaseSensitive = true; + + addColumn(i18n("Name")); + addColumn("A"); + addColumn("B"); + addColumn("C"); + addColumn(i18n("Operation")); + addColumn(i18n("Status")); + addColumn(i18n("Unsolved")); + addColumn(i18n("Solved")); + addColumn(i18n("Nonwhite")); + addColumn(i18n("White")); + + setColumnAlignment( s_UnsolvedCol, Qt::AlignRight ); + setColumnAlignment( s_SolvedCol, Qt::AlignRight ); + setColumnAlignment( s_NonWhiteCol, Qt::AlignRight ); + setColumnAlignment( s_WhiteCol, Qt::AlignRight ); +} + +DirectoryMergeWindow::~DirectoryMergeWindow() +{ +} + + +int DirectoryMergeWindow::totalColumnWidth() +{ + int w=0; + for (int i=0; iconvertToImage().convertDepth(32); + QImage img2 = pm2->convertToImage().convertDepth(32); + + for (int y = 0; y < img1.height(); y++) + { + Q_UINT32 *line1 = reinterpret_cast(img1.scanLine(y)); + Q_UINT32 *line2 = reinterpret_cast(img2.scanLine(y)); + for (int x = 0; x < img1.width(); x++) + { + if ( qAlpha( line2[x] ) >0 ) + line1[x] = (line2[x] | 0xff000000); + } + } + QPixmap pix; + pix.convertFromImage(img1); + return pix; +} + +// like pixCombiner but let the pm1 color shine through +static QPixmap pixCombiner2( const QPixmap* pm1, const QPixmap* pm2 ) +{ + QImage img1 = pm1->convertToImage().convertDepth(32); + QImage img2 = pm2->convertToImage().convertDepth(32); + + for (int y = 0; y < img1.height(); y++) + { + Q_UINT32 *line1 = reinterpret_cast(img1.scanLine(y)); + Q_UINT32 *line2 = reinterpret_cast(img2.scanLine(y)); + for (int x = 0; x < img1.width(); x++) + { + if ( qAlpha( line2[x] ) >0 ) + { + int r = ( qRed( line1[x] ) + qRed( line2[x] ))/2; + int g = ( qGreen( line1[x] ) + qGreen( line2[x] ))/2; + int b = ( qBlue( line1[x] ) + qBlue( line2[x] ))/2; + line1[x] = qRgba( r,g,b, 0xff ); + } + } + } + QPixmap pix; + pix.convertFromImage(img1); + return pix; +} + +static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles, + int& nofDirs, int& nofEqualFiles, int& nofManualMerges ) +{ + if ( i->m_pMFI->m_bDirA || i->m_pMFI->m_bDirB || i->m_pMFI->m_bDirC ) + { + ++nofDirs; + } + else + { + ++nofFiles; + if ( i->m_pMFI->m_bEqualAB && (!bThreeDirs || i->m_pMFI->m_bEqualAC )) + { + ++nofEqualFiles; + } + else + { + if ( i->m_pMFI->m_eMergeOperation==eMergeABCToDest || i->m_pMFI->m_eMergeOperation==eMergeABToDest ) + ++nofManualMerges; + } + } + for( Q3ListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() ) + calcDirStatus( bThreeDirs, static_cast(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); +} + +static QString sortString(const QString& s, bool bCaseSensitive) +{ + if (bCaseSensitive) + return s; + else + return s.upper(); +} + +bool DirectoryMergeWindow::init + ( + FileAccess& dirA, + FileAccess& dirB, + FileAccess& dirC, + FileAccess& dirDest, + bool bDirectoryMerge + ) +{ + if ( m_pOptions->m_bDmFullAnalysis ) + { + // 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; + m_bFollowDirLinks = m_pOptions->m_bDmFollowDirLinks; + m_bFollowFileLinks = m_pOptions->m_bDmFollowFileLinks; + m_bSimulatedMergeStarted=false; + m_bRealMergeStarted=false; + m_bError=false; + m_bDirectoryMerge = bDirectoryMerge; + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + m_bCaseSensitive = m_pOptions->m_bDmCaseSensitiveFilenameComparison; + + clear(); + + m_mergeItemList.clear(); + m_currentItemForOperation = m_mergeItemList.end(); + + m_dirA = dirA; + m_dirB = dirB; + m_dirC = dirC; + m_dirDest = dirDest; + + m_pDirShowIdenticalFiles->setChecked(true); + m_pDirShowDifferentFiles->setChecked(true); + m_pDirShowFilesOnlyInA->setChecked(true); + m_pDirShowFilesOnlyInB->setChecked(true); + m_pDirShowFilesOnlyInC->setChecked(true); + + // Check if all input directories exist and are valid. The dest dir is not tested now. + // The test will happen only when we are going to write to it. + if ( !m_dirA.isDir() || !m_dirB.isDir() || + (m_dirC.isValid() && !m_dirC.isDir()) ) + { + QString text( i18n("Opening of directories failed:") ); + text += "\n\n"; + if ( !dirA.isDir() ) + { text += i18n("Dir A \"%1\" does not exist or is not a directory.\n").arg(m_dirA.prettyAbsPath()); } + + if ( !dirB.isDir() ) + { text += i18n("Dir B \"%1\" does not exist or is not a directory.\n").arg(m_dirB.prettyAbsPath()); } + + if ( m_dirC.isValid() && !m_dirC.isDir() ) + { text += i18n("Dir C \"%1\" does not exist or is not a directory.\n").arg(m_dirC.prettyAbsPath()); } + + KMessageBox::sorry( this, text, i18n("Directory Open Error") ); + return false; + } + + if ( m_dirC.isValid() && + (m_dirDest.prettyAbsPath() == m_dirA.prettyAbsPath() || m_dirDest.prettyAbsPath()==m_dirB.prettyAbsPath() ) ) + { + KMessageBox::error(this, + i18n( "The destination directory must not be the same as A or B when " + "three directories are merged.\nCheck again before continuing."), + i18n("Parameter Warning")); + return false; + } + + m_bScanning = true; + statusBarMessage(i18n("Scanning directories...")); + + m_bSyncMode = m_pOptions->m_bDmSyncMode && !m_dirC.isValid() && !m_dirDest.isValid(); + + if ( m_dirDest.isValid() ) + m_dirDestInternal = m_dirDest; + else + m_dirDestInternal = m_dirC.isValid() ? m_dirC : m_dirB; + + QString origCurrentDirectory = QDir::currentDirPath(); + + m_fileMergeMap.clear(); + t_DirectoryList::iterator i; + + // calc how many directories will be read: + double nofScans = ( m_dirA.isValid() ? 1 : 0 )+( m_dirB.isValid() ? 1 : 0 )+( m_dirC.isValid() ? 1 : 0 ); + int currentScan = 0; + + 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 ); + setColumnWidth( s_NonWhiteCol, 0 ); + setColumnWidth( s_UnsolvedCol, 0 ); + setColumnWidth( s_SolvedCol, 0 ); + } + else if ( m_dirC.isValid() ) + { + setColumnWidth(s_WhiteCol, 50 ); + setColumnWidth(s_NonWhiteCol, 50 ); + setColumnWidth(s_UnsolvedCol, 50 ); + setColumnWidth(s_SolvedCol, 50 ); + } + else + { + setColumnWidth(s_WhiteCol, 50 ); + setColumnWidth(s_NonWhiteCol, 50 ); + setColumnWidth(s_UnsolvedCol, 50 ); + setColumnWidth(s_SolvedCol, 0 ); + } + + bool bListDirSuccessA = true; + bool bListDirSuccessB = true; + bool bListDirSuccessC = true; + if ( m_dirA.isValid() ) + { + pp.setInformation(i18n("Reading Directory A")); + pp.setSubRangeTransformation(currentScan/nofScans, (currentScan+1)/nofScans); + ++currentScan; + + t_DirectoryList dirListA; + bListDirSuccessA = m_dirA.listDir( &dirListA, + m_pOptions->m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, + m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, + m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, + m_pOptions->m_bDmUseCvsIgnore); + + for (i=dirListA.begin(); i!=dirListA.end();++i ) + { + MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(), m_bCaseSensitive)]; + //std::cout <filePath()<m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, + m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, + m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, + m_pOptions->m_bDmUseCvsIgnore); + + for (i=dirListB.begin(); i!=dirListB.end();++i ) + { + MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(), m_bCaseSensitive)]; + mfi.m_bExistsInB = true; + mfi.m_fileInfoB = *i; + } + } + + e_MergeOperation eDefaultMergeOp; + if ( m_dirC.isValid() ) + { + pp.setInformation(i18n("Reading Directory C")); + pp.setSubRangeTransformation(currentScan/nofScans, (currentScan+1)/nofScans); + ++currentScan; + + t_DirectoryList dirListC; + bListDirSuccessC = m_dirC.listDir( &dirListC, + m_pOptions->m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, + m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, + m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, + m_pOptions->m_bDmUseCvsIgnore); + + for (i=dirListC.begin(); i!=dirListC.end();++i ) + { + MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(),m_bCaseSensitive)]; + mfi.m_bExistsInC = true; + mfi.m_fileInfoC = *i; + } + + eDefaultMergeOp = eMergeABCToDest; + } + else + eDefaultMergeOp = m_bSyncMode ? eMergeToAB : eMergeABToDest; + + bool bContinue = true; + if ( !bListDirSuccessA || !bListDirSuccessB || !bListDirSuccessC ) + { + QString s = i18n("Some subdirectories were not readable in"); + if ( !bListDirSuccessA ) s += "\nA: " + m_dirA.prettyAbsPath(); + if ( !bListDirSuccessB ) s += "\nB: " + m_dirB.prettyAbsPath(); + if ( !bListDirSuccessC ) s += "\nC: " + m_dirC.prettyAbsPath(); + s+="\n"; + s+= i18n("Check the permissions of the subdirectories."); + bContinue = KMessageBox::Continue == KMessageBox::warningContinueCancel( this, s ); + } + + if ( bContinue ) + { + prepareListView(pp); + + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + { + DirMergeItem* pDMI = static_cast( p ); + calcSuggestedOperation( *pDMI->m_pMFI, eDefaultMergeOp ); + } + } + else + { + setSelected( 0, true ); + } + + QDir::setCurrent(origCurrentDirectory); + + // Try to improve the view a little bit. + QWidget* pParent = parentWidget(); + QSplitter* pSplitter = static_cast(pParent); + if (pSplitter!=0) + { + QList sizes = pSplitter->sizes(); + int total = sizes[0] + sizes[1]; + sizes[0]=total*6/10; + sizes[1]=total - sizes[0]; + pSplitter->setSizes( sizes ); + } + + m_bScanning = false; + statusBarMessage(i18n("Ready.")); + + if ( bContinue ) + { + // Generate a status report + int nofFiles=0; + int nofDirs=0; + int nofEqualFiles=0; + int nofManualMerges=0; + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + calcDirStatus( m_dirC.isValid(), static_cast(p), + nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); + + QString s; + s = i18n("Directory Comparison Status") + "\n\n" + + i18n("Number of subdirectories:") +" "+ QString::number(nofDirs) + "\n"+ + i18n("Number of equal files:") +" "+ QString::number(nofEqualFiles) + "\n"+ + i18n("Number of different files:") +" "+ QString::number(nofFiles-nofEqualFiles); + + if ( m_dirC.isValid() ) + s += "\n" + i18n("Number of manual merges:") +" "+ QString::number(nofManualMerges); + KMessageBox::information( this, s ); + setSelected( firstChild(), true ); + } + + return true; +} + + + +void DirectoryMergeWindow::slotChooseAEverywhere(){ setAllMergeOperations( eCopyAToDest ); } + +void DirectoryMergeWindow::slotChooseBEverywhere(){ setAllMergeOperations( eCopyBToDest ); } + +void DirectoryMergeWindow::slotChooseCEverywhere(){ setAllMergeOperations( eCopyCToDest ); } + +void DirectoryMergeWindow::slotAutoChooseEverywhere() +{ + e_MergeOperation eDefaultMergeOp = m_dirC.isValid() ? eMergeABCToDest : + m_bSyncMode ? eMergeToAB : eMergeABToDest; + setAllMergeOperations(eDefaultMergeOp ); +} + +void DirectoryMergeWindow::slotNoOpEverywhere(){ setAllMergeOperations(eNoOperation); } + +static void setListViewItemOpen( Q3ListViewItem* p, bool bOpen ) +{ + for( Q3ListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() ) + setListViewItemOpen( pChild, bOpen ); + + p->setOpen( bOpen ); +} + +void DirectoryMergeWindow::slotFoldAllSubdirs() +{ + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + setListViewItemOpen( p, false ); +} + +void DirectoryMergeWindow::slotUnfoldAllSubdirs() +{ + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + setListViewItemOpen( p, true ); +} + +static void setMergeOperation( Q3ListViewItem* pLVI, e_MergeOperation eMergeOp ) +{ + if ( pLVI==0 ) return; + + DirMergeItem* pDMI = static_cast(pLVI); + MergeFileInfos& mfi = *pDMI->m_pMFI; + + mfi.setMergeOperation(eMergeOp ); +} + +// Merge current item (merge mode) +void DirectoryMergeWindow::slotCurrentDoNothing() { setMergeOperation(currentItem(), eNoOperation ); } +void DirectoryMergeWindow::slotCurrentChooseA() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyAToB : eCopyAToDest ); } +void DirectoryMergeWindow::slotCurrentChooseB() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyBToA : eCopyBToDest ); } +void DirectoryMergeWindow::slotCurrentChooseC() { setMergeOperation(currentItem(), eCopyCToDest ); } +void DirectoryMergeWindow::slotCurrentMerge() +{ + bool bThreeDirs = m_dirC.isValid(); + setMergeOperation(currentItem(), bThreeDirs ? eMergeABCToDest : eMergeABToDest ); +} +void DirectoryMergeWindow::slotCurrentDelete() { setMergeOperation(currentItem(), eDeleteFromDest ); } +// Sync current item +void DirectoryMergeWindow::slotCurrentCopyAToB() { setMergeOperation(currentItem(), eCopyAToB ); } +void DirectoryMergeWindow::slotCurrentCopyBToA() { setMergeOperation(currentItem(), eCopyBToA ); } +void DirectoryMergeWindow::slotCurrentDeleteA() { setMergeOperation(currentItem(), eDeleteA ); } +void DirectoryMergeWindow::slotCurrentDeleteB() { setMergeOperation(currentItem(), eDeleteB ); } +void DirectoryMergeWindow::slotCurrentDeleteAAndB() { setMergeOperation(currentItem(), eDeleteAB ); } +void DirectoryMergeWindow::slotCurrentMergeToA() { setMergeOperation(currentItem(), eMergeToA ); } +void DirectoryMergeWindow::slotCurrentMergeToB() { setMergeOperation(currentItem(), eMergeToB ); } +void DirectoryMergeWindow::slotCurrentMergeToAAndB() { setMergeOperation(currentItem(), eMergeToAB ); } + + +void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e ) +{ + if ( (e->state() & Qt::ControlModifier)!=0 ) + { + bool bThreeDirs = m_dirC.isValid(); + + Q3ListViewItem* lvi = currentItem(); + DirMergeItem* pDMI = lvi==0 ? 0 : static_cast(lvi); + MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; + + if ( pMFI==0 ) return; + bool bMergeMode = bThreeDirs || !m_bSyncMode; + bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI); + + if ( bMergeMode ) + { + switch(e->key()) + { + 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; + } + } + else + { + switch(e->key()) + { + 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; + default: break; + } + } + } + + Q3ListView::keyPressEvent(e); +} + +void DirectoryMergeWindow::focusInEvent(QFocusEvent*) +{ + updateAvailabilities(); +} +void DirectoryMergeWindow::focusOutEvent(QFocusEvent*) +{ + updateAvailabilities(); +} + +void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOperation ) +{ + if ( KMessageBox::Yes == KMessageBox::warningYesNo(this, + i18n("This affects all merge operations."), + i18n("Changing All Merge Operations"),i18n("C&ontinue"), i18n("&Cancel") ) ) + { + for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) + { + DirMergeItem* pDMI = static_cast( p ); + calcSuggestedOperation( *pDMI->m_pMFI, eDefaultOperation ); + } + } +} + + +void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) +{ + std::map dateMap; + + if( mfi.m_bExistsInA ) + { + mfi.m_bLinkA = mfi.m_fileInfoA.isSymLink(); + mfi.m_bDirA = mfi.m_fileInfoA.isDir(); + dateMap[ mfi.m_fileInfoA.lastModified() ] = 0; + } + if( mfi.m_bExistsInB ) + { + mfi.m_bLinkB = mfi.m_fileInfoB.isSymLink(); + mfi.m_bDirB = mfi.m_fileInfoB.isDir(); + dateMap[ mfi.m_fileInfoB.lastModified() ] = 1; + } + if( mfi.m_bExistsInC ) + { + mfi.m_bLinkC = mfi.m_fileInfoC.isSymLink(); + mfi.m_bDirC = mfi.m_fileInfoC.isDir(); + dateMap[ mfi.m_fileInfoC.lastModified() ] = 2; + } + + if ( m_pOptions->m_bDmFullAnalysis ) + { + if( mfi.m_bExistsInA && mfi.m_bDirA || mfi.m_bExistsInB && mfi.m_bDirB || mfi.m_bExistsInC && mfi.m_bDirC ) + { + // If any input is a directory, don't start any comparison. + mfi.m_bEqualAB=mfi.m_bExistsInA && mfi.m_bExistsInB; + mfi.m_bEqualAC=mfi.m_bExistsInA && mfi.m_bExistsInC; + mfi.m_bEqualBC=mfi.m_bExistsInB && mfi.m_bExistsInC; + } + else + { + emit startDiffMerge( + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + "", + "","","",&mfi.m_totalDiffStatus + ); + 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 ) + { + if( mfi.m_bDirA ) mfi.m_bEqualAB=true; + else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoB, mfi.m_bEqualAB, bError, eqStatus ); + } + if( mfi.m_bExistsInA && mfi.m_bExistsInC ) + { + if( mfi.m_bDirA ) mfi.m_bEqualAC=true; + else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoC, mfi.m_bEqualAC, bError, eqStatus ); + } + if( mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + if (mfi.m_bEqualAB && mfi.m_bEqualAC) + mfi.m_bEqualBC = true; + else + { + if( mfi.m_bDirB ) mfi.m_bEqualBC=true; + else fastFileComparison( mfi.m_fileInfoB, mfi.m_fileInfoC, mfi.m_bEqualBC, bError, eqStatus ); + } + } + } + + if (mfi.m_bLinkA!=mfi.m_bLinkB) mfi.m_bEqualAB=false; + if (mfi.m_bLinkA!=mfi.m_bLinkC) mfi.m_bEqualAC=false; + if (mfi.m_bLinkB!=mfi.m_bLinkC) mfi.m_bEqualBC=false; + + if (mfi.m_bDirA!=mfi.m_bDirB) mfi.m_bEqualAB=false; + if (mfi.m_bDirA!=mfi.m_bDirC) mfi.m_bEqualAC=false; + if (mfi.m_bDirB!=mfi.m_bDirC) mfi.m_bEqualBC=false; + + assert(eNew==0 && eMiddle==1 && eOld==2); + + // The map automatically sorts the keys. + int age = eNew; + std::map::reverse_iterator i; + for( i=dateMap.rbegin(); i!=dateMap.rend(); ++i ) + { + int n = i->second; + if ( n==0 && mfi.m_ageA==eNotThere ) + { + mfi.m_ageA = (e_Age)age; ++age; + if ( mfi.m_bEqualAB ) { mfi.m_ageB = mfi.m_ageA; ++age; } + if ( mfi.m_bEqualAC ) { mfi.m_ageC = mfi.m_ageA; ++age; } + } + else if ( n==1 && mfi.m_ageB==eNotThere ) + { + mfi.m_ageB = (e_Age)age; ++age; + if ( mfi.m_bEqualAB ) { mfi.m_ageA = mfi.m_ageB; ++age; } + if ( mfi.m_bEqualBC ) { mfi.m_ageC = mfi.m_ageB; ++age; } + } + else if ( n==2 && mfi.m_ageC==eNotThere) + { + mfi.m_ageC = (e_Age)age; ++age; + if ( mfi.m_bEqualAC ) { mfi.m_ageA = mfi.m_ageC; ++age; } + if ( mfi.m_bEqualBC ) { mfi.m_ageB = mfi.m_ageC; ++age; } + } + } + + // The checks below are necessary when the dates of the file are equal but the + // files are not. One wouldn't expect this to happen, yet it happens sometimes. + if ( mfi.m_bExistsInC && mfi.m_ageC==eNotThere ) + { + mfi.m_ageC = (e_Age)age; ++age; + mfi.m_bConflictingAges = true; + } + if ( mfi.m_bExistsInB && mfi.m_ageB==eNotThere ) + { + mfi.m_ageB = (e_Age)age; ++age; + mfi.m_bConflictingAges = true; + } + if ( mfi.m_bExistsInA && mfi.m_ageA==eNotThere ) + { + mfi.m_ageA = (e_Age)age; ++age; + mfi.m_bConflictingAges = true; + } + + if ( mfi.m_ageA != eOld && mfi.m_ageB != eOld && mfi.m_ageC != eOld ) + { + if (mfi.m_ageA == eMiddle) mfi.m_ageA = eOld; + if (mfi.m_ageB == eMiddle) mfi.m_ageB = eOld; + if (mfi.m_ageC == eMiddle) mfi.m_ageC = eOld; + } +} + +static QPixmap* s_pm_dir; +static QPixmap* s_pm_file; + +static QPixmap* pmNotThere; +static QPixmap* pmNew; +static QPixmap* pmOld; +static QPixmap* pmMiddle; + +static QPixmap* pmLink; + +static QPixmap* pmDirLink; +static QPixmap* pmFileLink; + +static QPixmap* pmNewLink; +static QPixmap* pmOldLink; +static QPixmap* pmMiddleLink; + +static QPixmap* pmNewDir; +static QPixmap* pmMiddleDir; +static QPixmap* pmOldDir; + +static QPixmap* pmNewDirLink; +static QPixmap* pmMiddleDirLink; +static QPixmap* pmOldDirLink; + + +static QPixmap colorToPixmap(QColor c) +{ + QPixmap pm(16,16); + QPainter p(&pm); + p.setPen( Qt::black ); + p.setBrush( c ); + p.drawRect(0,0,pm.width(),pm.height()); + return pm; +} + +static void initPixmaps( QColor newest, QColor oldest, QColor middle, QColor notThere ) +{ + if (pmNew==0) + { + pmNotThere = new QPixmap; + pmNew = new QPixmap; + pmOld = new QPixmap; + pmMiddle = new QPixmap; + + #include "xpm/link_arrow.xpm" + pmLink = new QPixmap(link_arrow); + + pmDirLink = new QPixmap; + pmFileLink = new QPixmap; + + pmNewLink = new QPixmap; + pmOldLink = new QPixmap; + pmMiddleLink = new QPixmap; + + pmNewDir = new QPixmap; + pmMiddleDir = new QPixmap; + pmOldDir = new QPixmap; + + pmNewDirLink = new QPixmap; + pmMiddleDirLink = new QPixmap; + pmOldDirLink = new QPixmap; + } + + + *pmNotThere = colorToPixmap(notThere); + *pmNew = colorToPixmap(newest); + *pmOld = colorToPixmap(oldest); + *pmMiddle = colorToPixmap(middle); + + *pmDirLink = pixCombiner( s_pm_dir, pmLink); + *pmFileLink = pixCombiner( s_pm_file, pmLink ); + + *pmNewLink = pixCombiner( pmNew, pmLink); + *pmOldLink = pixCombiner( pmOld, pmLink); + *pmMiddleLink = pixCombiner( pmMiddle, pmLink); + + *pmNewDir = pixCombiner2( pmNew, s_pm_dir); + *pmMiddleDir = pixCombiner2( pmMiddle, s_pm_dir); + *pmOldDir = pixCombiner2( pmOld, s_pm_dir); + + *pmNewDirLink = pixCombiner( pmNewDir, pmLink); + *pmMiddleDirLink = pixCombiner( pmMiddleDir, pmLink); + *pmOldDirLink = pixCombiner( pmOldDir, pmLink); +} + + +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 }; + static QPixmap* ageToPmDir[]= { pmNewDir, pmMiddleDir, pmOldDir, pmNotThere, s_pm_dir }; + static QPixmap* ageToPmDirLink[]={ pmNewDirLink, pmMiddleDirLink, pmOldDirLink, pmNotThere, pmDirLink }; + + QPixmap** ppPm = bDir ? ( bLink ? ageToPmDirLink : ageToPmDir ): + ( bLink ? ageToPmLink : ageToPm ); + + pLVI->setPixmap( col, *ppPm[eAge] ); +} + +static void setPixmaps( MergeFileInfos& mfi, bool bCheckC ) +{ + setOnePixmap( mfi.m_pDMI, s_nameCol, eAgeEnd, + mfi.m_bLinkA || mfi.m_bLinkB || mfi.m_bLinkC, + mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC + ); + + if ( mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC ) + { + mfi.m_ageA=eNotThere; + mfi.m_ageB=eNotThere; + mfi.m_ageC=eNotThere; + int age = eNew; + if ( mfi.m_bExistsInC ) + { + mfi.m_ageC = (e_Age)age; + if (mfi.m_bEqualAC) mfi.m_ageA = (e_Age)age; + if (mfi.m_bEqualBC) mfi.m_ageB = (e_Age)age; + ++age; + } + if ( mfi.m_bExistsInB && mfi.m_ageB==eNotThere ) + { + mfi.m_ageB = (e_Age)age; + if (mfi.m_bEqualAB) mfi.m_ageA = (e_Age)age; + ++age; + } + if ( mfi.m_bExistsInA && mfi.m_ageA==eNotThere ) + { + mfi.m_ageA = (e_Age)age; + } + if ( mfi.m_ageA != eOld && mfi.m_ageB != eOld && mfi.m_ageC != eOld ) + { + if (mfi.m_ageA == eMiddle) mfi.m_ageA = eOld; + if (mfi.m_ageB == eMiddle) mfi.m_ageB = eOld; + if (mfi.m_ageC == eMiddle) mfi.m_ageC = eOld; + } + } + + setOnePixmap( mfi.m_pDMI, s_ACol, mfi.m_ageA, mfi.m_bLinkA, mfi.m_bDirA ); + setOnePixmap( mfi.m_pDMI, s_BCol, mfi.m_ageB, mfi.m_bLinkB, mfi.m_bDirB ); + if ( bCheckC ) + setOnePixmap( mfi.m_pDMI, s_CCol, mfi.m_ageC, mfi.m_bLinkC, mfi.m_bDirC ); +} + +// Iterate through the complete tree. Start by specifying QListView::firstChild(). +static Q3ListViewItem* treeIterator( Q3ListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false ) +{ + if( p!=0 ) + { + do + { + if ( bVisitChildren && p->firstChild() != 0 ) p = p->firstChild(); + else if ( p->nextSibling() !=0 ) p = p->nextSibling(); + else + { + p = p->parent(); + while ( p!=0 ) + { + if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; } + else { p = p->parent(); } + } + } + } + while( p && !(p->isVisible() || bFindInvisible) ); + } + return p; +} + +void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) +{ + static bool bFirstTime = true; + if (bFirstTime) + { + #include "xpm/file.xpm" + #include "xpm/folder.xpm" + s_pm_dir = new QPixmap( m_pIconLoader->loadIcon("folder", KIcon::Small ) ); + if (s_pm_dir->size()!=QSize(16,16)) + { + delete s_pm_dir; + s_pm_dir = new QPixmap( folder_pm ); + } + s_pm_file= new QPixmap( file_pm ); + bFirstTime=false; + } + + clear(); + initPixmaps( m_pOptions->m_newestFileColor, m_pOptions->m_oldestFileColor, + m_pOptions->m_midAgeFileColor, m_pOptions->m_missingFileColor ); + + setRootIsDecorated( true ); + + bool bCheckC = m_dirC.isValid(); + + std::map::iterator j; + int nrOfFiles = m_fileMergeMap.size(); + int currentIdx = 1; + QTime t; + t.start(); + for( j=m_fileMergeMap.begin(); j!=m_fileMergeMap.end(); ++j ) + { + MergeFileInfos& mfi = j->second; + + mfi.m_subPath = mfi.m_fileInfoA.exists() ? mfi.m_fileInfoA.filePath() : + mfi.m_fileInfoB.exists() ? mfi.m_fileInfoB.filePath() : + mfi.m_fileInfoC.exists() ? mfi.m_fileInfoC.filePath() : + QString(""); + + // const QString& fileName = j->first; + const QString& fileName = mfi.m_subPath; + + pp.setInformation( + i18n("Processing ") + QString::number(currentIdx) +" / "+ QString::number(nrOfFiles) + +"\n" + fileName, double(currentIdx) / nrOfFiles, false ); + if ( pp.wasCancelled() ) break; + ++currentIdx; + + + // The comparisons and calculations for each file take place here. + compareFilesAndCalcAges( mfi ); + + bool bEqual = bCheckC ? mfi.m_bEqualAB && mfi.m_bEqualAC : mfi.m_bEqualAB; + //bool bDir = mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC; + + //if ( m_pOptions->m_bDmShowOnlyDeltas && !bDir && bEqual ) + // continue; + + // Get dirname from fileName: Search for "/" from end: + int pos = fileName.findRev('/'); + QString dirPart; + QString filePart; + if (pos==-1) + { + // Top dir + filePart = fileName; + } + else + { + dirPart = fileName.left(pos); + filePart = fileName.mid(pos+1); + } + + if ( dirPart.isEmpty() ) // Top level + { + new DirMergeItem( this, filePart, &mfi ); + } + else + { + MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // parent + assert(dirMfi.m_pDMI!=0); + new DirMergeItem( dirMfi.m_pDMI, filePart, &mfi ); + mfi.m_pParent = &dirMfi; + + if ( !bEqual ) // Set all parents to "not equal" + { + MergeFileInfos* p = mfi.m_pParent; + while(p!=0) + { + bool bChange = false; + if ( !mfi.m_bEqualAB && p->m_bEqualAB ){ p->m_bEqualAB = false; bChange=true; } + if ( !mfi.m_bEqualAC && p->m_bEqualAC ){ p->m_bEqualAC = false; bChange=true; } + if ( !mfi.m_bEqualBC && p->m_bEqualBC ){ p->m_bEqualBC = false; bChange=true; } + + if ( bChange ) + setPixmaps( *p, bCheckC ); + else + break; + + p = p->m_pParent; + } + } + } + + setPixmaps( mfi, bCheckC ); + } + + /*if ( m_pOptions->m_bDmShowOnlyDeltas ) + { + // Remove all equals. (Search tree depth first) + QListViewItem* p = firstChild(); + while( p!=0 && firstChild() != 0 ) + { + QListViewItem* pParent = p->parent(); + QListViewItem* pNextSibling = p->nextSibling(); + + DirMergeItem* pDMI = static_cast(p); + bool bDirEqual = bCheckC ? pDMI->m_pMFI->m_bEqualAB && pDMI->m_pMFI->m_bEqualAC + : pDMI->m_pMFI->m_bEqualAB; + if ( pDMI!=0 && pDMI->m_pMFI->m_bDirA && bDirEqual ) + { + delete p; + p=0; + } + + if ( p!=0 && p->firstChild() != 0 ) p = p->firstChild(); + else if ( pNextSibling!=0 ) p = pNextSibling; + else + { + p=pParent; + while ( p!=0 ) + { + if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; } + else { p = p->parent(); } + } + } + } + }*/ +} + +static bool conflictingFileTypes(MergeFileInfos& mfi) +{ + // Now check if file/dir-types fit. + if ( mfi.m_bLinkA || mfi.m_bLinkB || mfi.m_bLinkC ) + { + if ( mfi.m_bExistsInA && ! mfi.m_bLinkA || + mfi.m_bExistsInB && ! mfi.m_bLinkB || + mfi.m_bExistsInC && ! mfi.m_bLinkC ) + { + return true; + } + } + + if ( mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC ) + { + if ( mfi.m_bExistsInA && ! mfi.m_bDirA || + mfi.m_bExistsInB && ! mfi.m_bDirB || + mfi.m_bExistsInC && ! mfi.m_bDirC ) + { + return true; + } + } + return false; +} + +void DirectoryMergeWindow::calcSuggestedOperation( MergeFileInfos& mfi, e_MergeOperation eDefaultMergeOp ) +{ + bool bCheckC = m_dirC.isValid(); + bool bCopyNewer = m_pOptions->m_bDmCopyNewer; + + if ( eDefaultMergeOp == eMergeABCToDest && !bCheckC ) { eDefaultMergeOp = eMergeABToDest; } + if ( eDefaultMergeOp == eMergeToAB && bCheckC ) { assert(false); } + + if ( eDefaultMergeOp == eMergeToA || eDefaultMergeOp == eMergeToB || + eDefaultMergeOp == eMergeABCToDest || eDefaultMergeOp == eMergeABToDest || eDefaultMergeOp == eMergeToAB ) + { + if ( !bCheckC ) + { + if ( mfi.m_bEqualAB ) + { + mfi.setMergeOperation( eNoOperation ); // All is well, nothing to do. + } + else if ( mfi.m_bExistsInA && mfi.m_bExistsInB ) + { + if ( !bCopyNewer || mfi.m_bDirA ) + mfi.setMergeOperation( eDefaultMergeOp ); + else if ( bCopyNewer && mfi.m_bConflictingAges ) + { + mfi.setMergeOperation( eConflictingAges ); + } + else + { + if ( mfi.m_ageA == eNew ) + mfi.setMergeOperation( eDefaultMergeOp == eMergeToAB ? eCopyAToB : eCopyAToDest ); + else + mfi.setMergeOperation( eDefaultMergeOp == eMergeToAB ? eCopyBToA : eCopyBToDest ); + } + } + else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB ) + { + if ( eDefaultMergeOp==eMergeABToDest ) mfi.setMergeOperation( eCopyBToDest ); + else if ( eDefaultMergeOp==eMergeToB ) mfi.setMergeOperation( eNoOperation ); + else mfi.setMergeOperation( eCopyBToA ); + } + else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB ) + { + if ( eDefaultMergeOp==eMergeABToDest ) mfi.setMergeOperation( eCopyAToDest ); + else if ( eDefaultMergeOp==eMergeToA ) mfi.setMergeOperation( eNoOperation ); + else mfi.setMergeOperation( eCopyAToB ); + } + else //if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB ) + { + mfi.setMergeOperation( eNoOperation ); assert(false); + } + } + else + { + if ( mfi.m_bEqualAB && mfi.m_bEqualAC ) + { + mfi.setMergeOperation( eCopyCToDest ); + } + else if ( mfi.m_bExistsInA && mfi.m_bExistsInB && mfi.m_bExistsInC) + { + if ( mfi.m_bEqualAB ) + mfi.setMergeOperation( eCopyCToDest ); + else if ( mfi.m_bEqualAC ) + mfi.setMergeOperation( eCopyBToDest ); + else if ( mfi.m_bEqualBC ) + mfi.setMergeOperation( eCopyCToDest ); + else + mfi.setMergeOperation( eMergeABCToDest ); + } + else if ( mfi.m_bExistsInA && mfi.m_bExistsInB && !mfi.m_bExistsInC ) + { + if ( mfi.m_bEqualAB ) + mfi.setMergeOperation( eDeleteFromDest ); + else + mfi.setMergeOperation( eCopyBToDest ); + } + else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + if ( mfi.m_bEqualAC ) + mfi.setMergeOperation( eDeleteFromDest ); + else + mfi.setMergeOperation( eCopyCToDest ); + } + else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + if ( mfi.m_bEqualBC ) + mfi.setMergeOperation( eCopyCToDest ); + else + mfi.setMergeOperation( eMergeABCToDest ); + } + else if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB && mfi.m_bExistsInC ) + { + mfi.setMergeOperation( eCopyCToDest ); + } + else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB && !mfi.m_bExistsInC ) + { + mfi.setMergeOperation( eCopyBToDest ); + } + else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB && !mfi.m_bExistsInC) + { + mfi.setMergeOperation( eDeleteFromDest ); + } + else //if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB && !mfi.m_bExistsInC ) + { + mfi.setMergeOperation( eNoOperation ); assert(false); + } + } + + // Now check if file/dir-types fit. + if ( conflictingFileTypes(mfi) ) + { + mfi.setMergeOperation( eConflictingFileTypes ); + } + } + else + { + e_MergeOperation eMO = eDefaultMergeOp; + switch ( eDefaultMergeOp ) + { + case eConflictingFileTypes: + case eConflictingAges: + case eDeleteA: + case eDeleteB: + case eDeleteAB: + case eDeleteFromDest: + case eNoOperation: break; + case eCopyAToB: if ( !mfi.m_bExistsInA ) { eMO = eDeleteB; } break; + case eCopyBToA: if ( !mfi.m_bExistsInB ) { eMO = eDeleteA; } break; + case eCopyAToDest: if ( !mfi.m_bExistsInA ) { eMO = eDeleteFromDest; } break; + case eCopyBToDest: if ( !mfi.m_bExistsInB ) { eMO = eDeleteFromDest; } break; + case eCopyCToDest: if ( !mfi.m_bExistsInC ) { eMO = eDeleteFromDest; } break; + + case eMergeToA: + case eMergeToB: + case eMergeToAB: + case eMergeABCToDest: + case eMergeABToDest: + default: + assert(false); + } + mfi.setMergeOperation( eMO ); + } +} + +void DirectoryMergeWindow::onDoubleClick( Q3ListViewItem* lvi ) +{ + if (lvi==0) return; + + if ( m_bDirectoryMerge ) + mergeCurrentFile(); + else + compareCurrentFile(); +} + +void DirectoryMergeWindow::onSelectionChanged( Q3ListViewItem* lvi ) +{ + if ( lvi==0 ) return; + + DirMergeItem* pDMI = static_cast(lvi); + + MergeFileInfos& mfi = *pDMI->m_pMFI; + assert( mfi.m_pDMI==pDMI ); + + m_pDirectoryMergeInfo->setInfo( m_dirA, m_dirB, m_dirC, m_dirDestInternal, mfi ); +} + +void DirectoryMergeWindow::onClick( int button, Q3ListViewItem* lvi, const QPoint& p, int c ) +{ + if ( lvi==0 ) return; + + DirMergeItem* pDMI = static_cast(lvi); + + MergeFileInfos& mfi = *pDMI->m_pMFI; + assert( mfi.m_pDMI==pDMI ); + + if ( c==s_OpCol ) + { + bool bThreeDirs = m_dirC.isValid(); + + KPopupMenu m(this); + if ( bThreeDirs ) + { + m_pDirCurrentDoNothing->plug(&m); + int count=0; + if ( mfi.m_bExistsInA ) { m_pDirCurrentChooseA->plug(&m); ++count; } + if ( mfi.m_bExistsInB ) { m_pDirCurrentChooseB->plug(&m); ++count; } + if ( mfi.m_bExistsInC ) { m_pDirCurrentChooseC->plug(&m); ++count; } + if ( !conflictingFileTypes(mfi) && count>1 ) m_pDirCurrentMerge->plug(&m); + m_pDirCurrentDelete->plug(&m); + } + else if ( m_bSyncMode ) + { + m_pDirCurrentSyncDoNothing->plug(&m); + if ( mfi.m_bExistsInA ) m_pDirCurrentSyncCopyAToB->plug(&m); + if ( mfi.m_bExistsInB ) m_pDirCurrentSyncCopyBToA->plug(&m); + if ( mfi.m_bExistsInA ) m_pDirCurrentSyncDeleteA->plug(&m); + if ( mfi.m_bExistsInB ) m_pDirCurrentSyncDeleteB->plug(&m); + if ( mfi.m_bExistsInA && mfi.m_bExistsInB ) + { + m_pDirCurrentSyncDeleteAAndB->plug(&m); + if ( !conflictingFileTypes(mfi)) + { + m_pDirCurrentSyncMergeToA->plug(&m); + m_pDirCurrentSyncMergeToB->plug(&m); + m_pDirCurrentSyncMergeToAAndB->plug(&m); + } + } + } + else + { + m_pDirCurrentDoNothing->plug(&m); + if ( mfi.m_bExistsInA ) { m_pDirCurrentChooseA->plug(&m); } + if ( mfi.m_bExistsInB ) { m_pDirCurrentChooseB->plug(&m); } + if ( !conflictingFileTypes(mfi) && mfi.m_bExistsInA && mfi.m_bExistsInB ) m_pDirCurrentMerge->plug(&m); + m_pDirCurrentDelete->plug(&m); + } + + m.exec( p ); + } + else if ( c == s_ACol || c==s_BCol || c==s_CCol ) + { + QString itemPath; + if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } + else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } + else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } + + if (!itemPath.isEmpty()) + { + selectItemAndColumn( pDMI, c, button==Qt::RightButton ); + } + } +} + +void DirectoryMergeWindow::slotShowContextMenu(Q3ListViewItem* lvi,const QPoint & p,int c) +{ + if ( lvi==0 ) return; + + DirMergeItem* pDMI = static_cast(lvi); + + MergeFileInfos& mfi = *pDMI->m_pMFI; + assert( mfi.m_pDMI==pDMI ); + if ( c == s_ACol || c==s_BCol || c==s_CCol ) + { + QString itemPath; + if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } + else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } + else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } + + if (!itemPath.isEmpty()) + { + selectItemAndColumn(pDMI, c, true); + KPopupMenu m(this); + m_pDirCompareExplicit->plug(&m); + m_pDirMergeExplicit->plug(&m); + +#ifndef _WIN32 + m.exec( p ); +#else + void showShellContextMenu( const QString&, QPoint, QWidget*, QMenu* ); + showShellContextMenu( itemPath, p, this, &m ); +#endif + } + } +} + +static QString getFileName( DirMergeItem* pDMI, int column ) +{ + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + return column == s_ACol ? mfi.m_fileInfoA.absFilePath() : + column == s_BCol ? mfi.m_fileInfoB.absFilePath() : + column == s_CCol ? mfi.m_fileInfoC.absFilePath() : + QString(""); + } + return ""; +} + +static bool isDir( DirMergeItem* pDMI, int column ) +{ + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + return column == s_ACol ? mfi.m_bDirA : + column == s_BCol ? mfi.m_bDirB : + mfi.m_bDirC; + } + return false; +} + + +void DirectoryMergeWindow::selectItemAndColumn(DirMergeItem* pDMI, int c, bool bContextMenu) +{ + if ( bContextMenu && ( + pDMI==m_pSelection1Item && c==m_selection1Column && m_pSelection2Item==0 || + pDMI==m_pSelection2Item && c==m_selection2Column && m_pSelection3Item==0 || + pDMI==m_pSelection3Item && c==m_selection3Column ) ) + return; + + DirMergeItem* pOld1=m_pSelection1Item; + DirMergeItem* pOld2=m_pSelection2Item; + DirMergeItem* pOld3=m_pSelection3Item; + + bool bReset = false; + + if ( m_pSelection1Item ) + { + if (isDir( m_pSelection1Item, m_selection1Column )!=isDir( pDMI, c )) + bReset = true; + } + + if ( bReset || m_pSelection3Item!=0 || + pDMI==m_pSelection1Item && c==m_selection1Column || + pDMI==m_pSelection2Item && c==m_selection2Column || + pDMI==m_pSelection3Item && c==m_selection3Column) + { + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + } + else if ( m_pSelection1Item==0 ) + { + m_pSelection1Item = pDMI; + m_selection1Column = c; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + } + else if ( m_pSelection2Item==0 ) + { + m_pSelection2Item = pDMI; + m_selection2Column = c; + m_pSelection3Item = 0; + } + else if ( m_pSelection3Item==0 ) + { + m_pSelection3Item = pDMI; + m_selection3Column = c; + } + if (pOld1) repaintItem( pOld1 ); + if (pOld2) repaintItem( pOld2 ); + if (pOld3) repaintItem( pOld3 ); + if (m_pSelection1Item) repaintItem( m_pSelection1Item ); + if (m_pSelection2Item) repaintItem( m_pSelection2Item ); + if (m_pSelection3Item) repaintItem( m_pSelection3Item ); + emit updateAvailabilities(); +} + +// Since Qt 2.3.0 doesn't allow the specification of a compare operator, this trick emulates it. +#if QT_VERSION==230 +#define DIRSORT(x) ( pMFI->m_bDirA ? " " : "" )+x +#else +#define DIRSORT(x) x +#endif + +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 ) +: Q3ListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) +{ + init(pMFI); +} + + +void DirMergeItem::init(MergeFileInfos* pMFI) +{ + pMFI->m_pDMI = this; + m_pMFI = pMFI; + TotalDiffStatus& tds = pMFI->m_totalDiffStatus; + if ( m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC ) + { + } + else + { + setText( s_UnsolvedCol, QString::number( tds.nofUnsolvedConflicts ) ); + setText( s_SolvedCol, QString::number( tds.nofSolvedConflicts ) ); + setText( s_NonWhiteCol, QString::number( tds.nofUnsolvedConflicts + tds.nofSolvedConflicts - tds.nofWhitespaceConflicts ) ); + setText( s_WhiteCol, QString::number( tds.nofWhitespaceConflicts ) ); + } +} + +int DirMergeItem::compare(Q3ListViewItem *i, int col, bool ascending) const +{ + DirMergeItem* pDMI = static_cast(i); + bool bDir1 = m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC; + bool bDir2 = pDMI->m_pMFI->m_bDirA || pDMI->m_pMFI->m_bDirB || pDMI->m_pMFI->m_bDirC; + if ( m_pMFI==0 || pDMI->m_pMFI==0 || bDir1 == bDir2 ) + { + 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 Q3ListViewItem::compare( i, col, ascending ); + } + else + return bDir1 ? -1 : 1; +} + +void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ) +{ + if (column == s_ACol || column == s_BCol || column == s_CCol ) + { + const QPixmap* icon = pixmap(column); + if ( icon ) + { + int yOffset = (height() - icon->height()) / 2; + p->drawPixmap( 2, yOffset, *icon ); + if ( listView() ) + { + DirectoryMergeWindow* pDMW = static_cast(listView()); + int i = this==pDMW->m_pSelection1Item && column == pDMW->m_selection1Column ? 1 : + this==pDMW->m_pSelection2Item && column == pDMW->m_selection2Column ? 2 : + this==pDMW->m_pSelection3Item && column == pDMW->m_selection3Column ? 3 : + 0; + if ( i!=0 ) + { + OptionDialog* pOD = pDMW->m_pOptions; + QColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC ); + p->setPen( c );// highlight() ); + p->drawRect( 2, yOffset, icon->width(), icon->height()); + p->setPen( QPen( c, 0, Qt::DotLine) ); + p->drawRect( 1, yOffset-1, icon->width()+2, icon->height()+2); + p->setPen( cg.background() ); + QString s( QChar('A'+i-1) ); + p->drawText( 2 + (icon->width() - p->fontMetrics().width(s))/2, + yOffset + (icon->height() + p->fontMetrics().ascent())/2-1, + s ); + } + else + { + p->setPen( cg.background() ); + p->drawRect( 1, yOffset-1, icon->width()+2, icon->height()+2); + } + } + return; + } + } + Q3ListViewItem::paintCell(p,cg,column,width,align); +} + +DirMergeItem::~DirMergeItem() +{ + m_pMFI->m_pDMI = 0; +} + +void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp ) +{ + if ( eMOp != m_eMergeOperation ) + { + m_bOperationComplete = false; + m_pDMI->setText( s_OpStatusCol, "" ); + } + + m_eMergeOperation = eMOp; + QString s; + bool bDir = m_bDirA || m_bDirB || m_bDirC; + if( m_pDMI!=0 ) + { + switch( m_eMergeOperation ) + { + case eNoOperation: s=""; m_pDMI->setText(s_OpCol,""); break; + case eCopyAToB: s=i18n("Copy A to B"); break; + case eCopyBToA: s=i18n("Copy B to A"); break; + case eDeleteA: s=i18n("Delete A"); break; + case eDeleteB: s=i18n("Delete B"); break; + case eDeleteAB: s=i18n("Delete A & B"); break; + case eMergeToA: s=i18n("Merge to A"); break; + case eMergeToB: s=i18n("Merge to B"); break; + case eMergeToAB: s=i18n("Merge to A & B"); break; + case eCopyAToDest: s="A"; break; + case eCopyBToDest: s="B"; break; + case eCopyCToDest: s="C"; break; + case eDeleteFromDest: s=i18n("Delete (if exists)"); break; + case eMergeABCToDest: s= bDir ? i18n("Merge") : i18n("Merge (manual)"); break; + case eMergeABToDest: s= bDir ? i18n("Merge") : i18n("Merge (manual)"); break; + case eConflictingFileTypes: s=i18n("Error: Conflicting File Types"); break; + case eConflictingAges: s=i18n("Error: Dates are equal but files are not."); break; + default: assert(false); break; + } + m_pDMI->setText(s_OpCol,s); + + e_MergeOperation eChildrenMergeOp = m_eMergeOperation; + if ( eChildrenMergeOp == eConflictingFileTypes ) eChildrenMergeOp = eMergeABCToDest; + Q3ListViewItem* p = m_pDMI->firstChild(); + while ( p!=0 ) + { + DirMergeItem* pDMI = static_cast( p ); + DirectoryMergeWindow* pDMW = static_cast( p->listView() ); + pDMW->calcSuggestedOperation( *pDMI->m_pMFI, eChildrenMergeOp ); + p = p->nextSibling(); + } + } +} + +void DirectoryMergeWindow::compareCurrentFile() +{ + if (!canContinue()) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); + return; + } + + DirMergeItem* pDMI = static_cast( selectedItem() ); + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + if ( !(mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC) ) + { + emit startDiffMerge( + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + "", + "","","",0 + ); + } + } + emit updateAvailabilities(); +} + + +void DirectoryMergeWindow::slotCompareExplicitlySelectedFiles() +{ + if ( ! isDir(m_pSelection1Item,m_selection1Column) && !canContinue() ) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); + return; + } + + emit startDiffMerge( + getFileName( m_pSelection1Item, m_selection1Column ), + getFileName( m_pSelection2Item, m_selection2Column ), + getFileName( m_pSelection3Item, m_selection3Column ), + "", + "","","",0 + ); + m_pSelection1Item=0; + m_pSelection2Item=0; + m_pSelection3Item=0; + + emit updateAvailabilities(); + triggerUpdate(); +} + +void DirectoryMergeWindow::slotMergeExplicitlySelectedFiles() +{ + if ( ! isDir(m_pSelection1Item,m_selection1Column) && !canContinue() ) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); + return; + } + + QString fn1 = getFileName( m_pSelection1Item, m_selection1Column ); + QString fn2 = getFileName( m_pSelection2Item, m_selection2Column ); + QString fn3 = getFileName( m_pSelection3Item, m_selection3Column ); + + emit startDiffMerge( fn1, fn2, fn3, + fn3.isEmpty() ? fn2 : fn3, + "","","",0 + ); + m_pSelection1Item=0; + m_pSelection2Item=0; + m_pSelection3Item=0; + + emit updateAvailabilities(); + triggerUpdate(); +} + +bool DirectoryMergeWindow::isFileSelected() +{ + DirMergeItem* pDMI = static_cast( selectedItem() ); + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + return ! (mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC || conflictingFileTypes(mfi) ); + } + return false; +} + +void DirectoryMergeWindow::mergeResultSaved(const QString& fileName) +{ + DirMergeItem* pCurrentItemForOperation = (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) + ? 0 + : *m_currentItemForOperation; + + if ( pCurrentItemForOperation!=0 && pCurrentItemForOperation->m_pMFI==0 ) + { + KMessageBox::error( this, i18n("This should never happen: \n\nmergeResultSaved: m_pMFI=0\n\nIf you know how to reproduce this, please contact the program author."),i18n("Program Error") ); + return; + } + if ( pCurrentItemForOperation!=0 && fileName == fullNameDest(*pCurrentItemForOperation->m_pMFI) ) + { + if ( pCurrentItemForOperation->m_pMFI->m_eMergeOperation==eMergeToAB ) + { + MergeFileInfos& mfi = *pCurrentItemForOperation->m_pMFI; + bool bSuccess = copyFLD( fullNameB(mfi), fullNameA(mfi) ); + if (!bSuccess) + { + KMessageBox::error(this, i18n("An error occurred while copying.\n"), i18n("Error") ); + m_pStatusInfo->setCaption(i18n("Merge Error")); + m_pStatusInfo->show(); + //if ( m_pStatusInfo->firstChild()!=0 ) + // m_pStatusInfo->ensureItemVisible( m_pStatusInfo->last() ); + m_bError = true; + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Error.") ); + mfi.m_eMergeOperation = eCopyBToA; + return; + } + } + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Done.") ); + pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; + if ( m_mergeItemList.size()==1 ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + } + } + + emit updateAvailabilities(); +} + +bool DirectoryMergeWindow::canContinue() +{ + bool bCanContinue=false; + checkIfCanContinue( &bCanContinue ); + if ( bCanContinue && !m_bError ) + { + DirMergeItem* pCurrentItemForOperation = + (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) ? 0 : *m_currentItemForOperation; + + if ( pCurrentItemForOperation!=0 && ! pCurrentItemForOperation->m_pMFI->m_bOperationComplete ) + { + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Not saved.") ); + pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; + if ( m_mergeItemList.size()==1 ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + } + } + } + return bCanContinue; +} + +bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ) +{ + bool bCreateBackups = m_pOptions->m_bDmCreateBakFiles; + // First decide destname + QString destName; + switch( mfi.m_eMergeOperation ) + { + case eNoOperation: break; + case eDeleteAB: break; + case eMergeToAB: // let the user save in B. In mergeResultSaved() the file will be copied to A. + case eMergeToB: + case eDeleteB: + case eCopyAToB: destName = fullNameB(mfi); break; + case eMergeToA: + case eDeleteA: + case eCopyBToA: destName = fullNameA(mfi); break; + case eMergeABToDest: + case eMergeABCToDest: + case eCopyAToDest: + case eCopyBToDest: + case eCopyCToDest: + case eDeleteFromDest: destName = fullNameDest(mfi); break; + default: + KMessageBox::error( this, i18n("Unknown merge operation. (This must never happen!)"), i18n("Error") ); + assert(false); + } + + bool bSuccess = false; + bSingleFileMerge = false; + switch( mfi.m_eMergeOperation ) + { + case eNoOperation: bSuccess = true; break; + case eCopyAToDest: + case eCopyAToB: bSuccess = copyFLD( fullNameA(mfi), destName ); break; + case eCopyBToDest: + case eCopyBToA: bSuccess = copyFLD( fullNameB(mfi), destName ); break; + case eCopyCToDest: bSuccess = copyFLD( fullNameC(mfi), destName ); break; + case eDeleteFromDest: + case eDeleteA: + case eDeleteB: bSuccess = deleteFLD( destName, bCreateBackups ); break; + case eDeleteAB: bSuccess = deleteFLD( fullNameA(mfi), bCreateBackups ) && + deleteFLD( fullNameB(mfi), bCreateBackups ); break; + case eMergeABToDest: + case eMergeToA: + case eMergeToAB: + case eMergeToB: bSuccess = mergeFLD( fullNameA(mfi), fullNameB(mfi), "", + destName, bSingleFileMerge ); + break; + case eMergeABCToDest:bSuccess = mergeFLD( + mfi.m_bExistsInA ? fullNameA(mfi) : QString(""), + mfi.m_bExistsInB ? fullNameB(mfi) : QString(""), + mfi.m_bExistsInC ? fullNameC(mfi) : QString(""), + destName, bSingleFileMerge ); + break; + default: + KMessageBox::error( this, i18n("Unknown merge operation."), i18n("Error") ); + assert(false); + } + + return bSuccess; +} + + +// Check if the merge can start, and prepare the m_mergeItemList which then contains all +// items that must be merged. +void DirectoryMergeWindow::prepareMergeStart( Q3ListViewItem* pBegin, Q3ListViewItem* pEnd, bool bVerbose ) +{ + if ( bVerbose ) + { + int status = KMessageBox::warningYesNoCancel(this, + i18n("The merge is about to begin.\n\n" + "Choose \"Do it\" if you have read the instructions and know what you are doing.\n" + "Choosing \"Simulate it\" will tell you what would happen.\n\n" + "Be aware that this program still has beta status " + "and there is NO WARRANTY whatsoever! Make backups of your vital data!"), + i18n("Starting Merge"), i18n("Do It"), i18n("Simulate It") ); + if (status==KMessageBox::Yes) m_bRealMergeStarted = true; + else if (status==KMessageBox::No ) m_bSimulatedMergeStarted = true; + else return; + } + else + { + m_bRealMergeStarted = true; + } + + m_mergeItemList.clear(); + if (pBegin == 0) + return; + + for( Q3ListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) ) + { + DirMergeItem* pDMI = static_cast(p); + + if ( pDMI && ! pDMI->m_pMFI->m_bOperationComplete ) + { + m_mergeItemList.push_back(pDMI); + + if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingFileTypes ) + { + ensureItemVisible( pDMI ); + setSelected( pDMI, true ); + KMessageBox::error(this, i18n("The highlighted item has a different type in the different directories. Select what to do."), i18n("Error")); + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + return; + } + if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingAges ) + { + ensureItemVisible( pDMI ); + setSelected( pDMI, true ); + KMessageBox::error(this, i18n("The modification dates of the file are equal but the files are not. Select what to do."), i18n("Error")); + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + return; + } + } + } + + m_currentItemForOperation = m_mergeItemList.begin(); + return; +} + +void DirectoryMergeWindow::slotRunOperationForCurrentItem() +{ + if ( ! canContinue() ) return; + + bool bVerbose = false; + if ( m_mergeItemList.empty() ) + { + Q3ListViewItem* pBegin = currentItem(); + Q3ListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no children) + + prepareMergeStart( pBegin, pEnd, bVerbose ); + mergeContinue(true, bVerbose); + } + else + mergeContinue(false, bVerbose); +} + +void DirectoryMergeWindow::slotRunOperationForAllItems() +{ + if ( ! canContinue() ) return; + + bool bVerbose = true; + if ( m_mergeItemList.empty() ) + { + Q3ListViewItem* pBegin = firstChild(); + + prepareMergeStart( pBegin, 0, bVerbose ); + mergeContinue(true, bVerbose); + } + else + mergeContinue(false, bVerbose); +} + +void DirectoryMergeWindow::mergeCurrentFile() +{ + if (!canContinue()) return; + + if ( m_bRealMergeStarted ) + { + KMessageBox::sorry(this,i18n("This operation is currently not possible because directory merge is currently running."),i18n("Operation Not Possible")); + return; + } + + if ( isFileSelected() ) + { + DirMergeItem* pDMI = static_cast( selectedItem() ); + if ( pDMI != 0 ) + { + MergeFileInfos& mfi = *pDMI->m_pMFI; + m_mergeItemList.clear(); + m_mergeItemList.push_back( pDMI ); + m_currentItemForOperation=m_mergeItemList.begin(); + bool bDummy=false; + mergeFLD( + mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), + mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), + mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), + fullNameDest(mfi), + bDummy + ); + } + } + emit updateAvailabilities(); +} + + +// When bStart is true then m_currentItemForOperation must still be processed. +// When bVerbose is true then a messagebox will tell when the merge is complete. +void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose) +{ + ProgressProxy pp; + if ( m_mergeItemList.empty() ) + return; + + int nrOfItems = 0; + int nrOfCompletedItems = 0; + int nrOfCompletedSimItems = 0; + + // Count the number of completed items (for the progress bar). + for( MergeItemList::iterator i = m_mergeItemList.begin(); i!=m_mergeItemList.end(); ++i ) + { + DirMergeItem* pDMI = *i; + ++nrOfItems; + if ( pDMI->m_pMFI->m_bOperationComplete ) + ++nrOfCompletedItems; + if ( pDMI->m_pMFI->m_bSimOpComplete ) + ++nrOfCompletedSimItems; + } + + m_pStatusInfo->hide(); + m_pStatusInfo->clear(); + + DirMergeItem* pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation; + + bool bContinueWithCurrentItem = bStart; // true for first item, else false + bool bSkipItem = false; + if ( !bStart && m_bError && pCurrentItemForOperation!=0 ) + { + int status = KMessageBox::warningYesNoCancel(this, + i18n("There was an error in the last step.\n" + "Do you want to continue with the item that caused the error or do you want to skip this item?"), + i18n("Continue merge after an error"), i18n("Continue With Last Item"), i18n("Skip Item") ); + if (status==KMessageBox::Yes) bContinueWithCurrentItem = true; + else if (status==KMessageBox::No ) bSkipItem = true; + else return; + m_bError = false; + } + + bool bSuccess = true; + bool bSingleFileMerge = false; + bool bSim = m_bSimulatedMergeStarted; + while( bSuccess ) + { + if ( pCurrentItemForOperation==0 ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + break; + } + + if ( pCurrentItemForOperation!=0 && !bContinueWithCurrentItem ) + { + if ( bSim ) + { + if( pCurrentItemForOperation->firstChild()==0 ) + { + pCurrentItemForOperation->m_pMFI->m_bSimOpComplete = true; + } + } + else + { + if( pCurrentItemForOperation->firstChild()==0 ) + { + if( !pCurrentItemForOperation->m_pMFI->m_bOperationComplete ) + { + pCurrentItemForOperation->setText( s_OpStatusCol, bSkipItem ? i18n("Skipped.") : i18n("Done.") ); + pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; + bSkipItem = false; + } + } + else + { + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("In progress...") ); + } + } + } + + if ( ! bContinueWithCurrentItem ) + { + // Depth first + 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" + Q3ListViewItem* pParent = pPrevItem->parent(); + bool bDone = true; + while ( bDone && pParent!=0 ) + { + for( Q3ListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() ) + { + DirMergeItem* pDMI = static_cast(p); + if ( !bSim && ! pDMI->m_pMFI->m_bOperationComplete || bSim && pDMI->m_pMFI->m_bSimOpComplete ) + { + bDone=false; + break; + } + } + if ( bDone ) + { + if (bSim) + static_cast(pParent)->m_pMFI->m_bSimOpComplete = bDone; + else + { + pParent->setText( s_OpStatusCol, i18n("Done.") ); + static_cast(pParent)->m_pMFI->m_bOperationComplete = bDone; + } + } + pParent = pParent->parent(); + } + } + } + + if ( pCurrentItemForOperation == 0 ) // end? + { + if ( m_bRealMergeStarted ) + { + if (bVerbose) + { + KMessageBox::information( this, i18n("Merge operation complete."), i18n("Merge Complete") ); + } + m_bRealMergeStarted = false; + m_pStatusInfo->setCaption(i18n("Merge Complete")); + } + if ( m_bSimulatedMergeStarted ) + { + m_bSimulatedMergeStarted = false; + for( Q3ListViewItem* p=firstChild(); p!=0; p=treeIterator(p) ) + { + static_cast(p)->m_pMFI->m_bSimOpComplete = false; + } + m_pStatusInfo->setCaption(i18n("Simulated merge complete: Check if you agree with the proposed operations.")); + m_pStatusInfo->show(); + } + //g_pProgressDialog->hide(); + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + return; + } + + MergeFileInfos& mfi = *pCurrentItemForOperation->m_pMFI; + + pp.setInformation( mfi.m_subPath, + bSim ? double(nrOfCompletedSimItems)/nrOfItems : double(nrOfCompletedItems)/nrOfItems, + false // bRedrawUpdate + ); + //g_pProgressDialog->show(); + + bSuccess = executeMergeOperation( mfi, bSingleFileMerge ); // Here the real operation happens. + + if ( bSuccess ) + { + if(bSim) ++nrOfCompletedSimItems; + else ++nrOfCompletedItems; + bContinueWithCurrentItem = false; + } + + if( pp.wasCancelled() ) + break; + } // end while + + //g_pProgressDialog->hide(); + + setCurrentItem( pCurrentItemForOperation ); + ensureItemVisible( pCurrentItemForOperation ); + if ( !bSuccess && !bSingleFileMerge ) + { + KMessageBox::error(this, i18n("An error occurred. Press OK to see detailed information.\n"), i18n("Error") ); + m_pStatusInfo->setCaption(i18n("Merge Error")); + m_pStatusInfo->show(); + //if ( m_pStatusInfo->firstChild()!=0 ) + // m_pStatusInfo->ensureItemVisible( m_pStatusInfo->last() ); + m_bError = true; + pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Error.") ); + } + else + { + m_bError = false; + } + emit updateAvailabilities(); + + if ( m_currentItemForOperation==m_mergeItemList.end() ) + { + m_mergeItemList.clear(); + m_bRealMergeStarted=false; + } +} + +void DirectoryMergeWindow::allowResizeEvents(bool bAllowResizeEvents ) +{ + m_bAllowResizeEvents = bAllowResizeEvents; +} + +void DirectoryMergeWindow::resizeEvent( QResizeEvent* e ) +{ + if (m_bAllowResizeEvents) + Q3ListView::resizeEvent(e); +} + +bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) +{ + FileAccess fi(name, true); + if ( !fi.exists() ) + return true; + + if ( bCreateBackup ) + { + bool bSuccess = renameFLD( name, name+".orig" ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error: While deleting %1: Creating backup failed.").arg(name) ); + return false; + } + } + else + { + if ( fi.isDir() && !fi.isSymLink() ) + m_pStatusInfo->addText(i18n("delete directory recursively( %1 )").arg(name)); + else + m_pStatusInfo->addText(i18n("delete( %1 )").arg(name)); + + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + if ( fi.isDir() && !fi.isSymLink() )// recursive directory delete only for real dirs, not symlinks + { + t_DirectoryList dirList; + bool bSuccess = fi.listDir( &dirList, false, true, "*", "", "", false, false ); // not recursive, find hidden files + + if ( !bSuccess ) + { + // No Permission to read directory or other error. + m_pStatusInfo->addText( i18n("Error: delete dir operation failed while trying to read the directory.") ); + return false; + } + + t_DirectoryList::iterator it; // create list iterator + + for ( it=dirList.begin(); it!=dirList.end(); ++it ) // for each file... + { + FileAccess& fi2 = *it; + if ( fi2.fileName() == "." || fi2.fileName()==".." ) + continue; + bSuccess = deleteFLD( fi2.absFilePath(), false ); + if (!bSuccess) break; + } + if (bSuccess) + { + bSuccess = FileAccess::removeDir( name ); + if ( !bSuccess ) + { + m_pStatusInfo->addText( i18n("Error: rmdir( %1 ) operation failed.").arg(name)); + return false; + } + } + } + else + { + bool bSuccess = FileAccess::removeFile( name ); + if ( !bSuccess ) + { + m_pStatusInfo->addText( i18n("Error: delete operation failed.") ); + return false; + } + } + } + return true; +} + +bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC,const QString& nameDest, bool& bSingleFileMerge ) +{ + FileAccess fi(nameA); + if (fi.isDir()) + { + return makeDir(nameDest); + } + + // Make sure that the dir exists, into which we will save the file later. + int pos=nameDest.findRev('/'); + if ( pos>0 ) + { + QString parentName = nameDest.left(pos); + bool bSuccess = makeDir(parentName, true /*quiet*/); + if (!bSuccess) + return false; + } + + m_pStatusInfo->addText(i18n("manual merge( %1, %2, %3 -> %4)").arg(nameA).arg(nameB).arg(nameC).arg(nameDest)); + if ( m_bSimulatedMergeStarted ) + { + m_pStatusInfo->addText(i18n(" Note: After a manual merge the user should continue by pressing F7.") ); + return true; + } + + bSingleFileMerge = true; + (*m_currentItemForOperation)->setText( s_OpStatusCol, i18n("In progress...") ); + ensureItemVisible( *m_currentItemForOperation ); + + emit startDiffMerge( nameA, nameB, nameC, nameDest, "","","",0 ); + + return false; +} + +bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destName ) +{ + if ( srcName == destName ) + return true; + + if ( FileAccess(destName, true).exists() ) + { + bool bSuccess = deleteFLD( destName, m_pOptions->m_bDmCreateBakFiles ); + if ( !bSuccess ) + { + m_pStatusInfo->addText(i18n("Error: copy( %1 -> %2 ) failed." + "Deleting existing destination failed.").arg(srcName).arg(destName)); + return false; + } + } + + FileAccess fi( srcName ); + + if ( fi.isSymLink() && (fi.isDir() && !m_bFollowDirLinks || !fi.isDir() && !m_bFollowFileLinks) ) + { + m_pStatusInfo->addText(i18n("copyLink( %1 -> %2 )").arg(srcName).arg(destName)); +#ifdef _WIN32 + // What are links? +#else + if ( m_bSimulatedMergeStarted ) + { + return true; + } + FileAccess destFi(destName); + if ( !destFi.isLocal() || !fi.isLocal() ) + { + m_pStatusInfo->addText(i18n("Error: copyLink failed: Remote links are not yet supported.")); + return false; + } + QString linkTarget = fi.readLink(); + bool bSuccess = FileAccess::symLink( linkTarget, destName ); + if (!bSuccess) + m_pStatusInfo->addText(i18n("Error: copyLink failed.")); + return bSuccess; +#endif + } + + if ( fi.isDir() ) + { + bool bSuccess = makeDir( destName ); + return bSuccess; + } + + int pos=destName.findRev('/'); + if ( pos>0 ) + { + QString parentName = destName.left(pos); + bool bSuccess = makeDir(parentName, true /*quiet*/); + if (!bSuccess) + return false; + } + + m_pStatusInfo->addText(i18n("copy( %1 -> %2 )").arg(srcName).arg(destName)); + + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + FileAccess faSrc ( srcName ); + bool bSuccess = faSrc.copyFile( destName ); + if (! bSuccess ) m_pStatusInfo->addText( faSrc.getStatusText() ); + return bSuccess; +} + +// Rename is not an operation that can be selected by the user. +// It will only be used to create backups. +// Hence it will delete an existing destination without making a backup (of the old backup.) +bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& destName ) +{ + if ( srcName == destName ) + return true; + + if ( FileAccess(destName, true).exists() ) + { + bool bSuccess = deleteFLD( destName, false /*no backup*/ ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error during rename( %1 -> %2 ): " + "Cannot delete existing destination." ).arg(srcName).arg(destName)); + return false; + } + } + + m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").arg(srcName).arg(destName)); + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + bool bSuccess = FileAccess( srcName ).rename( destName ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error: Rename failed.") ); + return false; + } + + return true; +} + +bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet ) +{ + FileAccess fi(name, true); + if( fi.exists() && fi.isDir() ) + return true; + + if( fi.exists() && !fi.isDir() ) + { + bool bSuccess = deleteFLD( name, true ); + if (!bSuccess) + { + m_pStatusInfo->addText( i18n("Error during makeDir of %1. " + "Cannot delete existing file." ).arg(name)); + return false; + } + } + + int pos=name.findRev('/'); + if ( pos>0 ) + { + QString parentName = name.left(pos); + bool bSuccess = makeDir(parentName,true); + if (!bSuccess) + return false; + } + + if ( ! bQuiet ) + m_pStatusInfo->addText(i18n("makeDir( %1 )").arg(name)); + + if ( m_bSimulatedMergeStarted ) + { + return true; + } + + bool bSuccess = FileAccess::makeDir( name ); + if ( bSuccess == false ) + { + m_pStatusInfo->addText( i18n("Error while creating directory.") ); + return false; + } + return true; +} + + +DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent ) +: QFrame(pParent) +{ + QVBoxLayout *topLayout = new QVBoxLayout( this ); + + QGridLayout *grid = new QGridLayout( topLayout ); + grid->setColStretch(1,10); + + int line=0; + + m_pA = new QLabel("A",this); grid->addWidget( m_pA,line, 0 ); + m_pInfoA = new QLabel(this); grid->addWidget( m_pInfoA,line,1 ); ++line; + m_pB = new QLabel("B",this); grid->addWidget( m_pB,line, 0 ); + m_pInfoB = new QLabel(this); grid->addWidget( m_pInfoB,line,1 ); ++line; + m_pC = new QLabel("C",this); grid->addWidget( m_pC,line, 0 ); + m_pInfoC = new QLabel(this); grid->addWidget( m_pInfoC,line,1 ); ++line; + m_pDest = new QLabel(i18n("Dest"),this); grid->addWidget( m_pDest,line, 0 ); + m_pInfoDest = new QLabel(this); grid->addWidget( m_pInfoDest,line,1 ); ++line; + + m_pInfoList = new Q3ListView(this); topLayout->addWidget( m_pInfoList ); + m_pInfoList->addColumn(i18n("Dir")); + m_pInfoList->addColumn(i18n("Type")); + m_pInfoList->addColumn(i18n("Size")); + m_pInfoList->addColumn(i18n("Attr")); + m_pInfoList->addColumn(i18n("Last Modification")); + m_pInfoList->addColumn(i18n("Link-Destination")); + setMinimumSize( 100,100 ); + + m_pInfoList->installEventFilter(this); +} + +bool DirectoryMergeInfo::eventFilter(QObject*o, QEvent* e) +{ + if ( e->type()==QEvent::FocusIn && o==m_pInfoList ) + emit gotFocus(); + return false; +} + +static void addListViewItem( Q3ListView* pListView, const QString& dir, + const QString& basePath, FileAccess& fi ) +{ + if ( basePath.isEmpty() ) + { + return; + } + else + { + if ( fi.exists() ) + { +#if QT_VERSION==230 + QString dateString = fi.lastModified().toString(); +#else + QString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss"); +#endif + + new Q3ListViewItem( + pListView, + dir, + QString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : ""), + QString::number(fi.size()), + QString(fi.isReadable() ? "r" : " ") + (fi.isWritable()?"w" : " ") +#ifdef _WIN32 + /*Future: Use GetFileAttributes()*/, +#else + + (fi.isExecutable()?"x" : " "), +#endif + dateString, + QString(fi.isSymLink() ? (" -> " + fi.readLink()) : QString("")) + ); + } + else + { + new Q3ListViewItem( + pListView, + dir, + i18n("not available"), + "", + "", + "", + "" + ); + } + } +} + +void DirectoryMergeInfo::setInfo( + const FileAccess& dirA, + const FileAccess& dirB, + const FileAccess& dirC, + const FileAccess& dirDest, + MergeFileInfos& mfi ) +{ + bool bHideDest = false; + if ( dirA.absFilePath()==dirDest.absFilePath() ) + { + m_pA->setText( i18n("A (Dest): ") ); bHideDest=true; + } + else + m_pA->setText( !dirC.isValid() ? QString("A: ") : i18n("A (Base): ")); + + m_pInfoA->setText( dirA.prettyAbsPath() ); + + if ( dirB.absFilePath()==dirDest.absFilePath() ) + { + m_pB->setText( i18n("B (Dest): ") ); bHideDest=true; + } + else + m_pB->setText( "B: " ); + m_pInfoB->setText( dirB.prettyAbsPath() ); + + if ( dirC.absFilePath()==dirDest.absFilePath() ) + { + m_pC->setText( i18n("C (Dest): ") ); bHideDest=true; + } + else + m_pC->setText( "C: " ); + m_pInfoC->setText( dirC.prettyAbsPath() ); + + m_pDest->setText( i18n("Dest: ") ); m_pInfoDest->setText( dirDest.prettyAbsPath() ); + + if (!dirC.isValid()) { m_pC->hide(); m_pInfoC->hide(); } + else { m_pC->show(); m_pInfoC->show(); } + + if (!dirDest.isValid()||bHideDest) { m_pDest->hide(); m_pInfoDest->hide(); } + else { m_pDest->show(); m_pInfoDest->show(); } + + m_pInfoList->clear(); + addListViewItem( m_pInfoList, "A", dirA.prettyAbsPath(), mfi.m_fileInfoA ); + addListViewItem( m_pInfoList, "B", dirB.prettyAbsPath(), mfi.m_fileInfoB ); + addListViewItem( m_pInfoList, "C", dirC.prettyAbsPath(), mfi.m_fileInfoC ); + if (!bHideDest) + { + FileAccess fiDest( dirDest.prettyAbsPath() + "/" + mfi.m_subPath, true ); + addListViewItem( m_pInfoList, i18n("Dest"), dirDest.prettyAbsPath(), fiDest ); + } +} + +QTextStream& operator<<( QTextStream& ts, MergeFileInfos& mfi ) +{ + ts << "{\n"; + ValueMap vm; + vm.writeEntry( "SubPath", mfi.m_subPath ); + vm.writeEntry( "ExistsInA", mfi.m_bExistsInA ); + vm.writeEntry( "ExistsInB", mfi.m_bExistsInB ); + vm.writeEntry( "ExistsInC", mfi.m_bExistsInC ); + vm.writeEntry( "EqualAB", mfi.m_bEqualAB ); + vm.writeEntry( "EqualAC", mfi.m_bEqualAC ); + vm.writeEntry( "EqualBC", mfi.m_bEqualBC ); + //DirMergeItem* m_pDMI; + //MergeFileInfos* m_pParent; + vm.writeEntry( "MergeOperation", (int) mfi.m_eMergeOperation ); + vm.writeEntry( "DirA", mfi.m_bDirA ); + vm.writeEntry( "DirB", mfi.m_bDirB ); + vm.writeEntry( "DirC", mfi.m_bDirC ); + vm.writeEntry( "LinkA", mfi.m_bLinkA ); + vm.writeEntry( "LinkB", mfi.m_bLinkB ); + vm.writeEntry( "LinkC", mfi.m_bLinkC ); + vm.writeEntry( "OperationComplete", mfi.m_bOperationComplete ); + //bool m_bSimOpComplete ); + + vm.writeEntry( "AgeA", (int) mfi.m_ageA ); + vm.writeEntry( "AgeB", (int) mfi.m_ageB ); + vm.writeEntry( "AgeC", (int) mfi.m_ageC ); + vm.writeEntry( "ConflictingAges", mfi.m_bConflictingAges ); // Equal age but files are not! + + //FileAccess m_fileInfoA; + //FileAccess m_fileInfoB; + //FileAccess m_fileInfoC; + + //TotalDiffStatus m_totalDiffStatus; + + vm.save(ts); + + ts << "}\n"; + + return ts; +} + +void DirectoryMergeWindow::slotSaveMergeState() +{ + //slotStatusMsg(i18n("Saving Directory Merge State ...")); + + //QString s = KFileDialog::getSaveURL( QDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); + QString s = KFileDialog::getSaveFileName( QDir::currentDirPath(), 0, this, i18n("Save Directory Merge State As...") ); + if(!s.isEmpty()) + { + m_dirMergeStateFilename = s; + + + QFile file(m_dirMergeStateFilename); + bool bSuccess = file.open( QIODevice::WriteOnly ); + if ( bSuccess ) + { + QTextStream ts( &file ); + + Q3ListViewItemIterator it( this ); + while ( it.current() ) { + DirMergeItem* item = static_cast(it.current()); + MergeFileInfos* pMFI = item->m_pMFI; + ts << *pMFI; + ++it; + } + } + } + + //slotStatusMsg(i18n("Ready.")); + +} + +void DirectoryMergeWindow::slotLoadMergeState() +{ +} + +void DirectoryMergeWindow::updateFileVisibilities() +{ + bool bShowIdentical = m_pDirShowIdenticalFiles->isChecked(); + bool bShowDifferent = m_pDirShowDifferentFiles->isChecked(); + bool bShowOnlyInA = m_pDirShowFilesOnlyInA->isChecked(); + bool bShowOnlyInB = m_pDirShowFilesOnlyInB->isChecked(); + bool bShowOnlyInC = m_pDirShowFilesOnlyInC->isChecked(); + bool bThreeDirs = m_dirC.isValid(); + m_pSelection1Item = 0; + m_pSelection2Item = 0; + m_pSelection3Item = 0; + + Q3ListViewItem* p = firstChild(); + while(p) + { + DirMergeItem* pDMI = static_cast(p); + MergeFileInfos* pMFI = pDMI->m_pMFI; + bool bDir = pMFI->m_bDirA || pMFI->m_bDirB || pMFI->m_bDirC; + bool bExistsEverywhere = pMFI->m_bExistsInA && pMFI->m_bExistsInB && (pMFI->m_bExistsInC || !bThreeDirs); + int existCount = int(pMFI->m_bExistsInA) + int(pMFI->m_bExistsInB) + int(pMFI->m_bExistsInC); + bool bVisible = + ( bShowIdentical && bExistsEverywhere && pMFI->m_bEqualAB && (pMFI->m_bEqualAC || !bThreeDirs) ) + || ( (bShowDifferent||bDir) && existCount>=2 && (!pMFI->m_bEqualAB || !(pMFI->m_bEqualAC || !bThreeDirs))) + || ( bShowOnlyInA && pMFI->m_bExistsInA && !pMFI->m_bExistsInB && !pMFI->m_bExistsInC ) + || ( bShowOnlyInB && !pMFI->m_bExistsInA && pMFI->m_bExistsInB && !pMFI->m_bExistsInC ) + || ( bShowOnlyInC && !pMFI->m_bExistsInA && !pMFI->m_bExistsInB && pMFI->m_bExistsInC ); + + QString fileName = pMFI->m_subPath.section( '/', -1 ); + bVisible = bVisible && ( + bDir && ! wildcardMultiMatch( m_pOptions->m_DmDirAntiPattern, fileName, m_bCaseSensitive ) + || wildcardMultiMatch( m_pOptions->m_DmFilePattern, fileName, m_bCaseSensitive ) + && !wildcardMultiMatch( m_pOptions->m_DmFileAntiPattern, fileName, m_bCaseSensitive ) ); + + p->setVisible(bVisible); + p = treeIterator( p, true, true ); + } +} + +void DirectoryMergeWindow::slotShowIdenticalFiles() { m_pOptions->m_bDmShowIdenticalFiles=m_pDirShowIdenticalFiles->isChecked(); + updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowDifferentFiles() { updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowFilesOnlyInA() { updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowFilesOnlyInB() { updateFileVisibilities(); } +void DirectoryMergeWindow::slotShowFilesOnlyInC() { updateFileVisibilities(); } + +void DirectoryMergeWindow::slotSynchronizeDirectories() { } +void DirectoryMergeWindow::slotChooseNewerFiles() { } + +void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ) +{ +#include "xpm/startmerge.xpm" +#include "xpm/showequalfiles.xpm" +#include "xpm/showfilesonlyina.xpm" +#include "xpm/showfilesonlyinb.xpm" +#include "xpm/showfilesonlyinc.xpm" + DirectoryMergeWindow* p = this; + + m_pDirStartOperation = new KAction(i18n("Start/Continue Directory Merge"), Qt::Key_F7, p, SLOT(slotRunOperationForAllItems()), ac, "dir_start_operation"); + m_pDirRunOperationForCurrentItem = new KAction(i18n("Run Operation for Current Item"), Qt::Key_F6, p, SLOT(slotRunOperationForCurrentItem()), ac, "dir_run_operation_for_current_item"); + m_pDirCompareCurrent = new KAction(i18n("Compare Selected File"), 0, p, SLOT(compareCurrentFile()), ac, "dir_compare_current"); + m_pDirMergeCurrent = new KAction(i18n("Merge Current File"), 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"); + m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, p, SLOT(slotSaveMergeState()), ac, "dir_save_merge_state"); + m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, p, SLOT(slotLoadMergeState()), ac, "dir_load_merge_state"); + m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, p, SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere"); + m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, p, SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere"); + m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, p, SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere"); + m_pDirAutoChoiceEverywhere = new KAction(i18n("Auto-Choose Operation for All Items"), 0, p, SLOT(slotAutoChooseEverywhere()), ac, "dir_autochoose_everywhere"); + m_pDirDoNothingEverywhere = new KAction(i18n("No Operation for All Items"), 0, p, SLOT(slotNoOpEverywhere()), ac, "dir_nothing_everywhere"); + +// m_pDirSynchronizeDirectories = new KToggleAction(i18n("Synchronize Directories"), 0, this, SLOT(slotSynchronizeDirectories()), ac, "dir_synchronize_directories"); +// m_pDirChooseNewerFiles = new KToggleAction(i18n("Copy Newer Files Instead of Merging"), 0, this, SLOT(slotChooseNewerFiles()), ac, "dir_choose_newer_files"); + + m_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), 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"), 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 ); + + m_pDirCompareExplicit = new KAction(i18n("Compare Explicitly Selected Files"), 0, p, SLOT(slotCompareExplicitlySelectedFiles()), ac, "dir_compare_explicitly_selected_files"); + m_pDirMergeExplicit = new KAction(i18n("Merge Explicitly Selected Files"), 0, p, SLOT(slotMergeExplicitlySelectedFiles()), ac, "dir_merge_explicitly_selected_files"); + + m_pDirCurrentDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_do_nothing"); + m_pDirCurrentChooseA = new KAction(i18n("A"), 0, p, SLOT(slotCurrentChooseA()), ac, "dir_current_choose_a"); + m_pDirCurrentChooseB = new KAction(i18n("B"), 0, p, SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b"); + m_pDirCurrentChooseC = new KAction(i18n("C"), 0, p, SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c"); + m_pDirCurrentMerge = new KAction(i18n("Merge"), 0, p, SLOT(slotCurrentMerge()), ac, "dir_current_merge"); + m_pDirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, p, SLOT(slotCurrentDelete()), ac, "dir_current_delete"); + + m_pDirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing"); + m_pDirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, p, SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" ); + m_pDirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, p, SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" ); + m_pDirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, p, SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a"); + m_pDirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, p, SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b"); + m_pDirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, p, SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b"); + m_pDirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, p, SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a"); + m_pDirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, p, SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b"); + m_pDirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, p, SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b"); + + +} + + +void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, + KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ) +{ + m_pDirStartOperation->setEnabled( bDirCompare ); + m_pDirRunOperationForCurrentItem->setEnabled( bDirCompare ); + m_pDirFoldAll->setEnabled( bDirCompare ); + m_pDirUnfoldAll->setEnabled( bDirCompare ); + + m_pDirCompareCurrent->setEnabled( bDirCompare && isVisible() && isFileSelected() ); + + m_pDirMergeCurrent->setEnabled( bDirCompare && isVisible() && isFileSelected() + || bDiffWindowVisible ); + + m_pDirRescan->setEnabled( bDirCompare ); + + m_pDirAutoChoiceEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirDoNothingEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirChooseAEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirChooseBEverywhere->setEnabled( bDirCompare && isVisible() ); + m_pDirChooseCEverywhere->setEnabled( bDirCompare && isVisible() ); + + bool bThreeDirs = m_dirC.isValid(); + + Q3ListViewItem* lvi = currentItem(); + DirMergeItem* pDMI = lvi==0 ? 0 : static_cast(lvi); + MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; + + bool bItemActive = bDirCompare && isVisible() && pMFI!=0;// && hasFocus(); + bool bMergeMode = bThreeDirs || !m_bSyncMode; + bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI); + + bool bDirWindowHasFocus = isVisible() && hasFocus(); + + m_pDirShowIdenticalFiles->setEnabled( bDirCompare && isVisible() ); + m_pDirShowDifferentFiles->setEnabled( bDirCompare && isVisible() ); + m_pDirShowFilesOnlyInA->setEnabled( bDirCompare && isVisible() ); + m_pDirShowFilesOnlyInB->setEnabled( bDirCompare && isVisible() ); + m_pDirShowFilesOnlyInC->setEnabled( bDirCompare && isVisible() && bThreeDirs ); + + m_pDirCompareExplicit->setEnabled( bDirCompare && isVisible() && m_pSelection2Item!=0 ); + m_pDirMergeExplicit->setEnabled( bDirCompare && isVisible() && m_pSelection2Item!=0 ); + + m_pDirCurrentDoNothing->setEnabled( bItemActive && bMergeMode ); + m_pDirCurrentChooseA->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInA ); + m_pDirCurrentChooseB->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInB ); + m_pDirCurrentChooseC->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInC ); + m_pDirCurrentMerge->setEnabled( bItemActive && bMergeMode && !bFTConflict ); + m_pDirCurrentDelete->setEnabled( bItemActive && bMergeMode ); + if ( bDirWindowHasFocus ) + { + chooseA->setEnabled( bItemActive && pMFI->m_bExistsInA ); + chooseB->setEnabled( bItemActive && pMFI->m_bExistsInB ); + chooseC->setEnabled( bItemActive && pMFI->m_bExistsInC ); + chooseA->setChecked( false ); + chooseB->setChecked( false ); + chooseC->setChecked( false ); + } + + m_pDirCurrentSyncDoNothing->setEnabled( bItemActive && !bMergeMode ); + m_pDirCurrentSyncCopyAToB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA ); + m_pDirCurrentSyncCopyBToA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB ); + m_pDirCurrentSyncDeleteA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA ); + m_pDirCurrentSyncDeleteB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB ); + m_pDirCurrentSyncDeleteAAndB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB && pMFI->m_bExistsInB ); + m_pDirCurrentSyncMergeToA->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); + m_pDirCurrentSyncMergeToB->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); + m_pDirCurrentSyncMergeToAAndB->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); +} + + +//#include "directorymergewindow.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/directorymergewindow_old.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/directorymergewindow_old.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,350 @@ +/*************************************************************************** + directorymergewindow.h + ------------------- + begin : Sat Oct 19 2002 + copyright : (C) 2002-2005 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef DIRECTORY_MERGE_WINDOW_H +#define DIRECTORY_MERGE_WINDOW_H + +#include +#include +#include +#include "common.h" +#include "fileaccess.h" +#include "diff.h" //TotalDiffStatus + +class OptionDialog; +class KIconLoader; +class StatusInfo; +class DirectoryMergeInfo; +class OneDirectoryInfo; +class QLabel; +class KAction; +class KToggleAction; +class KActionCollection; +class TotalDiffStatus; + +enum e_MergeOperation +{ + eTitleId, + eNoOperation, + // Operations in sync mode (with only two directories): + eCopyAToB, eCopyBToA, eDeleteA, eDeleteB, eDeleteAB, eMergeToA, eMergeToB, eMergeToAB, + + // Operations in merge mode (with two or three directories) + eCopyAToDest, eCopyBToDest, eCopyCToDest, eDeleteFromDest, eMergeABCToDest, + eMergeABToDest, + eConflictingFileTypes, // Error + eConflictingAges // Equal age but files are not! +}; + +class DirMergeItem; + +enum e_Age { eNew, eMiddle, eOld, eNotThere, eAgeEnd }; + +class MergeFileInfos +{ +public: + MergeFileInfos(){ m_bEqualAB=false; m_bEqualAC=false; m_bEqualBC=false; + m_pDMI=0; m_pParent=0; + m_bExistsInA=false;m_bExistsInB=false;m_bExistsInC=false; + m_bDirA=false; m_bDirB=false; m_bDirC=false; + m_bLinkA=false; m_bLinkB=false; m_bLinkC=false; + m_bOperationComplete=false; m_bSimOpComplete = false; + m_eMergeOperation=eNoOperation; + m_ageA = eNotThere; m_ageB=eNotThere; m_ageC=eNotThere; + m_bConflictingAges=false; } + bool operator>( const MergeFileInfos& ); + QString m_subPath; + + bool m_bExistsInA; + bool m_bExistsInB; + bool m_bExistsInC; + bool m_bEqualAB; + bool m_bEqualAC; + bool m_bEqualBC; + DirMergeItem* m_pDMI; + MergeFileInfos* m_pParent; + e_MergeOperation m_eMergeOperation; + void setMergeOperation( e_MergeOperation eMOp ); + bool m_bDirA; + bool m_bDirB; + bool m_bDirC; + bool m_bLinkA; + bool m_bLinkB; + bool m_bLinkC; + bool m_bOperationComplete; + bool m_bSimOpComplete; + e_Age m_ageA; + e_Age m_ageB; + e_Age m_ageC; + bool m_bConflictingAges; // Equal age but files are not! + + FileAccess m_fileInfoA; + FileAccess m_fileInfoB; + FileAccess m_fileInfoC; + + TotalDiffStatus m_totalDiffStatus; +}; + +class DirMergeItem : public Q3ListViewItem +{ +public: + DirMergeItem( Q3ListView* pParent, const QString&, MergeFileInfos*); + DirMergeItem( DirMergeItem* pParent, const QString&, MergeFileInfos*); + ~DirMergeItem(); + MergeFileInfos* m_pMFI; + 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 Q3ListView +{ + Q_OBJECT +public: + DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ); + ~DirectoryMergeWindow(); + void setDirectoryMergeInfo(DirectoryMergeInfo* p){ m_pDirectoryMergeInfo=p; } + bool init( + FileAccess& dirA, + FileAccess& dirB, + FileAccess& dirC, + FileAccess& dirDest, + bool bDirectoryMerge + ); + bool isFileSelected(); + void allowResizeEvents(bool bAllowResizeEvents); + bool isDirectoryMergeInProgress() { return m_bRealMergeStarted; } + int totalColumnWidth(); + bool isSyncMode() { return m_bSyncMode; } + bool isScanning() { return m_bScanning; } + void initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ); + void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, + KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ); + void updateFileVisibilities(); + + virtual void keyPressEvent( QKeyEvent* e ); + virtual void focusInEvent( QFocusEvent* e ); + virtual void focusOutEvent( QFocusEvent* e ); + +public slots: + void reload(); + void mergeCurrentFile(); + void compareCurrentFile(); + void slotRunOperationForAllItems(); + void slotRunOperationForCurrentItem(); + void mergeResultSaved(const QString& fileName); + void slotChooseAEverywhere(); + void slotChooseBEverywhere(); + void slotChooseCEverywhere(); + void slotAutoChooseEverywhere(); + void slotNoOpEverywhere(); + void slotFoldAllSubdirs(); + void slotUnfoldAllSubdirs(); + void slotShowIdenticalFiles(); + void slotShowDifferentFiles(); + void slotShowFilesOnlyInA(); + void slotShowFilesOnlyInB(); + void slotShowFilesOnlyInC(); + + void slotSynchronizeDirectories(); + void slotChooseNewerFiles(); + + void slotCompareExplicitlySelectedFiles(); + void slotMergeExplicitlySelectedFiles(); + + // Merge current item (merge mode) + void slotCurrentDoNothing(); + void slotCurrentChooseA(); + void slotCurrentChooseB(); + void slotCurrentChooseC(); + void slotCurrentMerge(); + void slotCurrentDelete(); + // Sync current item + void slotCurrentCopyAToB(); + void slotCurrentCopyBToA(); + void slotCurrentDeleteA(); + void slotCurrentDeleteB(); + void slotCurrentDeleteAAndB(); + void slotCurrentMergeToA(); + void slotCurrentMergeToB(); + void slotCurrentMergeToAAndB(); + + void slotSaveMergeState(); + void slotLoadMergeState(); + +protected: + void mergeContinue( bool bStart, bool bVerbose ); + void resizeEvent(QResizeEvent* e); + bool m_bAllowResizeEvents; + + void prepareListView(ProgressProxy& pp); + void calcSuggestedOperation( MergeFileInfos& mfi, e_MergeOperation eDefaultOperation ); + void setAllMergeOperations( e_MergeOperation eDefaultOperation ); + friend class MergeFileInfos; + + bool canContinue(); + void prepareMergeStart( Q3ListViewItem* pBegin, Q3ListViewItem* pEnd, bool bVerbose ); + bool executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ); + + void scanDirectory( const QString& dirName, t_DirectoryList& dirList ); + void scanLocalDirectory( const QString& dirName, t_DirectoryList& dirList ); + void fastFileComparison( FileAccess& fi1, FileAccess& fi2, + bool& bEqual, bool& bError, QString& status ); + void compareFilesAndCalcAges( MergeFileInfos& mfi ); + + QString fullNameA( const MergeFileInfos& mfi ) + { return m_dirA.absFilePath() + "/" + mfi.m_subPath; } + QString fullNameB( const MergeFileInfos& mfi ) + { return m_dirB.absFilePath() + "/" + mfi.m_subPath; } + QString fullNameC( const MergeFileInfos& mfi ) + { return m_dirC.absFilePath() + "/" + mfi.m_subPath; } + QString fullNameDest( const MergeFileInfos& mfi ) + { return m_dirDestInternal.absFilePath() + "/" + mfi.m_subPath; } + + bool copyFLD( const QString& srcName, const QString& destName ); + bool deleteFLD( const QString& name, bool bCreateBackup ); + bool makeDir( const QString& name, bool bQuiet=false ); + bool renameFLD( const QString& srcName, const QString& destName ); + bool mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC, + const QString& nameDest, bool& bSingleFileMerge ); + + FileAccess m_dirA; + FileAccess m_dirB; + FileAccess m_dirC; + FileAccess m_dirDest; + FileAccess m_dirDestInternal; + + QString m_dirMergeStateFilename; + + std::map m_fileMergeMap; + + bool m_bFollowDirLinks; + bool m_bFollowFileLinks; + bool m_bSimulatedMergeStarted; + bool m_bRealMergeStarted; + bool m_bError; + bool m_bSyncMode; + bool m_bDirectoryMerge; // if true, then merge is the default operation, otherwise it's diff. + bool m_bCaseSensitive; + + bool m_bScanning; // true while in init() + + OptionDialog* m_pOptions; + KIconLoader* m_pIconLoader; + DirectoryMergeInfo* m_pDirectoryMergeInfo; + StatusInfo* m_pStatusInfo; + + typedef std::list MergeItemList; + MergeItemList m_mergeItemList; + MergeItemList::iterator m_currentItemForOperation; + + DirMergeItem* m_pSelection1Item; + int m_selection1Column; + DirMergeItem* m_pSelection2Item; + int m_selection2Column; + DirMergeItem* m_pSelection3Item; + int m_selection3Column; + void selectItemAndColumn(DirMergeItem* pDMI, int c, bool bContextMenu); + friend class DirMergeItem; + + KAction* m_pDirStartOperation; + KAction* m_pDirRunOperationForCurrentItem; + KAction* m_pDirCompareCurrent; + KAction* m_pDirMergeCurrent; + KAction* m_pDirRescan; + KAction* m_pDirChooseAEverywhere; + KAction* m_pDirChooseBEverywhere; + KAction* m_pDirChooseCEverywhere; + KAction* m_pDirAutoChoiceEverywhere; + KAction* m_pDirDoNothingEverywhere; + KAction* m_pDirFoldAll; + KAction* m_pDirUnfoldAll; + + KToggleAction* m_pDirShowIdenticalFiles; + KToggleAction* m_pDirShowDifferentFiles; + KToggleAction* m_pDirShowFilesOnlyInA; + KToggleAction* m_pDirShowFilesOnlyInB; + KToggleAction* m_pDirShowFilesOnlyInC; + + KToggleAction* m_pDirSynchronizeDirectories; + KToggleAction* m_pDirChooseNewerFiles; + + KAction* m_pDirCompareExplicit; + KAction* m_pDirMergeExplicit; + + KAction* m_pDirCurrentDoNothing; + KAction* m_pDirCurrentChooseA; + KAction* m_pDirCurrentChooseB; + KAction* m_pDirCurrentChooseC; + KAction* m_pDirCurrentMerge; + KAction* m_pDirCurrentDelete; + + KAction* m_pDirCurrentSyncDoNothing; + KAction* m_pDirCurrentSyncCopyAToB; + KAction* m_pDirCurrentSyncCopyBToA; + KAction* m_pDirCurrentSyncDeleteA; + KAction* m_pDirCurrentSyncDeleteB; + KAction* m_pDirCurrentSyncDeleteAAndB; + KAction* m_pDirCurrentSyncMergeToA; + KAction* m_pDirCurrentSyncMergeToB; + KAction* m_pDirCurrentSyncMergeToAAndB; + + KAction* m_pDirSaveMergeState; + KAction* m_pDirLoadMergeState; +signals: + void startDiffMerge(QString fn1,QString fn2, QString fn3, QString ofn, QString,QString,QString,TotalDiffStatus*); + void checkIfCanContinue( bool* pbContinue ); + void updateAvailabilities(); + void statusBarMessage( const QString& msg ); +protected slots: + 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 +{ + Q_OBJECT +public: + DirectoryMergeInfo( QWidget* pParent ); + void setInfo( + const FileAccess& APath, + const FileAccess& BPath, + const FileAccess& CPath, + const FileAccess& DestPath, + MergeFileInfos& mfi ); + Q3ListView* getInfoList() {return m_pInfoList;} + virtual bool eventFilter( QObject* o, QEvent* e ); +signals: + void gotFocus(); +private: + QLabel* m_pInfoA; + QLabel* m_pInfoB; + QLabel* m_pInfoC; + QLabel* m_pInfoDest; + + QLabel* m_pA; + QLabel* m_pB; + QLabel* m_pC; + QLabel* m_pDest; + + Q3ListView* m_pInfoList; +}; + + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/fileaccess.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/fileaccess.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1805 @@ +/*************************************************************************** + * Copyright (C) 2003-2006 by Joachim Eibl * + * joachim.eibl at gmx.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#include "fileaccess.h" +#include "optiondialog.h" +#include "common.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef _WIN32 +#include +#include +#include +#else +#include // Needed for creating symbolic links via symlink(). +#include +#endif + + +ProgressDialog* g_pProgressDialog=0; + + +FileAccess::FileAccess( const QString& name, bool bWantToWrite ) +{ + setFile( name, bWantToWrite ); +} + +FileAccess::FileAccess() +{ + m_bValidData = false; + m_size = 0; + m_creationTime = QDateTime(); + m_accessTime = QDateTime(); + m_modificationTime = QDateTime(); + m_bReadable = false; + m_bWritable = false; + m_bExecutable = false; + m_bLocal = false; + m_bHidden = false; + m_bExists = false; + m_bFile = false; + m_bDir = false; + m_bSymLink = false; +} + +FileAccess::~FileAccess() +{ + if( !m_localCopy.isEmpty() ) + { + removeTempFile( m_localCopy ); + } +} + +void FileAccess::setFile( const QString& name, bool bWantToWrite ) +{ + m_url = KURL::fromPathOrURL( name ); + m_bValidData = false; + + m_size = 0; + m_creationTime = QDateTime(); + m_accessTime = QDateTime(); + m_modificationTime = QDateTime(); + m_bReadable = false; + m_bWritable = false; + m_bExecutable = false; + m_bHidden = false; + m_bExists = false; + m_bFile = false; + m_bDir = false; + m_bSymLink = false; + m_linkTarget = ""; + m_fileType = -1; + m_bLocal = true; + + // Note: Checking if the filename-string is empty is necessary for Win95/98/ME. + // The isFile() / isDir() queries would cause the program to crash. + // (This is a Win95-bug which has been corrected only in WinNT/2000/XP.) + if ( !name.isEmpty() ) + { + // FileAccess tries to detect if the given name is an URL or a local file. + // This is a problem if the filename looks like an URL (i.e. contains a colon ':'). + // e.g. "file:f.txt" is a valid filename. + // Most of the time it is sufficient to check if the file exists locally. + // 2 Problems remain: + // 1. When the local file exists and the remote location is wanted nevertheless. (unlikely) + // 2. When the local file doesn't exist and should be written to. + + bool bExistsLocal = QDir().exists(name); + if ( m_url.isLocalFile() || !m_url.isValid() || bExistsLocal ) // assuming that invalid means relative + { + QString localName = name; + if ( !bExistsLocal && m_url.isLocalFile() && name.left(5).toLower()=="file:" ) + { + localName = m_url.path(); // I want the path without preceding "file:" + } + QFileInfo fi( localName ); +#if defined(Q_WS_WIN) + // On some windows machines in a network this takes very long. + // and it's not so important anyway. + m_bReadable = true; + m_bWritable = true; // in certain situations this might become a problem though + m_bExecutable = false; +#else + m_bReadable = fi.isReadable(); + m_bWritable = fi.isWritable(); + m_bExecutable = fi.isExecutable(); +#endif + m_creationTime = fi.created(); + m_bHidden = fi.isHidden(); + m_modificationTime = fi.lastModified(); + m_accessTime = fi.lastRead(); + m_size = fi.size(); + m_bSymLink = fi.isSymLink(); + m_bFile = fi.isFile(); + m_bDir = fi.isDir(); + m_bExists = fi.exists(); + m_name = fi.fileName(); + m_path = fi.filePath(); + m_absFilePath= fi.absoluteFilePath(); + if ( m_bSymLink ) m_linkTarget = fi.readLink(); + m_bLocal = true; + m_bValidData = true; + if ( ! m_url.isValid() ) + { + m_url.setPath( m_absFilePath ); + } + + if ( !m_bExists && m_absFilePath.contains("@@") ) + { + // Try reading a clearcase file + m_localCopy = FileAccess::tempFileName(); + QString cmd = "cleartool get -to \"" + m_localCopy + "\" \"" + m_absFilePath + "\""; + QProcess process; + process.start( cmd ); + process.waitForFinished(-1); + //::system( cmd.local8Bit() ); + + QFileInfo fi( m_localCopy ); +#if defined(Q_WS_WIN) + m_bReadable = true;//fi.isReadable(); + m_bWritable = true;//fi.isWritable(); + m_bExecutable = false;//fi.isExecutable(); +#else + m_bReadable = fi.isReadable(); + m_bWritable = fi.isWritable(); + m_bExecutable = fi.isExecutable(); +#endif + m_creationTime = fi.created(); + m_bHidden = fi.isHidden(); + m_modificationTime = fi.lastModified(); + m_accessTime = fi.lastRead(); + m_size = fi.size(); + m_bSymLink = fi.isSymLink(); + m_bFile = fi.isFile(); + m_bDir = fi.isDir(); + m_bExists = fi.exists(); + } + } + else + { + m_absFilePath = name; + m_name = m_url.fileName(); + m_bLocal = false; + + FileAccessJobHandler jh( this ); // A friend, which writes to the parameters of this class! + jh.stat(2/*all details*/, bWantToWrite); // returns bSuccess, ignored + + m_path = name; + m_bValidData = true; // After running stat() the variables are initialised + // and valid even if the file doesn't exist and the stat + // query failed. + } + } +} + +void FileAccess::addPath( const QString& txt ) +{ + if ( m_url.isValid() ) + { + m_url.addPath( txt ); + setFile( m_url.url() ); // reinitialise + } + else + { + QString slash = (txt.isEmpty() || txt[0]=='/') ? "" : "/"; + setFile( absFilePath() + slash + txt ); + } +} + +/* Filetype: + S_IFMT 0170000 bitmask for the file type bitfields + S_IFSOCK 0140000 socket + S_IFLNK 0120000 symbolic link + S_IFREG 0100000 regular file + S_IFBLK 0060000 block device + S_IFDIR 0040000 directory + S_IFCHR 0020000 character device + S_IFIFO 0010000 fifo + S_ISUID 0004000 set UID bit + S_ISGID 0002000 set GID bit (see below) + S_ISVTX 0001000 sticky bit (see below) + + Access: + S_IRWXU 00700 mask for file owner permissions + S_IRUSR 00400 owner has read permission + S_IWUSR 00200 owner has write permission + S_IXUSR 00100 owner has execute permission + S_IRWXG 00070 mask for group permissions + S_IRGRP 00040 group has read permission + S_IWGRP 00020 group has write permission + S_IXGRP 00010 group has execute permission + S_IRWXO 00007 mask for permissions for others (not in group) + S_IROTH 00004 others have read permission + S_IWOTH 00002 others have write permisson + S_IXOTH 00001 others have execute permission +*/ + +#ifdef KREPLACEMENTS_H +void FileAccess::setUdsEntry( const KIO::UDSEntry& ){} // not needed if KDE is not available +#else +void FileAccess::setUdsEntry( const KIO::UDSEntry& e ) +{ + KIO::UDSEntry::const_iterator ei; + long acc = 0; + long fileType = 0; + for( ei=e.begin(); ei!=e.end(); ++ei ) + { + const KIO::UDSAtom& a = *ei; + switch( a.m_uds ) + { + case KIO::UDS_SIZE : m_size = a.m_long; break; + case KIO::UDS_USER : m_user = a.m_str; break; + case KIO::UDS_GROUP : m_group = a.m_str; break; + case KIO::UDS_NAME : m_path = a.m_str; break; // During listDir the relative path is given here. + case KIO::UDS_MODIFICATION_TIME : m_modificationTime.setTime_t( a.m_long ); break; + case KIO::UDS_ACCESS_TIME : m_accessTime.setTime_t( a.m_long ); break; + case KIO::UDS_CREATION_TIME : m_creationTime.setTime_t( a.m_long ); break; + case KIO::UDS_LINK_DEST : m_linkTarget = a.m_str; break; + case KIO::UDS_ACCESS : + { + acc = a.m_long; + m_bReadable = (acc & S_IRUSR)!=0; + m_bWritable = (acc & S_IWUSR)!=0; + m_bExecutable = (acc & S_IXUSR)!=0; + break; + } + case KIO::UDS_FILE_TYPE : + { + fileType = a.m_long; + m_bDir = ( fileType & S_IFMT ) == S_IFDIR; + m_bFile = ( fileType & S_IFMT ) == S_IFREG; + m_bSymLink = ( fileType & S_IFMT ) == S_IFLNK; + m_bExists = fileType != 0; + m_fileType = fileType; + break; + } + + case KIO::UDS_URL : // m_url = KURL( a.str ); + break; + case KIO::UDS_MIME_TYPE : break; + case KIO::UDS_GUESSED_MIME_TYPE : break; + case KIO::UDS_XML_PROPERTIES : break; + default: break; + } + } + + m_bExists = acc!=0 || fileType!=0; + + m_bLocal = false; + m_bValidData = true; + m_bSymLink = !m_linkTarget.isEmpty(); + if ( m_name.isEmpty() ) + { + int pos = m_path.findRev('/') + 1; + m_name = m_path.mid( pos ); + } + m_bHidden = m_name[0]=='.'; +} +#endif + + +bool FileAccess::isValid() const { return m_bValidData; } +bool FileAccess::isFile() const { return m_bFile; } +bool FileAccess::isDir() const { return m_bDir; } +bool FileAccess::isSymLink() const { return m_bSymLink; } +bool FileAccess::exists() const { return m_bExists; } +long FileAccess::size() const { return m_size; } +KURL FileAccess::url() const { return m_url; } +bool FileAccess::isLocal() const { return m_bLocal; } +bool FileAccess::isReadable() const { return m_bReadable; } +bool FileAccess::isWritable() const { return m_bWritable; } +bool FileAccess::isExecutable() const { return m_bExecutable; } +bool FileAccess::isHidden() const { return m_bHidden; } +QString FileAccess::readLink() const { return m_linkTarget; } +QString FileAccess::absFilePath() const{ return m_absFilePath; } // Full abs path +QString FileAccess::fileName() const { return m_name; } // Just the name-part of the path, without parent directories +QString FileAccess::filePath() const { return m_path; } // The path-string that was used during construction +QString FileAccess::prettyAbsPath() const { return isLocal() ? m_absFilePath : m_url.prettyURL(); } + +QDateTime FileAccess::created() const +{ + return ( m_creationTime.isValid() ? m_creationTime : m_modificationTime ); +} + +QDateTime FileAccess::lastModified() const +{ + return m_modificationTime; +} + +QDateTime FileAccess::lastRead() const +{ + return ( m_accessTime.isValid() ? m_accessTime : m_modificationTime ); +} + +static bool interruptableReadFile( QFile& f, void* pDestBuffer, unsigned long maxLength ) +{ + ProgressProxy pp; + const unsigned long maxChunkSize = 100000; + unsigned long i=0; + while( i " + bakName; + return false; + } + } + return true; +} + +FileAccessJobHandler::FileAccessJobHandler( FileAccess* pFileAccess ) +{ + m_pFileAccess = pFileAccess; + m_bSuccess = false; +} + +bool FileAccessJobHandler::stat( int detail, bool bWantToWrite ) +{ + m_bSuccess = false; + m_pFileAccess->m_statusText = QString(); + KIO::StatJob* pStatJob = KIO::stat( m_pFileAccess->m_url, ! bWantToWrite, detail, false ); + + connect( pStatJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotStatResult(KIO::Job*))); + + g_pProgressDialog->enterEventLoop( pStatJob, i18n("Getting file status: %1").arg(m_pFileAccess->prettyAbsPath()) ); + + return m_bSuccess; +} + +void FileAccessJobHandler::slotStatResult(KIO::Job* pJob) +{ + if ( pJob->error() ) + { + //pJob->showErrorDialog(g_pProgressDialog); + m_pFileAccess->m_bExists = false; + m_bSuccess = true; + } + else + { + m_bSuccess = true; + + m_pFileAccess->m_bValidData = true; + const KIO::UDSEntry e = static_cast(pJob)->statResult(); + + m_pFileAccess->setUdsEntry( e ); + } + + g_pProgressDialog->exitEventLoop(); +} + + +bool FileAccessJobHandler::get(void* pDestBuffer, long maxLength ) +{ + ProgressProxy pp; // Implicitly used in slotPercent() + if ( maxLength>0 && !pp.wasCancelled() ) + { + KIO::TransferJob* pJob = KIO::get( m_pFileAccess->m_url, false /*reload*/, false ); + m_transferredBytes = 0; + m_pTransferBuffer = (char*)pDestBuffer; + m_maxLength = maxLength; + m_bSuccess = false; + m_pFileAccess->m_statusText = QString(); + + connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); + connect( pJob, SIGNAL(data(KIO::Job*,const QByteArray &)), this, SLOT(slotGetData(KIO::Job*, const QByteArray&))); + connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + + g_pProgressDialog->enterEventLoop( pJob, i18n("Reading file: %1").arg(m_pFileAccess->prettyAbsPath()) ); + return m_bSuccess; + } + else + return true; +} + +void FileAccessJobHandler::slotGetData( KIO::Job* pJob, const QByteArray& newData ) +{ + if ( pJob->error() ) + { + pJob->showErrorDialog(g_pProgressDialog); + } + else + { + long length = min2( long(newData.size()), m_maxLength - m_transferredBytes ); + ::memcpy( m_pTransferBuffer + m_transferredBytes, newData.data(), newData.size() ); + m_transferredBytes += length; + } +} + +bool FileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume, int permissions ) +{ + if ( maxLength>0 ) + { + KIO::TransferJob* pJob = KIO::put( m_pFileAccess->m_url, permissions, bOverwrite, bResume, false ); + m_transferredBytes = 0; + m_pTransferBuffer = (char*)pSrcBuffer; + m_maxLength = maxLength; + m_bSuccess = false; + m_pFileAccess->m_statusText = QString(); + + connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotPutJobResult(KIO::Job*))); + connect( pJob, SIGNAL(dataReq(KIO::Job*, QByteArray&)), this, SLOT(slotPutData(KIO::Job*, QByteArray&))); + connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + + g_pProgressDialog->enterEventLoop( pJob, i18n("Writing file: %1").arg(m_pFileAccess->prettyAbsPath()) ); + return m_bSuccess; + } + else + return true; +} + +void FileAccessJobHandler::slotPutData( KIO::Job* pJob, QByteArray& data ) +{ + if ( pJob->error() ) + { + pJob->showErrorDialog(g_pProgressDialog); + } + else + { + long maxChunkSize = 100000; + long length = min2( maxChunkSize, m_maxLength - m_transferredBytes ); + data.resize( length ); + if ( data.size()==length ) + { + if ( length>0 ) + { + ::memcpy( data.data(), m_pTransferBuffer + m_transferredBytes, data.size() ); + m_transferredBytes += length; + } + } + else + { + KMessageBox::error( g_pProgressDialog, i18n("Out of memory") ); + data.resize(0); + m_bSuccess = false; + } + } +} + +void FileAccessJobHandler::slotPutJobResult(KIO::Job* pJob) +{ + if ( pJob->error() ) + { + pJob->showErrorDialog(g_pProgressDialog); + } + else + { + m_bSuccess = (m_transferredBytes == m_maxLength); // Special success condition + } + g_pProgressDialog->exitEventLoop(); // Close the dialog, return from exec() +} + +bool FileAccessJobHandler::mkDir( const QString& dirName ) +{ + KURL dirURL = KURL::fromPathOrURL( dirName ); + if ( dirName.isEmpty() ) + return false; + else if ( dirURL.isLocalFile() ) + { + return QDir().mkdir( dirURL.path() ); + } + else + { + m_bSuccess = false; + KIO::SimpleJob* pJob = KIO::mkdir( dirURL ); + connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); + + g_pProgressDialog->enterEventLoop( pJob, i18n("Making directory: %1").arg(dirName) ); + return m_bSuccess; + } +} + +bool FileAccessJobHandler::rmDir( const QString& dirName ) +{ + KURL dirURL = KURL::fromPathOrURL( dirName ); + if ( dirName.isEmpty() ) + return false; + else if ( dirURL.isLocalFile() ) + { + return QDir().rmdir( dirURL.path() ); + } + else + { + m_bSuccess = false; + KIO::SimpleJob* pJob = KIO::rmdir( dirURL ); + connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); + + g_pProgressDialog->enterEventLoop(pJob, i18n("Removing directory: %1").arg(dirName)); + return m_bSuccess; + } +} + +bool FileAccessJobHandler::removeFile( const QString& fileName ) +{ + if ( fileName.isEmpty() ) + return false; + else + { + m_bSuccess = 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) ); + return m_bSuccess; + } +} + +bool FileAccessJobHandler::symLink( const QString& linkTarget, const QString& linkLocation ) +{ + if ( linkTarget.isEmpty() || linkLocation.isEmpty() ) + return false; + else + { + m_bSuccess = 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, + i18n("Creating symbolic link: %1 -> %2").arg(linkLocation).arg(linkTarget) ); + return m_bSuccess; + } +} + +bool FileAccessJobHandler::rename( const QString& dest ) +{ + KURL kurl = KURL::fromPathOrURL( dest ); + if ( dest.isEmpty() ) + return false; + else if ( m_pFileAccess->isLocal() && kurl.isLocalFile() ) + { + return QDir().rename( m_pFileAccess->absFilePath(), kurl.path() ); + } + else + { + bool bOverwrite = false; + bool bResume = false; + bool bShowProgress = false; + int permissions=-1; + m_bSuccess = false; + 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))); + + g_pProgressDialog->enterEventLoop( pJob, + i18n("Renaming file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) ); + return m_bSuccess; + } +} + +void FileAccessJobHandler::slotSimpleJobResult(KIO::Job* pJob) +{ + if ( pJob->error() ) + { + pJob->showErrorDialog(g_pProgressDialog); + } + else + { + m_bSuccess = true; + } + g_pProgressDialog->exitEventLoop(); // Close the dialog, return from exec() +} + + +// Copy local or remote files. +bool FileAccessJobHandler::copyFile( const QString& dest ) +{ + ProgressProxy pp; + KURL destUrl = KURL::fromPathOrURL( dest ); + m_pFileAccess->m_statusText = QString(); + if ( ! m_pFileAccess->isLocal() || ! destUrl.isLocalFile() ) // if either url is nonlocal + { + bool bOverwrite = false; + bool bResume = false; + 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, 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, + i18n("Copying file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) ); + + return m_bSuccess; + // Note that the KIO-slave preserves the original date, if this is supported. + } + + // Both files are local: + QString srcName = m_pFileAccess->absFilePath(); + QString destName = dest; + QFile srcFile( srcName ); + QFile destFile( destName ); + 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( QIODevice::WriteOnly ); + if ( bWriteSuccess == false ) + { + m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for writing failed. Filename: %1").arg(destName); + return false; + } + +#if QT_VERSION==230 + typedef long Q_LONG; +#endif + std::vector buffer(100000); + qint64 bufSize = buffer.size(); + qint64 srcSize = srcFile.size(); + while ( srcSize > 0 && !pp.wasCancelled() ) + { + qint64 readSize = srcFile.read( &buffer[0], min2( srcSize, bufSize ) ); + if ( readSize==-1 || readSize==0 ) + { + m_pFileAccess->m_statusText = i18n("Error during file copy operation: Reading failed. Filename: %1").arg(srcName); + return false; + } + srcSize -= readSize; + while ( readSize > 0 ) + { + qint64 writeSize = destFile.write( &buffer[0], readSize ); + if ( writeSize==-1 || writeSize==0 ) + { + m_pFileAccess->m_statusText = i18n("Error during file copy operation: Writing failed. Filename: %1").arg(destName); + return false; + } + readSize -= writeSize; + } + destFile.flush(); + pp.setCurrent( (double)(srcFile.size()-srcSize)/srcFile.size(), false ); + } + srcFile.close(); + destFile.close(); + + // Update the times of the destFile +#ifdef _WIN32 + struct _stat srcFileStatus; + int statResult = ::_stat( srcName.toLocal8Bit().constData(), &srcFileStatus ); + if (statResult==0) + { + _utimbuf destTimes; + destTimes.actime = srcFileStatus.st_atime;/* time of last access */ + destTimes.modtime = srcFileStatus.st_mtime;/* time of last modification */ + + _utime ( destName.toLocal8Bit().constData(), &destTimes ); + _chmod ( destName.toLocal8Bit().constData(), srcFileStatus.st_mode ); + } +#else + struct stat srcFileStatus; + int statResult = ::stat( srcName.toLocal8Bit().constData(), &srcFileStatus ); + if (statResult==0) + { + utimbuf destTimes; + destTimes.actime = srcFileStatus.st_atime;/* time of last access */ + destTimes.modtime = srcFileStatus.st_mtime;/* time of last modification */ + + utime ( destName.toLocal8Bit().constData(), &destTimes ); + chmod ( destName.toLocal8Bit().constData(), srcFileStatus.st_mode ); + } +#endif + return true; +} + +bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive ) +{ + QStringList sl = wildcard.split( ";" ); + + for ( QStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) + { + QRegExp pattern( *it, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive, QRegExp::Wildcard ); + if ( pattern.exactMatch( testString ) ) + return true; + } + + return false; +} + + +// class CvsIgnoreList from Cervisia cvsdir.cpp +// Copyright (C) 1999-2002 Bernd Gehrmann +// with elements from class StringMatcher +// Copyright (c) 2003 Andr�Woebeking +// Modifications for KDiff3 by Joachim Eibl +class CvsIgnoreList +{ +public: + CvsIgnoreList(){} + void init(FileAccess& dir, bool bUseLocalCvsIgnore ); + bool matches(const QString& fileName, bool bCaseSensitive ) const; + +private: + void addEntriesFromString(const QString& str); + void addEntriesFromFile(const QString& name); + void addEntry(const QString& entry); + + QStringList m_exactPatterns; + QStringList m_startPatterns; + QStringList m_endPatterns; + QStringList m_generalPatterns; +}; + + +void CvsIgnoreList::init( FileAccess& dir, bool bUseLocalCvsIgnore ) +{ + static const char *ignorestr = ". .. core RCSLOG tags TAGS RCS SCCS .make.state " + ".nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj " + "*.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$"; + + addEntriesFromString(QString::fromLatin1(ignorestr)); + addEntriesFromFile(QDir::homePath() + "/.cvsignore"); + addEntriesFromString(QString::fromLocal8Bit(::getenv("CVSIGNORE"))); + + if (bUseLocalCvsIgnore) + { + FileAccess file(dir); + file.addPath( ".cvsignore" ); + int size = file.exists() ? file.sizeForReading() : 0; + if ( size>0 ) + { + char* buf=new char[size]; + if (buf!=0) + { + file.readFile( buf, size ); + int pos1 = 0; + for ( int pos = 0; pos<=size; ++pos ) + { + if( pos==size || buf[pos]==' ' || buf[pos]=='\t' || buf[pos]=='\n' || buf[pos]=='\r' ) + { + if (pos>pos1) + { + addEntry( QString::fromLatin1( &buf[pos1], pos-pos1 ) ); + } + ++pos1; + } + } + delete buf; + } + } + } +} + + +void CvsIgnoreList::addEntriesFromString(const QString& str) +{ + int posLast(0); + int pos; + while ((pos = str.indexOf(' ', posLast)) >= 0) + { + if (pos > posLast) + addEntry(str.mid(posLast, pos - posLast)); + posLast = pos + 1; + } + + if (posLast < static_cast(str.length())) + addEntry(str.mid(posLast)); +} + + +void CvsIgnoreList::addEntriesFromFile(const QString &name) +{ + QFile file(name); + + if( file.open(QIODevice::ReadOnly) ) + { + QTextStream stream(&file); + while( !stream.atEnd() ) + { + addEntriesFromString(stream.readLine()); + } + } +} + +void CvsIgnoreList::addEntry(const QString& pattern) +{ + if (pattern != QString("!")) + { + if (pattern.isEmpty()) return; + + // The general match is general but slow. + // Special tests for '*' and '?' at the beginning or end of a pattern + // allow fast checks. + + // Count number of '*' and '?' + unsigned int nofMetaCharacters = 0; + + const QChar* pos; + pos = pattern.unicode(); + const QChar* posEnd; + posEnd=pos + pattern.length(); + while (pos < posEnd) + { + if( *pos==QChar('*') || *pos==QChar('?') ) ++nofMetaCharacters; + ++pos; + } + + if ( nofMetaCharacters==0 ) + { + m_exactPatterns.append(pattern); + } + else if ( nofMetaCharacters==1 ) + { + if ( pattern.at(0) == QChar('*') ) + { + m_endPatterns.append( pattern.right( pattern.length() - 1) ); + } + else if (pattern.at(pattern.length() - 1) == QChar('*')) + { + m_startPatterns.append( pattern.left( pattern.length() - 1) ); + } + else + { + m_generalPatterns.append(pattern.toLocal8Bit()); + } + } + else + { + m_generalPatterns.append(pattern.toLocal8Bit()); + } + } + else + { + m_exactPatterns.clear(); + m_startPatterns.clear(); + m_endPatterns.clear(); + m_generalPatterns.clear(); + } +} + +bool CvsIgnoreList::matches(const QString& text, bool bCaseSensitive ) const +{ + if ( m_exactPatterns.indexOf(text) >=0 ) + { + return true; + } + + QStringList::ConstIterator it; + QStringList::ConstIterator itEnd; + for ( it=m_startPatterns.begin(), itEnd=m_startPatterns.end(); it != itEnd; ++it) + { + if (text.startsWith(*it)) + { + return true; + } + } + + for ( it = m_endPatterns.begin(), itEnd=m_endPatterns.end(); it != itEnd; ++it) + { + if (text.mid( text.length() - (*it).length() )==*it) //(text.endsWith(*it)) + { + return true; + } + } + + /* + for (QValueList::const_iterator it(m_generalPatterns.begin()), + itEnd(m_generalPatterns.end()); + it != itEnd; ++it) + { + if (::fnmatch(*it, text.local8Bit(), FNM_PATHNAME) == 0) + { + return true; + } + } + */ + + + for ( it = m_generalPatterns.begin(); it != m_generalPatterns.end(); ++it ) + { + QRegExp pattern( *it, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive, QRegExp::Wildcard ); +#if QT_VERSION==230 + int len=0; + if ( pattern.match( text, 0, &len )!=-1 && len==text.length()) + return true; +#else + if ( pattern.exactMatch( text ) ) + return true; +#endif + } + + return false; +} + +static QString nicePath( const QFileInfo& fi ) +{ + QString fp = fi.filePath(); + if ( fp.length()>2 && fp[0] == '.' && fp[1] == '/' ) + { + return fp.mid(2); + } + return fp; +} + +static bool cvsIgnoreExists( t_DirectoryList* pDirList ) +{ + t_DirectoryList::iterator i; + for( i = pDirList->begin(); i!=pDirList->end(); ++i ) + { + if ( i->fileName()==".cvsignore" ) + return true; + } + return false; +} + +bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, const QString& filePattern, + const QString& fileAntiPattern, const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ) +{ + ProgressProxy pp; + m_pDirList = pDirList; + m_pDirList->clear(); + m_bFindHidden = bFindHidden; + m_bRecursive = bRecursive; + m_bFollowDirLinks = bFollowDirLinks; // Only relevant if bRecursive==true. + m_fileAntiPattern = fileAntiPattern; + m_filePattern = filePattern; + m_dirAntiPattern = dirAntiPattern; + + if ( pp.wasCancelled() ) + return true; // Cancelled is not an error. + + pp.setInformation( i18n("Reading directory: ") + m_pFileAccess->absFilePath(), 0, false ); + + if( m_pFileAccess->isLocal() ) + { + QString currentPath = QDir::currentPath(); + m_bSuccess = QDir::setCurrent( m_pFileAccess->absFilePath() ); + if ( m_bSuccess ) + { +#ifndef _WIN32 + m_bSuccess = true; + QDir dir( "." ); + + dir.setSorting( QDir::Name | QDir::DirsFirst ); + dir.setFilter( QDir::Files | QDir::Dirs | QDir::AllDirs | QDir::Hidden ); + + QFileInfoList fiList = dir.entryInfoList(); + if ( fiList.isEmpty() ) + { + // No Permission to read directory or other error. + m_bSuccess = false; + } + else + { + foreach ( QFileInfo fi, fiList ) // for each file... + { + if ( fi.fileName() == "." || fi.fileName()==".." ) + continue; + + pDirList->push_back( FileAccess( nicePath(fi) ) ); + } + } +#else + QString pattern ="*.*"; + WIN32_FIND_DATA findData; + WIN32_FIND_DATAA& findDataA=*(WIN32_FIND_DATAA*)&findData; // Needed for Win95 + + Qt::HANDLE searchHandle = QT_WA_INLINE( + FindFirstFile( (TCHAR*)pattern.utf16(), &findData ), + FindFirstFileA( pattern.toLocal8Bit(), &findDataA ) + ); + + if ( searchHandle != INVALID_HANDLE_VALUE ) + { + QString absPath = m_pFileAccess->absFilePath(); + QString relPath = m_pFileAccess->filePath(); + bool bFirst=true; + while( ! pp.wasCancelled() ) + { + if (!bFirst) + { + if ( ! QT_WA_INLINE( + FindNextFile(searchHandle,&findData), + FindNextFileA(searchHandle,&findDataA)) ) + break; + } + bFirst = false; + FileAccess fa; + fa.m_size = findData.nFileSizeLow ;//+ findData.nFileSizeHigh; + + FILETIME ft; + SYSTEMTIME t; + FileTimeToLocalFileTime( &findData.ftLastWriteTime, &ft ); FileTimeToSystemTime(&ft,&t); + fa.m_modificationTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) ); + FileTimeToLocalFileTime( &findData.ftLastAccessTime, &ft ); FileTimeToSystemTime(&ft,&t); + fa.m_accessTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) ); + FileTimeToLocalFileTime( &findData.ftCreationTime, &ft ); FileTimeToSystemTime(&ft,&t); + 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_bDir = ( a & FILE_ATTRIBUTE_DIRECTORY ) != 0; + fa.m_bFile = !fa.m_bDir; + fa.m_bHidden = ( a & FILE_ATTRIBUTE_HIDDEN) != 0; + + fa.m_bExecutable = false; // Useless on windows + fa.m_bExists = true; + fa.m_bReadable = true; + fa.m_bLocal = true; + fa.m_bValidData = true; + fa.m_bSymLink = false; + fa.m_fileType = 0; + + fa.m_name = QT_WA_INLINE( + QString::fromUtf16((const ushort*)findData.cFileName), + QString::fromLocal8Bit(findDataA.cFileName) + ); + + fa.m_path = fa.m_name; + fa.m_absFilePath = absPath + "/" + fa.m_name; + fa.m_url.setPath( fa.m_absFilePath ); + if ( fa.m_name!="." && fa.m_name!=".." ) + pDirList->push_back( fa ); + } + FindClose( searchHandle ); + } + else + { + QDir::setCurrent( currentPath ); // restore current path + return false; + } +#endif + } + QDir::setCurrent( currentPath ); // restore current path + } + else + { + bool bShowProgress = false; + + KIO::ListJob* pListJob=0; + pListJob = KIO::listDir( m_pFileAccess->m_url, bShowProgress, true /*bFindHidden*/ ); + + m_bSuccess = false; + if ( pListJob!=0 ) + { + connect( pListJob, SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ), + this, SLOT( slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& )) ); + connect( pListJob, SIGNAL( result( KIO::Job* )), + this, SLOT( slotSimpleJobResult(KIO::Job*) ) ); + + connect( pListJob, SIGNAL( infoMessage(KIO::Job*, const QString&)), + this, SLOT( slotListDirInfoMessage(KIO::Job*, const QString&) )); + + // This line makes the transfer via fish unreliable.:-( + //connect( pListJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); + + g_pProgressDialog->enterEventLoop( pListJob, + i18n("Listing directory: %1").arg(m_pFileAccess->prettyAbsPath()) ); + } + } + + CvsIgnoreList cvsIgnoreList; + if ( bUseCvsIgnore ) + { + cvsIgnoreList.init( *m_pFileAccess, cvsIgnoreExists(pDirList) ); + } +#ifdef _WIN32 + bool bCaseSensitive = false; +#else + bool bCaseSensitive = true; +#endif + + // Now remove all entries that don't match: + t_DirectoryList::iterator i; + for( i = pDirList->begin(); i!=pDirList->end(); ) + { + t_DirectoryList::iterator i2=i; + ++i2; + QString fn = i->fileName(); + if ( (!bFindHidden && i->isHidden() ) + || + (i->isFile() && + ( !wildcardMultiMatch( filePattern, i->fileName(), bCaseSensitive ) || + wildcardMultiMatch( fileAntiPattern, i->fileName(), bCaseSensitive ) ) ) + || + (i->isDir() && wildcardMultiMatch( dirAntiPattern, i->fileName(), bCaseSensitive ) ) + || + cvsIgnoreList.matches( i->fileName(), bCaseSensitive ) + ) + { + // Remove it + pDirList->erase( i ); + i = i2; + } + else + { + ++i; + } + } + + if ( bRecursive ) + { + t_DirectoryList subDirsList; + + t_DirectoryList::iterator i; + for( i = m_pDirList->begin(); i!=m_pDirList->end(); ++i ) + { + if ( i->isDir() && (!i->isSymLink() || m_bFollowDirLinks)) + { + t_DirectoryList dirList; + i->listDir( &dirList, bRecursive, bFindHidden, + filePattern, fileAntiPattern, dirAntiPattern, bFollowDirLinks, bUseCvsIgnore ); + + t_DirectoryList::iterator j; + for( j = dirList.begin(); j!=dirList.end(); ++j ) + { + j->m_path = i->fileName() + "/" + j->m_path; + } + + // append data onto the main list + subDirsList.splice( subDirsList.end(), dirList ); + } + } + + m_pDirList->splice( m_pDirList->end(), subDirsList ); + } + + return m_bSuccess; +} + + +void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l ) +{ + KURL parentUrl( m_pFileAccess->m_absFilePath ); + + KIO::UDSEntryList::ConstIterator i; + for ( i=l.begin(); i!=l.end(); ++i ) + { + const KIO::UDSEntry& e = *i; + FileAccess fa; + fa.setUdsEntry( e ); + + if ( fa.filePath() != "." && fa.filePath() != ".." ) + { + fa.m_url = parentUrl; + fa.m_url.addPath( fa.filePath() ); + fa.m_absFilePath = fa.m_url.url(); + m_pDirList->push_back( fa ); + } + } +} + +void FileAccessJobHandler::slotListDirInfoMessage( KIO::Job*, const QString& msg ) +{ + g_pProgressDialog->setInformation( msg, 0.0 ); +} + +void FileAccessJobHandler::slotPercent( KIO::Job*, unsigned long percent ) +{ + g_pProgressDialog->setCurrent( percent/100.0 ); +} + + +ProgressDialog::ProgressDialog( QWidget* pParent ) +: QDialog( pParent ) +{ + setObjectName("ProgressDialog"); + setModal(true); + QVBoxLayout* layout = new QVBoxLayout(this); + + m_pInformation = new QLabel( " ", this ); + layout->addWidget( m_pInformation ); + + m_pProgressBar = new KProgress(); + m_pProgressBar->setRange(0,1000); + layout->addWidget( m_pProgressBar ); + + m_pSubInformation = new QLabel( " ", this); + layout->addWidget( m_pSubInformation ); + + m_pSubProgressBar = new KProgress(); + m_pSubProgressBar->setRange(0,1000); + layout->addWidget( m_pSubProgressBar ); + + m_pSlowJobInfo = new QLabel( " ", this); + layout->addWidget( m_pSlowJobInfo ); + + QHBoxLayout* hlayout = new QHBoxLayout(); + layout->addLayout(hlayout); + hlayout->addStretch(1); + m_pAbortButton = new QPushButton( i18n("&Cancel"), this); + hlayout->addWidget( m_pAbortButton ); + connect( m_pAbortButton, SIGNAL(clicked()), this, SLOT(slotAbort()) ); + + m_progressDelayTimer = 0; + resize( 400, 100 ); + m_t1.start(); + m_t2.start(); + m_bWasCancelled = false; + m_pJob = 0; +} + +void ProgressDialog::push() +{ + ProgressLevelData pld; + if ( !m_progressStack.empty() ) + { + pld.m_dRangeMax = m_progressStack.back().m_dSubRangeMax; + pld.m_dRangeMin = m_progressStack.back().m_dSubRangeMin; + } + else + { + m_bWasCancelled = false; + m_t1.restart(); + m_t2.restart(); + show(); + } + + m_progressStack.push_back( pld ); +} + +void ProgressDialog::pop( bool bRedrawUpdate ) +{ + if ( !m_progressStack.empty() ) + { + m_progressStack.pop_back(); + if ( m_progressStack.empty() ) + hide(); + else + recalc(bRedrawUpdate); + } +} + +void ProgressDialog::setInformation(const QString& info, double dCurrent, bool bRedrawUpdate ) +{ + if ( m_progressStack.empty() ) + return; + ProgressLevelData& pld = m_progressStack.back(); + pld.m_dCurrent = dCurrent; + int level = m_progressStack.size(); + if ( level==1 ) + { + m_pInformation->setText( info ); + m_pSubInformation->setText(""); + } + else if ( level==2 ) + { + m_pSubInformation->setText( info ); + } + recalc(bRedrawUpdate); +} + +void ProgressDialog::setInformation(const QString& info, bool bRedrawUpdate ) +{ + if ( m_progressStack.empty() ) + return; + //ProgressLevelData& pld = m_progressStack.back(); + int level = m_progressStack.size(); + if ( level==1 ) + { + m_pInformation->setText( info ); + m_pSubInformation->setText( "" ); + } + else if ( level==2 ) + { + m_pSubInformation->setText( info ); + } + recalc(bRedrawUpdate); +} + +void ProgressDialog::setMaxNofSteps( int maxNofSteps ) +{ + if ( m_progressStack.empty() ) + return; + ProgressLevelData& pld = m_progressStack.back(); + pld.m_maxNofSteps = maxNofSteps; + pld.m_dCurrent = 0; +} + +void ProgressDialog::step( bool bRedrawUpdate ) +{ + if ( m_progressStack.empty() ) + return; + ProgressLevelData& pld = m_progressStack.back(); + pld.m_dCurrent += 1.0/pld.m_maxNofSteps; + recalc(bRedrawUpdate); +} + +void ProgressDialog::setCurrent( double dSubCurrent, bool bRedrawUpdate ) +{ + if ( m_progressStack.empty() ) + return; + ProgressLevelData& pld = m_progressStack.back(); + pld.m_dCurrent = dSubCurrent; + recalc( bRedrawUpdate ); +} + +// The progressbar goes from 0 to 1 usually. +// By supplying a subrange transformation the subCurrent-values +// 0 to 1 will be transformed to dMin to dMax instead. +// Requirement: 0 < dMin < dMax < 1 +void ProgressDialog::setRangeTransformation( double dMin, double dMax ) +{ + if ( m_progressStack.empty() ) + return; + ProgressLevelData& pld = m_progressStack.back(); + pld.m_dRangeMin = dMin; + pld.m_dRangeMax = dMax; + pld.m_dCurrent = 0; +} + +void ProgressDialog::setSubRangeTransformation( double dMin, double dMax ) +{ + if ( m_progressStack.empty() ) + return; + ProgressLevelData& pld = m_progressStack.back(); + pld.m_dSubRangeMin = dMin; + pld.m_dSubRangeMax = dMax; +} + +void qt_enter_modal(QWidget*); +void qt_leave_modal(QWidget*); + +void ProgressDialog::enterEventLoop( KIO::Job* pJob, const QString& jobInfo ) +{ + m_pJob = pJob; + m_pSlowJobInfo->setText(""); + m_currentJobInfo = jobInfo; + if ( m_progressDelayTimer ) + killTimer( m_progressDelayTimer ); + m_progressDelayTimer = startTimer( 3000 ); /* 3 s delay */ + + // instead of using exec() the eventloop is entered and exited often without hiding/showing the window. + //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() +{ + if ( m_progressDelayTimer ) + killTimer( m_progressDelayTimer ); + m_progressDelayTimer = 0; + m_pJob = 0; + if (!m_eventLoopStack.empty()) + m_eventLoopStack.back()->exit(); +} + +void ProgressDialog::recalc( bool bUpdate ) +{ + if ( m_progressDelayTimer ) + killTimer( m_progressDelayTimer ); + m_progressDelayTimer = startTimer( 3000 ); /* 3 s delay */ + + int level = m_progressStack.size(); + if( ( bUpdate && level==1) || m_t1.elapsed()>200 ) + { + if (m_progressStack.empty() ) + { + m_pProgressBar->setValue( 0 ); + m_pSubProgressBar->setValue( 0 ); + } + else + { + std::list::iterator i = m_progressStack.begin(); + m_pProgressBar->setValue( int( 1000.0 * ( i->m_dCurrent * (i->m_dRangeMax - i->m_dRangeMin) + i->m_dRangeMin ) ) ); + ++i; + if ( i!=m_progressStack.end() ) + m_pSubProgressBar->setValue( int( 1000.0 * ( i->m_dCurrent * (i->m_dRangeMax - i->m_dRangeMin) + i->m_dRangeMin ) ) ); + else + m_pSubProgressBar->setValue( int( 1000.0 * m_progressStack.front().m_dSubRangeMin ) ); + } + + if ( !isVisible() ) show(); + qApp->processEvents(); + m_t1.restart(); + } +} + + +#include +void ProgressDialog::show() +{ + if ( m_progressDelayTimer ) + killTimer( m_progressDelayTimer ); + m_progressDelayTimer = 0; + if ( !isVisible() && (parentWidget()==0 || parentWidget()->isVisible()) ) + { + QDialog::show(); + } +} + +void ProgressDialog::hide() +{ + if ( m_progressDelayTimer ) + killTimer( m_progressDelayTimer ); + m_progressDelayTimer = 0; + // Calling QDialog::hide() directly doesn't always work. (?) + QTimer::singleShot( 100, this, SLOT(delayedHide()) ); +} + +void ProgressDialog::delayedHide() +{ + if (m_pJob!=0) + { + m_pJob->kill(false); + m_pJob = 0; + } + QDialog::hide(); + m_pInformation->setText( "" ); + + //m_progressStack.clear(); + + m_pProgressBar->setValue( 0 ); + m_pSubProgressBar->setValue( 0 ); + m_pSubInformation->setText(""); + m_pSlowJobInfo->setText(""); +} + +void ProgressDialog::reject() +{ + m_bWasCancelled = true; + QDialog::reject(); +} + +void ProgressDialog::slotAbort() +{ + reject(); +} + +bool ProgressDialog::wasCancelled() +{ + if( m_t2.elapsed()>100 ) + { + qApp->processEvents(); + m_t2.restart(); + } + return m_bWasCancelled; +} + + +void ProgressDialog::timerEvent(QTimerEvent*) +{ + if( !isVisible() ) + { + show(); + } + m_pSlowJobInfo->setText( m_currentJobInfo ); +} + + +ProgressProxy::ProgressProxy() +{ + g_pProgressDialog->push(); +} + +ProgressProxy::~ProgressProxy() +{ + g_pProgressDialog->pop(false); +} + +void ProgressProxy::setInformation( const QString& info, bool bRedrawUpdate ) +{ + g_pProgressDialog->setInformation( info, bRedrawUpdate ); +} + +void ProgressProxy::setInformation( const QString& info, double dCurrent, bool bRedrawUpdate ) +{ + g_pProgressDialog->setInformation( info, dCurrent, bRedrawUpdate ); +} + +void ProgressProxy::setCurrent( double dCurrent, bool bRedrawUpdate ) +{ + g_pProgressDialog->setCurrent( dCurrent, bRedrawUpdate ); +} + +void ProgressProxy::step( bool bRedrawUpdate ) +{ + g_pProgressDialog->step( bRedrawUpdate ); +} + +void ProgressProxy::setMaxNofSteps( int maxNofSteps ) +{ + g_pProgressDialog->setMaxNofSteps( maxNofSteps ); +} + +bool ProgressProxy::wasCancelled() +{ + return g_pProgressDialog->wasCancelled(); +} + +void ProgressProxy::setRangeTransformation( double dMin, double dMax ) +{ + g_pProgressDialog->setRangeTransformation( dMin, dMax ); +} + +void ProgressProxy::setSubRangeTransformation( double dMin, double dMax ) +{ + g_pProgressDialog->setSubRangeTransformation( dMin, dMax ); +} + + + + + +//#include "fileaccess.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/fileaccess.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/fileaccess.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,264 @@ +/*************************************************************************** + * Copyright (C) 2003-2006 by Joachim Eibl * + * joachim.eibl at gmx.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#ifndef FILEACCESS_H +#define FILEACCESS_H + +#include +#include + +#include +#include +#include +#include + +#include + +bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive ); + +class t_DirectoryList; + +class FileAccess +{ +public: + FileAccess(); + ~FileAccess(); + FileAccess( const QString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported) + void setFile( const QString& name, bool bWantToWrite=false ); + + bool isValid() const; + bool isFile() const; + bool isDir() const; + bool isSymLink() const; + bool exists() const; + long size() const; // Size as returned by stat(). + long sizeForReading(); // If the size can't be determined by stat() then the file is copied to a local temp file. + bool isReadable() const; + bool isWritable() const; + bool isExecutable() const; + bool isHidden() const; + QString readLink() const; + + QDateTime created() const; + QDateTime lastModified() const; + QDateTime lastRead() const; + + QString fileName() const; // Just the name-part of the path, without parent directories + QString filePath() const; // The path-string that was used during construction + QString prettyAbsPath() const; + KURL url() const; + QString absFilePath() const; + + bool isLocal() const; + + bool readFile(void* pDestBuffer, unsigned long maxLength ); + bool writeFile(const void* pSrcBuffer, unsigned long length ); + bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, + const QString& filePattern, const QString& fileAntiPattern, + const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); + bool copyFile( const QString& destUrl ); + 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& ); + static bool removeDir( const QString& ); + static bool exists( const QString& ); + static QString cleanDirPath( const QString& ); + + //bool chmod( const QString& ); + bool rename( const QString& ); + static bool symLink( const QString& linkTarget, const QString& linkLocation ); + + void addPath( const QString& txt ); + QString getStatusText(); +private: + void setUdsEntry( const KIO::UDSEntry& e ); + KURL m_url; + bool m_bLocal; + bool m_bValidData; + + unsigned long m_size; + QDateTime m_modificationTime; + QDateTime m_accessTime; + QDateTime m_creationTime; + bool m_bReadable; + bool m_bWritable; + bool m_bExecutable; + bool m_bExists; + bool m_bFile; + bool m_bDir; + bool m_bSymLink; + bool m_bHidden; + long m_fileType; // for testing only + + QString m_linkTarget; + QString m_user; + QString m_group; + QString m_name; + QString m_path; + QString m_absFilePath; + QString m_localCopy; + QString m_statusText; // Might contain an error string, when the last operation didn't succeed. + + friend class FileAccessJobHandler; +}; + +class t_DirectoryList : public std::list +{}; + + +class FileAccessJobHandler : public QObject +{ + Q_OBJECT +public: + FileAccessJobHandler( FileAccess* pFileAccess ); + + bool get( void* pDestBuffer, long maxLength ); + bool put( const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume=false, int permissions=-1 ); + bool stat(int detailLevel=2, bool bWantToWrite=false ); + bool copyFile( const QString& dest ); + bool rename( const QString& dest ); + bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, + const QString& filePattern, const QString& fileAntiPattern, + const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); + bool mkDir( const QString& dirName ); + bool rmDir( const QString& dirName ); + bool removeFile( const QString& dirName ); + bool symLink( const QString& linkTarget, const QString& linkLocation ); + +private: + FileAccess* m_pFileAccess; + bool m_bSuccess; + + // Data needed during Job + long m_transferredBytes; + char* m_pTransferBuffer; // Needed during get or put + long m_maxLength; + + QString m_filePattern; + QString m_fileAntiPattern; + QString m_dirAntiPattern; + t_DirectoryList* m_pDirList; + bool m_bFindHidden; + bool m_bRecursive; + bool m_bFollowDirLinks; + + bool scanLocalDirectory( const QString& dirName, t_DirectoryList* dirList ); + +private slots: + void slotStatResult( KIO::Job* ); + void slotSimpleJobResult( KIO::Job* pJob ); + void slotPutJobResult( KIO::Job* pJob ); + + void slotGetData(KIO::Job*,const QByteArray&); + void slotPutData(KIO::Job*, QByteArray&); + + void slotListDirInfoMessage( KIO::Job*, const QString& msg ); + void slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l ); + + void slotPercent( KIO::Job* pJob, unsigned long percent ); +}; + +class ProgressDialog : public QDialog +{ + Q_OBJECT +public: + ProgressDialog( QWidget* pParent ); + + void setInformation( const QString& info, bool bRedrawUpdate=true ); + void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); + void setCurrent( double dCurrent, bool bRedrawUpdate=true ); + void step( bool bRedrawUpdate=true ); + void setMaxNofSteps( int dMaxNofSteps ); + void push(); + void pop(bool bRedrawUpdate=true); + + // The progressbar goes from 0 to 1 usually. + // By supplying a subrange transformation the subCurrent-values + // 0 to 1 will be transformed to dMin to dMax instead. + // Requirement: 0 < dMin < dMax < 1 + void setRangeTransformation( double dMin, double dMax ); + void setSubRangeTransformation( double dMin, double dMax ); + + void exitEventLoop(); + void enterEventLoop( KIO::Job* pJob, const QString& jobInfo ); + + bool wasCancelled(); + void show(); + void hide(); + + virtual void timerEvent(QTimerEvent*); +private: + + struct ProgressLevelData + { + ProgressLevelData() + { + m_dCurrent=0; m_maxNofSteps=1; m_dRangeMin=0; m_dRangeMax=1; + m_dSubRangeMin = 0; m_dSubRangeMax = 1; + } + double m_dCurrent; + int m_maxNofSteps; // when step() is used. + double m_dRangeMax; + double m_dRangeMin; + double m_dSubRangeMax; + double m_dSubRangeMin; + }; + std::list m_progressStack; + + int m_progressDelayTimer; + std::list m_eventLoopStack; + + KProgress* m_pProgressBar; + KProgress* m_pSubProgressBar; + QLabel* m_pInformation; + QLabel* m_pSubInformation; + QLabel* m_pSlowJobInfo; + QPushButton* m_pAbortButton; + void recalc(bool bRedrawUpdate); + QTime m_t1; + QTime m_t2; + bool m_bWasCancelled; + KIO::Job* m_pJob; + QString m_currentJobInfo; // Needed if the job doesn't stop after a reasonable time. +protected: + virtual void reject(); +private slots: + void delayedHide(); + void slotAbort(); +}; + +// When using the ProgressProxy you need not take care of the push and pop, except when explicit. +class ProgressProxy +{ +public: + ProgressProxy(); + ~ProgressProxy(); + + void setInformation( const QString& info, bool bRedrawUpdate=true ); + void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); + void setCurrent( double dCurrent, bool bRedrawUpdate=true ); + void step( bool bRedrawUpdate=true ); + void setMaxNofSteps( int dMaxNofSteps ); + bool wasCancelled(); + void setRangeTransformation( double dMin, double dMax ); + void setSubRangeTransformation( double dMin, double dMax ); +private: +}; + +extern ProgressDialog* g_pProgressDialog; + + + +#endif + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/gnudiff_analyze.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/gnudiff_analyze.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,873 @@ +/* Analyze file differences for GNU DIFF. + + Modified for KDiff3 by Joachim Eibl 2003. + The original file was part of GNU DIFF. + + Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1998, 2001, 2002 + Free Software Foundation, Inc. + + GNU DIFF is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU DIFF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + If not, write to the Free Software Foundation, + 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* The basic algorithm is described in: + "An O(ND) Difference Algorithm and its Variations", Eugene Myers, + Algorithmica Vol. 1 No. 2, 1986, pp. 251-266; + see especially section 4.2, which describes the variation used below. + Unless the --minimal option is specified, this code uses the TOO_EXPENSIVE + heuristic, by Paul Eggert, to limit the cost to O(N**1.5 log N) + at the price of producing suboptimal output for large inputs with + many differences. + + The basic algorithm was independently discovered as described in: + "Algorithms for Approximate String Matching", E. Ukkonen, + Information and Control Vol. 64, 1985, pp. 100-118. */ + +#define GDIFF_MAIN + +#include "gnudiff_diff.h" +//#include +#include + +static lin *xvec, *yvec; /* Vectors being compared. */ +static lin *fdiag; /* Vector, indexed by diagonal, containing + 1 + the X coordinate of the point furthest + along the given diagonal in the forward + search of the edit matrix. */ +static lin *bdiag; /* Vector, indexed by diagonal, containing + the X coordinate of the point furthest + along the given diagonal in the backward + search of the edit matrix. */ +static lin too_expensive; /* Edit scripts longer than this are too + expensive to compute. */ + +#define SNAKE_LIMIT 20 /* Snakes bigger than this are considered `big'. */ + + +struct partition +{ + lin xmid, ymid; /* Midpoints of this partition. */ + bool lo_minimal; /* Nonzero if low half will be analyzed minimally. */ + bool hi_minimal; /* Likewise for high half. */ +}; + +/* Find the midpoint of the shortest edit script for a specified + portion of the two files. + + Scan from the beginnings of the files, and simultaneously from the ends, + doing a breadth-first search through the space of edit-sequence. + When the two searches meet, we have found the midpoint of the shortest + edit sequence. + + If FIND_MINIMAL is nonzero, find the minimal edit script regardless + of expense. Otherwise, if the search is too expensive, use + heuristics to stop the search and report a suboptimal answer. + + Set PART->(xmid,ymid) to the midpoint (XMID,YMID). The diagonal number + XMID - YMID equals the number of inserted lines minus the number + of deleted lines (counting only lines before the midpoint). + Return the approximate edit cost; this is the total number of + lines inserted or deleted (counting only lines before the midpoint), + unless a heuristic is used to terminate the search prematurely. + + Set PART->lo_minimal to true iff the minimal edit script for the + left half of the partition is known; similarly for PART->hi_minimal. + + This function assumes that the first lines of the specified portions + of the two files do not match, and likewise that the last lines do not + match. The caller must trim matching lines from the beginning and end + of the portions it is going to specify. + + If we return the "wrong" partitions, + the worst this can do is cause suboptimal diff output. + It cannot cause incorrect diff output. */ + +lin +GnuDiff::diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal, + struct partition *part) +{ + lin *const fd = fdiag; /* Give the compiler a chance. */ + lin *const bd = bdiag; /* Additional help for the compiler. */ + lin const *const xv = xvec; /* Still more help for the compiler. */ + lin const *const yv = yvec; /* And more and more . . . */ + lin const dmin = xoff - ylim; /* Minimum valid diagonal. */ + lin const dmax = xlim - yoff; /* Maximum valid diagonal. */ + lin const fmid = xoff - yoff; /* Center diagonal of top-down search. */ + lin const bmid = xlim - ylim; /* Center diagonal of bottom-up search. */ + lin fmin = fmid, fmax = fmid; /* Limits of top-down search. */ + lin bmin = bmid, bmax = bmid; /* Limits of bottom-up search. */ + lin c; /* Cost. */ + bool odd = (fmid - bmid) & 1; /* True if southeast corner is on an odd + diagonal with respect to the northwest. */ + + fd[fmid] = xoff; + bd[bmid] = xlim; + + for (c = 1;; ++c) + { + lin d; /* Active diagonal. */ + bool big_snake = 0; + + /* Extend the top-down search by an edit step in each diagonal. */ + fmin > dmin ? fd[--fmin - 1] = -1 : ++fmin; + fmax < dmax ? fd[++fmax + 1] = -1 : --fmax; + for (d = fmax; d >= fmin; d -= 2) + { + lin x, y, oldx, tlo = fd[d - 1], thi = fd[d + 1]; + + if (tlo >= thi) + x = tlo + 1; + else + x = thi; + oldx = x; + y = x - d; + while (x < xlim && y < ylim && xv[x] == yv[y]) + ++x, ++y; + if (x - oldx > SNAKE_LIMIT) + big_snake = 1; + fd[d] = x; + if (odd && bmin <= d && d <= bmax && bd[d] <= x) + { + part->xmid = x; + part->ymid = y; + part->lo_minimal = part->hi_minimal = 1; + return 2 * c - 1; + } + } + + /* Similarly extend the bottom-up search. */ + bmin > dmin ? bd[--bmin - 1] = LIN_MAX : ++bmin; + bmax < dmax ? bd[++bmax + 1] = LIN_MAX : --bmax; + for (d = bmax; d >= bmin; d -= 2) + { + lin x, y, oldx, tlo = bd[d - 1], thi = bd[d + 1]; + + if (tlo < thi) + x = tlo; + else + x = thi - 1; + oldx = x; + y = x - d; + while (x > xoff && y > yoff && xv[x - 1] == yv[y - 1]) + --x, --y; + if (oldx - x > SNAKE_LIMIT) + big_snake = 1; + bd[d] = x; + if (!odd && fmin <= d && d <= fmax && x <= fd[d]) + { + part->xmid = x; + part->ymid = y; + part->lo_minimal = part->hi_minimal = 1; + return 2 * c; + } + } + + if (find_minimal) + continue; + + /* Heuristic: check occasionally for a diagonal that has made + lots of progress compared with the edit distance. + If we have any such, find the one that has made the most + progress and return it as if it had succeeded. + + With this heuristic, for files with a constant small density + of changes, the algorithm is linear in the file size. */ + + if (200 < c && big_snake && speed_large_files) + { + lin best; + + best = 0; + for (d = fmax; d >= fmin; d -= 2) + { + lin dd = d - fmid; + lin x = fd[d]; + lin y = x - d; + lin v = (x - xoff) * 2 - dd; + if (v > 12 * (c + (dd < 0 ? -dd : dd))) + { + if (v > best + && xoff + SNAKE_LIMIT <= x && x < xlim + && yoff + SNAKE_LIMIT <= y && y < ylim) + { + /* We have a good enough best diagonal; + now insist that it end with a significant snake. */ + int k; + + for (k = 1; xv[x - k] == yv[y - k]; k++) + if (k == SNAKE_LIMIT) + { + best = v; + part->xmid = x; + part->ymid = y; + break; + } + } + } + } + if (best > 0) + { + part->lo_minimal = 1; + part->hi_minimal = 0; + return 2 * c - 1; + } + + best = 0; + for (d = bmax; d >= bmin; d -= 2) + { + lin dd = d - bmid; + lin x = bd[d]; + lin y = x - d; + lin v = (xlim - x) * 2 + dd; + if (v > 12 * (c + (dd < 0 ? -dd : dd))) + { + if (v > best + && xoff < x && x <= xlim - SNAKE_LIMIT + && yoff < y && y <= ylim - SNAKE_LIMIT) + { + /* We have a good enough best diagonal; + now insist that it end with a significant snake. */ + int k; + + for (k = 0; xv[x + k] == yv[y + k]; k++) + if (k == SNAKE_LIMIT - 1) + { + best = v; + part->xmid = x; + part->ymid = y; + break; + } + } + } + } + if (best > 0) + { + part->lo_minimal = 0; + part->hi_minimal = 1; + return 2 * c - 1; + } + } + + /* Heuristic: if we've gone well beyond the call of duty, + give up and report halfway between our best results so far. */ + if (c >= too_expensive) + { + lin fxybest, fxbest; + lin bxybest, bxbest; + + fxbest = bxbest = 0; /* Pacify `gcc -Wall'. */ + + /* Find forward diagonal that maximizes X + Y. */ + fxybest = -1; + for (d = fmax; d >= fmin; d -= 2) + { + lin x = MIN (fd[d], xlim); + lin y = x - d; + if (ylim < y) + x = ylim + d, y = ylim; + if (fxybest < x + y) + { + fxybest = x + y; + fxbest = x; + } + } + + /* Find backward diagonal that minimizes X + Y. */ + bxybest = LIN_MAX; + for (d = bmax; d >= bmin; d -= 2) + { + lin x = MAX (xoff, bd[d]); + lin y = x - d; + if (y < yoff) + x = yoff + d, y = yoff; + if (x + y < bxybest) + { + bxybest = x + y; + bxbest = x; + } + } + + /* Use the better of the two diagonals. */ + if ((xlim + ylim) - bxybest < fxybest - (xoff + yoff)) + { + part->xmid = fxbest; + part->ymid = fxybest - fxbest; + part->lo_minimal = 1; + part->hi_minimal = 0; + } + else + { + part->xmid = bxbest; + part->ymid = bxybest - bxbest; + part->lo_minimal = 0; + part->hi_minimal = 1; + } + return 2 * c - 1; + } + } +} + +/* Compare in detail contiguous subsequences of the two files + which are known, as a whole, to match each other. + + The results are recorded in the vectors files[N].changed, by + storing 1 in the element for each line that is an insertion or deletion. + + The subsequence of file 0 is [XOFF, XLIM) and likewise for file 1. + + Note that XLIM, YLIM are exclusive bounds. + All line numbers are origin-0 and discarded lines are not counted. + + If FIND_MINIMAL, find a minimal difference no matter how + expensive it is. */ + +void GnuDiff::compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal) +{ + lin * const xv = xvec; /* Help the compiler. */ + lin * const yv = yvec; + + /* Slide down the bottom initial diagonal. */ + while (xoff < xlim && yoff < ylim && xv[xoff] == yv[yoff]) + ++xoff, ++yoff; + /* Slide up the top initial diagonal. */ + while (xlim > xoff && ylim > yoff && xv[xlim - 1] == yv[ylim - 1]) + --xlim, --ylim; + + /* Handle simple cases. */ + if (xoff == xlim) + while (yoff < ylim) + files[1].changed[files[1].realindexes[yoff++]] = 1; + else if (yoff == ylim) + while (xoff < xlim) + files[0].changed[files[0].realindexes[xoff++]] = 1; + else + { + lin c; + struct partition part; + + /* Find a point of correspondence in the middle of the files. */ + + c = diag (xoff, xlim, yoff, ylim, find_minimal, &part); + + if (c == 1) + { + /* This should be impossible, because it implies that + one of the two subsequences is empty, + and that case was handled above without calling `diag'. + Let's verify that this is true. */ + abort (); +#if 0 + /* The two subsequences differ by a single insert or delete; + record it and we are done. */ + if (part.xmid - part.ymid < xoff - yoff) + files[1].changed[files[1].realindexes[part.ymid - 1]] = 1; + else + files[0].changed[files[0].realindexes[part.xmid]] = 1; +#endif + } + else + { + /* Use the partitions to split this problem into subproblems. */ + compareseq (xoff, part.xmid, yoff, part.ymid, part.lo_minimal); + compareseq (part.xmid, xlim, part.ymid, ylim, part.hi_minimal); + } + } +} + +/* Discard lines from one file that have no matches in the other file. + + A line which is discarded will not be considered by the actual + comparison algorithm; it will be as if that line were not in the file. + The file's `realindexes' table maps virtual line numbers + (which don't count the discarded lines) into real line numbers; + this is how the actual comparison algorithm produces results + that are comprehensible when the discarded lines are counted. + + When we discard a line, we also mark it as a deletion or insertion + so that it will be printed in the output. */ + +void GnuDiff::discard_confusing_lines (struct file_data filevec[]) +{ + int f; + lin i; + char *discarded[2]; + lin *equiv_count[2]; + lin *p; + + /* Allocate our results. */ + p = (lin*)xmalloc ((filevec[0].buffered_lines + filevec[1].buffered_lines) + * (2 * sizeof *p)); + for (f = 0; f < 2; f++) + { + filevec[f].undiscarded = p; p += filevec[f].buffered_lines; + filevec[f].realindexes = p; p += filevec[f].buffered_lines; + } + + /* Set up equiv_count[F][I] as the number of lines in file F + that fall in equivalence class I. */ + + p = (lin*)zalloc (filevec[0].equiv_max * (2 * sizeof *p)); + equiv_count[0] = p; + equiv_count[1] = p + filevec[0].equiv_max; + + for (i = 0; i < filevec[0].buffered_lines; ++i) + ++equiv_count[0][filevec[0].equivs[i]]; + for (i = 0; i < filevec[1].buffered_lines; ++i) + ++equiv_count[1][filevec[1].equivs[i]]; + + /* Set up tables of which lines are going to be discarded. */ + + discarded[0] = (char*)zalloc (filevec[0].buffered_lines + + filevec[1].buffered_lines); + discarded[1] = discarded[0] + filevec[0].buffered_lines; + + /* Mark to be discarded each line that matches no line of the other file. + If a line matches many lines, mark it as provisionally discardable. */ + + for (f = 0; f < 2; f++) + { + size_t end = filevec[f].buffered_lines; + char *discards = discarded[f]; + lin *counts = equiv_count[1 - f]; + lin *equivs = filevec[f].equivs; + size_t many = 5; + size_t tem = end / 64; + + /* Multiply MANY by approximate square root of number of lines. + That is the threshold for provisionally discardable lines. */ + while ((tem = tem >> 2) > 0) + many *= 2; + + for (i = 0; i < (lin)end; i++) + { + lin nmatch; + if (equivs[i] == 0) + continue; + nmatch = counts[equivs[i]]; + if (nmatch == 0) + discards[i] = 1; + else if (nmatch > (lin)many) + discards[i] = 2; + } + } + + /* Don't really discard the provisional lines except when they occur + in a run of discardables, with nonprovisionals at the beginning + and end. */ + + for (f = 0; f < 2; f++) + { + lin end = filevec[f].buffered_lines; + register char *discards = discarded[f]; + + for (i = 0; i < end; i++) + { + /* Cancel provisional discards not in middle of run of discards. */ + if (discards[i] == 2) + discards[i] = 0; + else if (discards[i] != 0) + { + /* We have found a nonprovisional discard. */ + register lin j; + lin length; + lin provisional = 0; + + /* Find end of this run of discardable lines. + Count how many are provisionally discardable. */ + for (j = i; j < end; j++) + { + if (discards[j] == 0) + break; + if (discards[j] == 2) + ++provisional; + } + + /* Cancel provisional discards at end, and shrink the run. */ + while (j > i && discards[j - 1] == 2) + discards[--j] = 0, --provisional; + + /* Now we have the length of a run of discardable lines + whose first and last are not provisional. */ + length = j - i; + + /* If 1/4 of the lines in the run are provisional, + cancel discarding of all provisional lines in the run. */ + if (provisional * 4 > length) + { + while (j > i) + if (discards[--j] == 2) + discards[j] = 0; + } + else + { + register lin consec; + lin minimum = 1; + lin tem = length >> 2; + + /* MINIMUM is approximate square root of LENGTH/4. + A subrun of two or more provisionals can stand + when LENGTH is at least 16. + A subrun of 4 or more can stand when LENGTH >= 64. */ + while (0 < (tem >>= 2)) + minimum <<= 1; + minimum++; + + /* Cancel any subrun of MINIMUM or more provisionals + within the larger run. */ + for (j = 0, consec = 0; j < length; j++) + if (discards[i + j] != 2) + consec = 0; + else if (minimum == ++consec) + /* Back up to start of subrun, to cancel it all. */ + j -= consec; + else if (minimum < consec) + discards[i + j] = 0; + + /* Scan from beginning of run + until we find 3 or more nonprovisionals in a row + or until the first nonprovisional at least 8 lines in. + Until that point, cancel any provisionals. */ + for (j = 0, consec = 0; j < length; j++) + { + if (j >= 8 && discards[i + j] == 1) + break; + if (discards[i + j] == 2) + consec = 0, discards[i + j] = 0; + else if (discards[i + j] == 0) + consec = 0; + else + consec++; + if (consec == 3) + break; + } + + /* I advances to the last line of the run. */ + i += length - 1; + + /* Same thing, from end. */ + for (j = 0, consec = 0; j < length; j++) + { + if (j >= 8 && discards[i - j] == 1) + break; + if (discards[i - j] == 2) + consec = 0, discards[i - j] = 0; + else if (discards[i - j] == 0) + consec = 0; + else + consec++; + if (consec == 3) + break; + } + } + } + } + } + + /* Actually discard the lines. */ + for (f = 0; f < 2; f++) + { + char *discards = discarded[f]; + lin end = filevec[f].buffered_lines; + lin j = 0; + for (i = 0; i < end; ++i) + if (minimal || discards[i] == 0) + { + filevec[f].undiscarded[j] = filevec[f].equivs[i]; + filevec[f].realindexes[j++] = i; + } + else + filevec[f].changed[i] = 1; + filevec[f].nondiscarded_lines = j; + } + + free (discarded[0]); + free (equiv_count[0]); +} + +/* Adjust inserts/deletes of identical lines to join changes + as much as possible. + + We do something when a run of changed lines include a + line at one end and have an excluded, identical line at the other. + We are free to choose which identical line is included. + `compareseq' usually chooses the one at the beginning, + but usually it is cleaner to consider the following identical line + to be the "change". */ + +void GnuDiff::shift_boundaries (struct file_data filevec[]) +{ + int f; + + for (f = 0; f < 2; f++) + { + bool *changed = filevec[f].changed; + bool const *other_changed = filevec[1 - f].changed; + lin const *equivs = filevec[f].equivs; + lin i = 0; + lin j = 0; + lin i_end = filevec[f].buffered_lines; + + while (1) + { + lin runlength, start, corresponding; + + /* Scan forwards to find beginning of another run of changes. + Also keep track of the corresponding point in the other file. */ + + while (i < i_end && !changed[i]) + { + while (other_changed[j++]) + continue; + i++; + } + + if (i == i_end) + break; + + start = i; + + /* Find the end of this run of changes. */ + + while (changed[++i]) + continue; + while (other_changed[j]) + j++; + + do + { + /* Record the length of this run of changes, so that + we can later determine whether the run has grown. */ + runlength = i - start; + + /* Move the changed region back, so long as the + previous unchanged line matches the last changed one. + This merges with previous changed regions. */ + + while (start && equivs[start - 1] == equivs[i - 1]) + { + changed[--start] = 1; + changed[--i] = 0; + while (changed[start - 1]) + start--; + while (other_changed[--j]) + continue; + } + + /* Set CORRESPONDING to the end of the changed run, at the last + point where it corresponds to a changed run in the other file. + CORRESPONDING == I_END means no such point has been found. */ + corresponding = other_changed[j - 1] ? i : i_end; + + /* Move the changed region forward, so long as the + first changed line matches the following unchanged one. + This merges with following changed regions. + Do this second, so that if there are no merges, + the changed region is moved forward as far as possible. */ + + while (i != i_end && equivs[start] == equivs[i]) + { + changed[start++] = 0; + changed[i++] = 1; + while (changed[i]) + i++; + while (other_changed[++j]) + corresponding = i; + } + } + while (runlength != i - start); + + /* If possible, move the fully-merged run of changes + back to a corresponding run in the other file. */ + + while (corresponding < i) + { + changed[--start] = 1; + changed[--i] = 0; + while (other_changed[--j]) + continue; + } + } + } +} + +/* Cons an additional entry onto the front of an edit script OLD. + LINE0 and LINE1 are the first affected lines in the two files (origin 0). + DELETED is the number of lines deleted here from file 0. + INSERTED is the number of lines inserted here in file 1. + + If DELETED is 0 then LINE0 is the number of the line before + which the insertion was done; vice versa for INSERTED and LINE1. */ + +GnuDiff::change* GnuDiff::add_change (lin line0, lin line1, lin deleted, lin inserted, struct change *old) +{ + struct change *newChange = (change*) xmalloc (sizeof *newChange); + + newChange->line0 = line0; + newChange->line1 = line1; + newChange->inserted = inserted; + newChange->deleted = deleted; + newChange->link = old; + return newChange; +} + +/* Scan the tables of which lines are inserted and deleted, + producing an edit script in reverse order. */ + +GnuDiff::change* GnuDiff::build_reverse_script (struct file_data const filevec[]) +{ + struct change *script = 0; + bool *changed0 = filevec[0].changed; + bool *changed1 = filevec[1].changed; + lin len0 = filevec[0].buffered_lines; + lin len1 = filevec[1].buffered_lines; + + /* Note that changedN[len0] does exist, and is 0. */ + + lin i0 = 0, i1 = 0; + + while (i0 < len0 || i1 < len1) + { + if (changed0[i0] | changed1[i1]) + { + lin line0 = i0, line1 = i1; + + /* Find # lines changed here in each file. */ + while (changed0[i0]) ++i0; + while (changed1[i1]) ++i1; + + /* Record this change. */ + script = add_change (line0, line1, i0 - line0, i1 - line1, script); + } + + /* We have reached lines in the two files that match each other. */ + i0++, i1++; + } + + return script; +} + +/* Scan the tables of which lines are inserted and deleted, + producing an edit script in forward order. */ + +GnuDiff::change* GnuDiff::build_script (struct file_data const filevec[]) +{ + struct change *script = 0; + bool *changed0 = filevec[0].changed; + bool *changed1 = filevec[1].changed; + lin i0 = filevec[0].buffered_lines, i1 = filevec[1].buffered_lines; + + /* Note that changedN[-1] does exist, and is 0. */ + + while (i0 >= 0 || i1 >= 0) + { + if (changed0[i0 - 1] | changed1[i1 - 1]) + { + lin line0 = i0, line1 = i1; + + /* Find # lines changed here in each file. */ + while (changed0[i0 - 1]) --i0; + while (changed1[i1 - 1]) --i1; + + /* Record this change. */ + script = add_change (i0, i1, line0 - i0, line1 - i1, script); + } + + /* We have reached lines in the two files that match each other. */ + i0--, i1--; + } + + return script; +} + + +/* Report the differences of two files. */ +GnuDiff::change* GnuDiff::diff_2_files (struct comparison *cmp) +{ + lin diags; + int f; + //struct change *e, *p; + struct change *script; + int changes; + + read_files (cmp->file, files_can_be_treated_as_binary); + + { + /* Allocate vectors for the results of comparison: + a flag for each line of each file, saying whether that line + is an insertion or deletion. + Allocate an extra element, always 0, at each end of each vector. */ + + size_t s = cmp->file[0].buffered_lines + cmp->file[1].buffered_lines + 4; + bool *flag_space = (bool*)zalloc (s * sizeof(*flag_space)); + cmp->file[0].changed = flag_space + 1; + cmp->file[1].changed = flag_space + cmp->file[0].buffered_lines + 3; + + /* Some lines are obviously insertions or deletions + because they don't match anything. Detect them now, and + avoid even thinking about them in the main comparison algorithm. */ + + discard_confusing_lines (cmp->file); + + /* Now do the main comparison algorithm, considering just the + undiscarded lines. */ + + xvec = cmp->file[0].undiscarded; + yvec = cmp->file[1].undiscarded; + diags = (cmp->file[0].nondiscarded_lines + + cmp->file[1].nondiscarded_lines + 3); + fdiag = (lin*)xmalloc (diags * (2 * sizeof *fdiag)); + bdiag = fdiag + diags; + fdiag += cmp->file[1].nondiscarded_lines + 1; + bdiag += cmp->file[1].nondiscarded_lines + 1; + + /* Set TOO_EXPENSIVE to be approximate square root of input size, + bounded below by 256. */ + too_expensive = 1; + for (; diags != 0; diags >>= 2) + too_expensive <<= 1; + too_expensive = MAX (256, too_expensive); + + files[0] = cmp->file[0]; + files[1] = cmp->file[1]; + + compareseq (0, cmp->file[0].nondiscarded_lines, + 0, cmp->file[1].nondiscarded_lines, minimal); + + free (fdiag - (cmp->file[1].nondiscarded_lines + 1)); + + /* Modify the results slightly to make them prettier + in cases where that can validly be done. */ + + shift_boundaries (cmp->file); + + /* Get the results of comparison in the form of a chain + of `struct change's -- an edit script. */ + + script = build_script (cmp->file); + + changes = (script != 0); + + free (cmp->file[0].undiscarded); + + free (flag_space); + + for (f = 0; f < 2; f++) + { + free (cmp->file[f].equivs); + free (cmp->file[f].linbuf + cmp->file[f].linbuf_base); + } + } + + return script; +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/gnudiff_diff.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/gnudiff_diff.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,355 @@ +/* Shared definitions for GNU DIFF + + Modified for KDiff3 by Joachim Eibl 2003, 2004, 2005. + The original file was part of GNU DIFF. + + Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 2001, + 2002 Free Software Foundation, Inc. + + GNU DIFF is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU DIFF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + If not, write to the Free Software Foundation, + 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef GNUDIFF_DIFF_H +#define GNUDIFF_DIFF_H + +#include "gnudiff_system.h" + +#include +#include + +#define TAB_WIDTH 8 + +class GnuDiff +{ +public: +/* What kind of changes a hunk contains. */ +enum changes +{ + /* No changes: lines common to both files. */ + UNCHANGED, + + /* Deletes only: lines taken from just the first file. */ + OLD, + + /* Inserts only: lines taken from just the second file. */ + NEW, + + /* Both deletes and inserts: a hunk containing both old and new lines. */ + CHANGED +}; + +/* Variables for command line options */ + +/* Nonzero if output cannot be generated for identical files. */ +bool no_diff_means_no_output; + +/* Number of lines of context to show in each set of diffs. + This is zero when context is not to be shown. */ +lin context; + +/* Consider all files as text files (-a). + Don't interpret codes over 0177 as implying a "binary file". */ +bool text; + +/* The significance of white space during comparisons. */ +enum +{ + /* All white space is significant (the default). */ + IGNORE_NO_WHITE_SPACE, + + /* Ignore changes due to tab expansion (-E). */ + IGNORE_TAB_EXPANSION, + + /* Ignore changes in horizontal white space (-b). */ + IGNORE_SPACE_CHANGE, + + /* Ignore all horizontal white space (-w). */ + IGNORE_ALL_SPACE +} ignore_white_space; + +/* Ignore changes that affect only blank lines (-B). */ +bool ignore_blank_lines; + +/* Ignore changes that affect only numbers. (J. Eibl) */ +bool bIgnoreNumbers; +bool bIgnoreWhiteSpace; + +/* Files can be compared byte-by-byte, as if they were binary. + This depends on various options. */ +bool files_can_be_treated_as_binary; + +/* Ignore differences in case of letters (-i). */ +bool ignore_case; + +/* Ignore differences in case of letters in file names. */ +bool ignore_file_name_case; + +/* Regexp to identify function-header lines (-F). */ +//struct re_pattern_buffer function_regexp; + +/* Ignore changes that affect only lines matching this regexp (-I). */ +//struct re_pattern_buffer ignore_regexp; + +/* Say only whether files differ, not how (-q). */ +bool brief; + +/* Expand tabs in the output so the text lines up properly + despite the characters added to the front of each line (-t). */ +bool expand_tabs; + +/* Use a tab in the output, rather than a space, before the text of an + input line, so as to keep the proper alignment in the input line + without changing the characters in it (-T). */ +bool initial_tab; + +/* In directory comparison, specify file to start with (-S). + This is used for resuming an aborted comparison. + All file names less than this name are ignored. */ +const QChar *starting_file; + +/* Pipe each file's output through pr (-l). */ +bool paginate; + +/* Line group formats for unchanged, old, new, and changed groups. */ +const QChar *group_format[CHANGED + 1]; + +/* Line formats for unchanged, old, and new lines. */ +const QChar *line_format[NEW + 1]; + +/* If using OUTPUT_SDIFF print extra information to help the sdiff filter. */ +bool sdiff_merge_assist; + +/* Tell OUTPUT_SDIFF to show only the left version of common lines. */ +bool left_column; + +/* Tell OUTPUT_SDIFF to not show common lines. */ +bool suppress_common_lines; + +/* The half line width and column 2 offset for OUTPUT_SDIFF. */ +unsigned int sdiff_half_width; +unsigned int sdiff_column2_offset; + +/* Use heuristics for better speed with large files with a small + density of changes. */ +bool speed_large_files; + +/* Patterns that match file names to be excluded. */ +struct exclude *excluded; + +/* Don't discard lines. This makes things slower (sometimes much + slower) but will find a guaranteed minimal set of changes. */ +bool minimal; + + +/* The result of comparison is an "edit script": a chain of `struct change'. + Each `struct change' represents one place where some lines are deleted + and some are inserted. + + LINE0 and LINE1 are the first affected lines in the two files (origin 0). + DELETED is the number of lines deleted here from file 0. + INSERTED is the number of lines inserted here in file 1. + + If DELETED is 0 then LINE0 is the number of the line before + which the insertion was done; vice versa for INSERTED and LINE1. */ + +struct change +{ + struct change *link; /* Previous or next edit command */ + lin inserted; /* # lines of file 1 changed here. */ + lin deleted; /* # lines of file 0 changed here. */ + lin line0; /* Line number of 1st deleted line. */ + lin line1; /* Line number of 1st inserted line. */ + bool ignore; /* Flag used in context.c. */ +}; + +/* Structures that describe the input files. */ + +/* Data on one input file being compared. */ + +struct file_data { + /* Buffer in which text of file is read. */ + const QChar* buffer; + + /* Allocated size of buffer, in QChars. Always a multiple of + sizeof *buffer. */ + size_t bufsize; + + /* Number of valid bytes now in the buffer. */ + size_t buffered; + + /* Array of pointers to lines in the file. */ + const QChar **linbuf; + + /* linbuf_base <= buffered_lines <= valid_lines <= alloc_lines. + linebuf[linbuf_base ... buffered_lines - 1] are possibly differing. + linebuf[linbuf_base ... valid_lines - 1] contain valid data. + linebuf[linbuf_base ... alloc_lines - 1] are allocated. */ + lin linbuf_base, buffered_lines, valid_lines, alloc_lines; + + /* Pointer to end of prefix of this file to ignore when hashing. */ + const QChar *prefix_end; + + /* Count of lines in the prefix. + There are this many lines in the file before linbuf[0]. */ + lin prefix_lines; + + /* Pointer to start of suffix of this file to ignore when hashing. */ + const QChar *suffix_begin; + + /* Vector, indexed by line number, containing an equivalence code for + each line. It is this vector that is actually compared with that + of another file to generate differences. */ + lin *equivs; + + /* Vector, like the previous one except that + the elements for discarded lines have been squeezed out. */ + lin *undiscarded; + + /* Vector mapping virtual line numbers (not counting discarded lines) + to real ones (counting those lines). Both are origin-0. */ + lin *realindexes; + + /* Total number of nondiscarded lines. */ + lin nondiscarded_lines; + + /* Vector, indexed by real origin-0 line number, + containing TRUE for a line that is an insertion or a deletion. + The results of comparison are stored here. */ + bool *changed; + + /* 1 if at end of file. */ + bool eof; + + /* 1 more than the maximum equivalence value used for this or its + sibling file. */ + lin equiv_max; +}; + +/* Data on two input files being compared. */ + +struct comparison + { + struct file_data file[2]; + struct comparison const *parent; /* parent, if a recursive comparison */ + }; + +/* Describe the two files currently being compared. */ + +struct file_data files[2]; + +/* Stdio stream to output diffs to. */ + +FILE *outfile; + +/* Declare various functions. */ + +/* analyze.c */ +struct change* diff_2_files (struct comparison *); + +/* context.c */ +void print_context_header (struct file_data[], bool); +void print_context_script (struct change *, bool); + +/* dir.c */ +int diff_dirs (struct comparison const *, int (*) (struct comparison const *, const QChar *, const QChar *)); + +/* ed.c */ +void print_ed_script (struct change *); +void pr_forward_ed_script (struct change *); + +/* ifdef.c */ +void print_ifdef_script (struct change *); + +/* io.c */ +void file_block_read (struct file_data *, size_t); +bool read_files (struct file_data[], bool); + +/* normal.c */ +void print_normal_script (struct change *); + +/* rcs.c */ +void print_rcs_script (struct change *); + +/* side.c */ +void print_sdiff_script (struct change *); + +/* util.c */ +QChar *concat (const QChar *, const QChar *, const QChar *); +bool lines_differ ( const QChar *, size_t, const QChar *, size_t ); +lin translate_line_number (struct file_data const *, lin); +struct change *find_change (struct change *); +struct change *find_reverse_change (struct change *); +void *zalloc (size_t); +enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *); +void begin_output (void); +void debug_script (struct change *); +void finish_output (void); +void message (const QChar *, const QChar *, const QChar *); +void message5 (const QChar *, const QChar *, const QChar *, const QChar *, const QChar *); +void output_1_line (const QChar *, const QChar *, const QChar *, const QChar *); +void perror_with_name (const QChar *); +void setup_output (const QChar *, const QChar *, bool); +void translate_range (struct file_data const *, lin, lin, long *, long *); + +/* version.c */ +//extern const QChar version_string[]; + +private: + // gnudiff_analyze.cpp + lin diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal, struct partition *part); + void compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal); + void discard_confusing_lines (struct file_data filevec[]); + void shift_boundaries (struct file_data filevec[]); + struct change * add_change (lin line0, lin line1, lin deleted, lin inserted, struct change *old); + struct change * build_reverse_script (struct file_data const filevec[]); + struct change* build_script (struct file_data const filevec[]); + + // gnudiff_io.cpp + void find_and_hash_each_line (struct file_data *current); + void find_identical_ends (struct file_data filevec[]); + + // gnudiff_xmalloc.cpp + void *xmalloc (size_t n); + void *xrealloc(void *p, size_t n); + void xalloc_die (void); + + inline bool isWhite( QChar c ) + { + return c==' ' || c=='\t' || c=='\r'; + } +}; // class GnuDiff + +# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) +# define XREALLOC(Ptr, Type, N_items) \ + ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) + +/* Declare and alloc memory for VAR of type TYPE. */ +# define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1) + +/* Free VAR only if non NULL. */ +# define XFREE(Var) \ + do { \ + if (Var) \ + free (Var); \ + } while (0) + +/* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */ +# define CCLONE(Src, Num) \ + (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num))) + +/* Return a malloc'ed copy of SRC. */ +# define CLONE(Src) CCLONE (Src, 1) + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/gnudiff_io.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/gnudiff_io.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,559 @@ +/* File I/O for GNU DIFF. + + Modified for KDiff3 by Joachim Eibl 2003, 2004, 2005. + The original file was part of GNU DIFF. + + Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1998, 2001, 2002 + Free Software Foundation, Inc. + + GNU DIFF is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU DIFF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + If not, write to the Free Software Foundation, + 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include "gnudiff_diff.h" +#include + +/* Rotate an unsigned value to the left. */ +#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n))) + +/* Given a hash value and a new character, return a new hash value. */ +#define HASH(h, c) ((c) + ROL (h, 7)) + +/* The type of a hash value. */ +typedef size_t hash_value; +verify (hash_value_is_unsigned, ! TYPE_SIGNED (hash_value)); + +/* Lines are put into equivalence classes of lines that match in lines_differ. + Each equivalence class is represented by one of these structures, + but only while the classes are being computed. + Afterward, each class is represented by a number. */ +struct equivclass +{ + lin next; /* Next item in this bucket. */ + hash_value hash; /* Hash of lines in this class. */ + const QChar *line; /* A line that fits this class. */ + size_t length; /* That line's length, not counting its newline. */ +}; + +/* Hash-table: array of buckets, each being a chain of equivalence classes. + buckets[-1] is reserved for incomplete lines. */ +static lin *buckets; + +/* Number of buckets in the hash table array, not counting buckets[-1]. */ +static size_t nbuckets; + +/* Array in which the equivalence classes are allocated. + The bucket-chains go through the elements in this array. + The number of an equivalence class is its index in this array. */ +static struct equivclass *equivs; + +/* Index of first free element in the array `equivs'. */ +static lin equivs_index; + +/* Number of elements allocated in the array `equivs'. */ +static lin equivs_alloc; + + +/* Check for binary files and compare them for exact identity. */ + +/* Return 1 if BUF contains a non text character. + SIZE is the number of characters in BUF. */ + +#define binary_file_p(buf, size) (memchr (buf, 0, size) != 0) + +/* Compare two lines (typically one from each input file) + according to the command line options. + For efficiency, this is invoked only when the lines do not match exactly + but an option like -i might cause us to ignore the difference. + Return nonzero if the lines differ. */ + +bool GnuDiff::lines_differ (const QChar *s1, size_t len1, const QChar *s2, size_t len2 ) +{ + const QChar *t1 = s1; + const QChar *t2 = s2; + const QChar *s1end = s1+len1; + const QChar *s2end = s2+len2; + + for ( ; ; ++t1, ++t2 ) + { + /* Test for exact char equality first, since it's a common case. */ + if ( t1!=s1end && t2!=s2end && *t1==*t2 ) + continue; + else + { + while ( t1!=s1end && + ( bIgnoreWhiteSpace && isWhite( *t1 ) || + bIgnoreNumbers && (t1->isDigit() || *t1=='-' || *t1=='.' ))) + { + ++t1; + } + + while ( t2 != s2end && + ( bIgnoreWhiteSpace && isWhite( *t2 ) || + bIgnoreNumbers && (t2->isDigit() || *t2=='-' || *t2=='.' ))) + { + ++t2; + } + + if ( t1!=s1end && t2!=s2end ) + { + if (ignore_case) + { /* Lowercase comparison. */ + if ( t1->toLower() == t2->toLower() ) + continue; + } + else if ( *t1 == *t2 ) + continue; + else + return true; + } + else if ( t1==s1end && t2==s2end ) + return false; + else + return true; + } + } + return false; +} + + +/* Split the file into lines, simultaneously computing the equivalence + class for each line. */ + +void GnuDiff::find_and_hash_each_line (struct file_data *current) +{ + hash_value h; + const QChar *p = current->prefix_end; + QChar c; + lin i, *bucket; + size_t length; + + /* Cache often-used quantities in local variables to help the compiler. */ + const QChar **linbuf = current->linbuf; + lin alloc_lines = current->alloc_lines; + lin line = 0; + lin linbuf_base = current->linbuf_base; + lin *cureqs = (lin*)xmalloc (alloc_lines * sizeof *cureqs); + struct equivclass *eqs = equivs; + lin eqs_index = equivs_index; + lin eqs_alloc = equivs_alloc; + const QChar *suffix_begin = current->suffix_begin; + const QChar *bufend = current->buffer + current->buffered; + bool diff_length_compare_anyway = + ignore_white_space != IGNORE_NO_WHITE_SPACE || bIgnoreNumbers; + bool same_length_diff_contents_compare_anyway = + diff_length_compare_anyway | ignore_case; + + while ( p < suffix_begin) + { + const QChar *ip = p; + + h = 0; + + /* Hash this line until we find a newline or bufend is reached. */ + if (ignore_case) + switch (ignore_white_space) + { + case IGNORE_ALL_SPACE: + while ( pbuffered_lines = line; + + for (i = 0; ; i++) + { + /* Record the line start for lines in the suffix that we care about. + Record one more line start than lines, + so that we can compute the length of any buffered line. */ + if (line == alloc_lines) + { + /* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */ + if ((lin)(PTRDIFF_MAX / 3) <= alloc_lines + || (lin)(PTRDIFF_MAX / sizeof *cureqs) <= 2 * alloc_lines - linbuf_base + || (lin)(PTRDIFF_MAX / sizeof *linbuf) <= alloc_lines - linbuf_base) + xalloc_die (); + alloc_lines = 2 * alloc_lines - linbuf_base; + linbuf += linbuf_base; + linbuf = (const QChar**)xrealloc (linbuf, + (alloc_lines - linbuf_base) * sizeof *linbuf); + linbuf -= linbuf_base; + } + linbuf[line] = p; + + if ( p >= bufend) + break; + + if (context <= i && no_diff_means_no_output) + break; + + line++; + + while (plinbuf = linbuf; + current->valid_lines = line; + current->alloc_lines = alloc_lines; + current->equivs = cureqs; + equivs = eqs; + equivs_alloc = eqs_alloc; + equivs_index = eqs_index; +} + +/* We have found N lines in a buffer of size S; guess the + proportionate number of lines that will be found in a buffer of + size T. However, do not guess a number of lines so large that the + resulting line table might cause overflow in size calculations. */ +static lin +guess_lines (lin n, size_t s, size_t t) +{ + size_t guessed_bytes_per_line = n < 10 ? 32 : s / (n - 1); + lin guessed_lines = MAX (1, t / guessed_bytes_per_line); + return MIN (guessed_lines, (lin)(PTRDIFF_MAX / (2 * sizeof (QChar *) + 1) - 5)) + 5; +} + +/* Given a vector of two file_data objects, find the identical + prefixes and suffixes of each object. */ + +void GnuDiff::find_identical_ends (struct file_data filevec[]) +{ + /* Find identical prefix. */ + const QChar *p0, *p1, *buffer0, *buffer1; + p0 = buffer0 = filevec[0].buffer; + p1 = buffer1 = filevec[1].buffer; + size_t n0, n1; + n0 = filevec[0].buffered; + n1 = filevec[1].buffered; + const QChar* const pEnd0 = p0 + n0; + const QChar* const pEnd1 = p1 + n1; + + if (p0 == p1) + /* The buffers are the same; sentinels won't work. */ + p0 = p1 += n1; + else + { + /* Loop until first mismatch, or end. */ + while ( p0!=pEnd0 && p1!=pEnd1 && *p0 == *p1 ) + { + p0++; + p1++; + } + } + + /* Now P0 and P1 point at the first nonmatching characters. */ + + /* Skip back to last line-beginning in the prefix. */ + while (p0 != buffer0 && (p0[-1] != '\n' )) + p0--, p1--; + + /* Record the prefix. */ + filevec[0].prefix_end = p0; + filevec[1].prefix_end = p1; + + /* Find identical suffix. */ + + /* P0 and P1 point beyond the last chars not yet compared. */ + p0 = buffer0 + n0; + p1 = buffer1 + n1; + + const QChar *end0, *beg0; + end0 = p0; /* Addr of last char in file 0. */ + + /* Get value of P0 at which we should stop scanning backward: + this is when either P0 or P1 points just past the last char + of the identical prefix. */ + beg0 = filevec[0].prefix_end + (n0 < n1 ? 0 : n0 - n1); + + /* Scan back until chars don't match or we reach that point. */ + for (; p0 != beg0; p0--, p1--) + { + if (*p0 != *p1) + { + /* Point at the first char of the matching suffix. */ + beg0 = p0; + break; + } + } + + // Go to the next line (skip last line with a difference) + if ( p0 != end0 ) + { + if (*p0 != *p1) + ++p0; + while ( p0. */ + +static unsigned char const prime_offset[] = +{ + 0, 0, 1, 1, 3, 1, 3, 1, 5, 3, 3, 9, 3, 1, 3, 19, 15, 1, 5, 1, 3, 9, 3, + 15, 3, 39, 5, 39, 57, 3, 35, 1, 5, 9, 41, 31, 5, 25, 45, 7, 87, 21, + 11, 57, 17, 55, 21, 115, 59, 81, 27, 129, 47, 111, 33, 55, 5, 13, 27, + 55, 93, 1, 57, 25 +}; + +/* Verify that this host's size_t is not too wide for the above table. */ + +verify (enough_prime_offsets, + sizeof (size_t) * CHAR_BIT <= sizeof prime_offset); + +/* Given a vector of two file_data objects, read the file associated + with each one, and build the table of equivalence classes. + Return nonzero if either file appears to be a binary file. + If PRETEND_BINARY is nonzero, pretend they are binary regardless. */ + +bool +GnuDiff::read_files (struct file_data filevec[], bool /*pretend_binary*/) +{ + int i; + + find_identical_ends (filevec); + + equivs_alloc = filevec[0].alloc_lines + filevec[1].alloc_lines + 1; + if ((lin)(PTRDIFF_MAX / sizeof *equivs) <= equivs_alloc) + xalloc_die (); + equivs = (equivclass*)xmalloc (equivs_alloc * sizeof *equivs); + /* Equivalence class 0 is permanently safe for lines that were not + hashed. Real equivalence classes start at 1. */ + equivs_index = 1; + + /* Allocate (one plus) a prime number of hash buckets. Use a prime + number between 1/3 and 2/3 of the value of equiv_allocs, + approximately. */ + for (i = 9; 1 << i < equivs_alloc / 3; i++) + continue; + nbuckets = ((size_t) 1 << i) - prime_offset[i]; + if (PTRDIFF_MAX / sizeof *buckets <= nbuckets) + xalloc_die (); + buckets = (lin*)zalloc ((nbuckets + 1) * sizeof *buckets); + buckets++; + + for (i = 0; i < 2; i++) + find_and_hash_each_line (&filevec[i]); + + filevec[0].equiv_max = filevec[1].equiv_max = equivs_index; + + free (equivs); + free (buckets - 1); + + return 0; +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/gnudiff_system.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/gnudiff_system.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,123 @@ +/* System dependent declarations. + + Modified for KDiff3 by Joachim Eibl 2003. + The original file was part of GNU DIFF. + + Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1998, 2001, 2002 + Free Software Foundation, Inc. + + GNU DIFF is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU DIFF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + If not, write to the Free Software Foundation, + 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef GNUDIFF_SYSTEM_H +#define GNUDIFF_SYSTEM_H + +//#include + + + +/* Don't bother to support K&R C compilers any more; it's not worth + the trouble. These macros prevent some library modules from being + compiled in K&R C mode. */ +#define PARAMS(Args) Args +#define PROTOTYPES 1 + +/* Verify a requirement at compile-time (unlike assert, which is runtime). */ +#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } + + +/* Determine whether an integer type is signed, and its bounds. + This code assumes two's (or one's!) complement with no holes. */ + +/* The extra casts work around common compiler bugs, + e.g. Cray C 5.0.3.0 when t == time_t. */ +#ifndef TYPE_SIGNED +# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +#endif +#ifndef TYPE_MINIMUM +# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ + : (t) 0)) +#endif +#ifndef TYPE_MAXIMUM +# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) +#endif + +#include +#include + + +# include +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +#if !EXIT_FAILURE +# undef EXIT_FAILURE /* Sony NEWS-OS 4.0C defines EXIT_FAILURE to 0. */ +# define EXIT_FAILURE 1 +#endif +#define EXIT_TROUBLE 2 + +#include +#ifndef SSIZE_MAX +# define SSIZE_MAX TYPE_MAXIMUM (ssize_t) +#endif + +#ifndef PTRDIFF_MAX +# define PTRDIFF_MAX TYPE_MAXIMUM (ptrdiff_t) +#endif +#ifndef SIZE_MAX +# define SIZE_MAX TYPE_MAXIMUM (size_t) +#endif +#ifndef UINTMAX_MAX +# define UINTMAX_MAX TYPE_MAXIMUM (uintmax_t) +#endif + +#include +#include +#include + +/* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given + as an argument to macros like `isspace'. */ +# define CTYPE_DOMAIN(c) 1 +#define ISPRINT(c) (CTYPE_DOMAIN (c) && isprint (c)) +#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) + +# define TOLOWER(c) tolower (c) + +/* ISDIGIT differs from isdigit, as follows: + - Its arg may be any int or unsigned int; it need not be an unsigned char. + - It's guaranteed to evaluate its argument exactly once. + - It's typically faster. + POSIX 1003.1-2001 says that only '0' through '9' are digits. + Prefer ISDIGIT to isdigit unless it's important to use the locale's + definition of `digit' even when the host does not conform to POSIX. */ +#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) + +#undef MIN +#undef MAX +#define MIN(a, b) ((a) <= (b) ? (a) : (b)) +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) + + +/* The integer type of a line number. Since files are read into main + memory, ptrdiff_t should be wide enough. */ + +typedef ptrdiff_t lin; +#define LIN_MAX PTRDIFF_MAX +verify (lin_is_signed, TYPE_SIGNED (lin)); +verify (lin_is_wide_enough, sizeof (ptrdiff_t) <= sizeof (lin)); +verify (lin_is_printable_as_long, sizeof (lin) <= sizeof (long)); + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/gnudiff_xmalloc.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/gnudiff_xmalloc.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,88 @@ +/* xmalloc.c -- malloc with out of memory checking + + Modified for KDiff3 by Joachim Eibl 2003. + The original file was part of GNU DIFF. + + Copyright (C) 1990-1999, 2000, 2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#if HAVE_CONFIG_H +# include +#endif + +#include + + +#include +#include + + +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#include "gnudiff_diff.h" +/* If non NULL, call this function when memory is exhausted. */ +//void (*xalloc_fail_func) PARAMS ((void)) = 0; +void (*xalloc_fail_func)(void) = 0; + + +void GnuDiff::xalloc_die (void) +{ + if (xalloc_fail_func) + (*xalloc_fail_func) (); + //error (exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted)); + /* The `noreturn' cannot be given to error, since it may return if + its first argument is 0. To help compilers understand the + xalloc_die does terminate, call exit. */ + exit (EXIT_FAILURE); +} + +/* Allocate N bytes of memory dynamically, with error checking. */ + +void * +GnuDiff::xmalloc (size_t n) +{ + void *p; + + p = malloc (n == 0 ? 1 : n); // There are systems where malloc returns 0 for n==0. + if (p == 0) + xalloc_die (); + return p; +} + +/* Change the size of an allocated block of memory P to N bytes, + with error checking. */ + +void * +GnuDiff::xrealloc (void *p, size_t n) +{ + p = realloc (p, n==0 ? 1 : n); + if (p == 0) + xalloc_die (); + return p; +} + + +/* Yield a new block of SIZE bytes, initialized to zero. */ + +void * +GnuDiff::zalloc (size_t size) +{ + void *p = xmalloc (size); + memset (p, 0, size); + return p; +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/hi16-app-kdiff3.png Binary file kdiff3/src-QT4/hi16-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/hi32-app-kdiff3.png Binary file kdiff3/src-QT4/hi32-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,983 @@ +/*************************************************************************** + kdiff3.cpp - description + ------------------- + begin : Don Jul 11 12:31:29 CEST 2002 + copyright : (C) 2002-2004 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "difftextwindow.h" +#include "mergeresultwindow.h" + +#include + +// include files for QT +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// include files for KDE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include + +// application specific includes +#include "kdiff3.h" +#include "optiondialog.h" +#include "fileaccess.h" +#include "kdiff3_part.h" +#include "directorymergewindow.h" +#include "smalldialogs.h" + +#define ID_STATUS_MSG 1 + +KActionCollection* KDiff3App::actionCollection() +{ + if ( m_pKDiff3Shell==0 ) + return m_pKDiff3Part->actionCollection(); + else + return m_pKDiff3Shell->actionCollection(); +} + +KStatusBar* KDiff3App::statusBar() +{ + if ( m_pKDiff3Shell==0 ) + return 0; + else + return m_pKDiff3Shell->statusBar(); +} + +KToolBar* KDiff3App::toolBar(const char* toolBarId ) +{ + if ( m_pKDiff3Shell==0 ) + return 0; + else + return m_pKDiff3Shell->toolBar( toolBarId ); +} + +bool KDiff3App::isPart() +{ + return m_pKDiff3Shell==0; +} + +bool KDiff3App::isFileSaved() +{ + return m_bFileSaved; +} + +KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part ) + : QSplitter(pParent) //previously KMainWindow +{ + setObjectName( name ); + m_pKDiff3Part = pKDiff3Part; + m_pKDiff3Shell = dynamic_cast(pParent); + + setWindowTitle( "KDiff3" ); + setOpaqueResize(false); // faster resizing + + m_pMainSplitter = 0; + m_pDirectoryMergeWindow = 0; + m_pCornerWidget = 0; + m_pMainWidget = 0; + m_pDiffTextWindow1 = 0; + m_pDiffTextWindow2 = 0; + m_pDiffTextWindow3 = 0; + m_pDiffTextWindowFrame1 = 0; + m_pDiffTextWindowFrame2 = 0; + m_pDiffTextWindowFrame3 = 0; + m_pDiffWindowSplitter = 0; + m_pOverview = 0; + m_bTripleDiff = false; + m_pMergeResultWindow = 0; + m_pMergeWindowFrame = 0; + m_bOutputModified = false; + m_bFileSaved = false; + m_bTimerBlock = false; + m_pHScrollBar = 0; + + // Needed before any file operations via FileAccess happen. + if (!g_pProgressDialog) + g_pProgressDialog = new ProgressDialog(0); + + // All default values must be set before calling readOptions(). + m_pOptionDialog = new OptionDialog( m_pKDiff3Shell!=0, this ); + connect( m_pOptionDialog, SIGNAL(applyClicked()), this, SLOT(slotRefresh()) ); + + m_pOptionDialog->readOptions( isPart() ? m_pKDiff3Part->instance()->config() : kapp->config() ); + + // Option handling: Only when pParent==0 (no parent) + KCmdLineArgs *args = isPart() ? 0 : KCmdLineArgs::parsedArgs(); + + if (args) + { + QString s; + QString title; + if ( args->isSet("confighelp") ) + { + s = m_pOptionDialog->calcOptionHelp(); + title = i18n("Current Configuration:"); + } + else + { + s = m_pOptionDialog->parseOptions( args->getOptionList("cs") ); + title = i18n("Config Option Error:"); + } + if (!s.isEmpty()) + { +#ifdef _WIN32 + // A windows program has no console + //KMessageBox::information(0, s,i18n("KDiff3-Usage")); + QDialog* pDialog = new QDialog(this); + pDialog->setAttribute( Qt::WA_DeleteOnClose ); + pDialog->setModal( true ); + pDialog->setWindowTitle(title); + QVBoxLayout* pVBoxLayout = new QVBoxLayout( pDialog ); + QTextEdit* pTextEdit = new QTextEdit(pDialog); + pTextEdit->setText(s); + pTextEdit->setReadOnly(true); + pTextEdit->setWordWrapMode(QTextOption::NoWrap); + pVBoxLayout->addWidget(pTextEdit); + pDialog->resize(600,400); + pDialog->exec(); +#else + std::cerr << title.toLatin1().constData() << std::endl; + std::cerr << s.toLatin1().constData() << std::endl; +#endif + exit(1); + } + } + + m_sd1.setOptionDialog(m_pOptionDialog); + m_sd2.setOptionDialog(m_pOptionDialog); + m_sd3.setOptionDialog(m_pOptionDialog); + + if (args!=0) + { + m_outputFilename = args->getOption("output"); + if ( m_outputFilename.isEmpty() ) + m_outputFilename = args->getOption("out"); + } + + m_bAuto = args!=0 && args->isSet("auto"); + if ( m_bAuto && m_outputFilename.isEmpty() ) + { + //KMessageBox::information(this, i18n("Option --auto used, but no output file specified.")); + std::cerr << (const char*)i18n("Option --auto used, but no output file specified.").toLatin1() << std::endl; + m_bAuto = false; + } + + if ( m_outputFilename.isEmpty() && args!=0 && args->isSet("merge") ) + { + m_outputFilename = "unnamed.txt"; + m_bDefaultFilename = true; + } + else + m_bDefaultFilename = false; + + g_bAutoSolve = args!=0 && !args->isSet("qall"); // Note that this is effective only once. + + if ( args!=0 ) + { + m_sd1.setFilename( args->getOption("base") ); + if ( m_sd1.isEmpty() ) + { + if ( args->count() > 0 ) m_sd1.setFilename( args->url(0).url() ); // args->arg(0) + if ( args->count() > 1 ) m_sd2.setFilename( args->url(1).url() ); + if ( args->count() > 2 ) m_sd3.setFilename( args->url(2).url() ); + } + else + { + if ( args->count() > 0 ) m_sd2.setFilename( args->url(0).url() ); + if ( args->count() > 1 ) m_sd3.setFilename( args->url(1).url() ); + } + + + QCStringList aliasList = args->getOptionList("fname"); + QCStringList::Iterator ali = aliasList.begin(); + + QString an1 = args->getOption("L1"); + if ( !an1.isEmpty() ) { m_sd1.setAliasName(an1); } + else if ( ali != aliasList.end() ) { m_sd1.setAliasName(*ali); ++ali; } + + QString an2 = args->getOption("L2"); + if ( !an2.isEmpty() ) { m_sd2.setAliasName(an2); } + else if ( ali != aliasList.end() ) { m_sd2.setAliasName(*ali); ++ali; } + + QString an3 = args->getOption("L3"); + if ( !an3.isEmpty() ) { m_sd3.setAliasName(an3); } + else if ( ali != aliasList.end() ) { m_sd3.setAliasName(*ali); ++ali; } + } + /////////////////////////////////////////////////////////////////// + // call inits to invoke all other construction parts + initActions(actionCollection()); + initStatusBar(); + + m_pFindDialog = new FindDialog( this ); + connect( m_pFindDialog, SIGNAL(findNext()), this, SLOT(slotEditFindNext())); + + autoAdvance->setChecked( m_pOptionDialog->m_bAutoAdvance ); + showWhiteSpaceCharacters->setChecked( m_pOptionDialog->m_bShowWhiteSpaceCharacters ); + showWhiteSpace->setChecked( m_pOptionDialog->m_bShowWhiteSpace ); + showWhiteSpaceCharacters->setEnabled( m_pOptionDialog->m_bShowWhiteSpace ); + showLineNumbers->setChecked( m_pOptionDialog->m_bShowLineNumbers ); + wordWrap->setChecked( m_pOptionDialog->m_bWordWrap ); + if ( ! isPart() ) + { + viewToolBar->setChecked( m_pOptionDialog->m_bShowToolBar ); + viewStatusBar->setChecked( m_pOptionDialog->m_bShowStatusBar ); + slotViewToolBar(); + slotViewStatusBar(); + if( toolBar("mainToolBar")!=0 ) + toolBar("mainToolBar")->setBarPos( (KToolBar::BarPosition) m_pOptionDialog->m_toolBarPos ); +/* QSize size = m_pOptionDialog->m_geometry; + QPoint pos = m_pOptionDialog->m_position; + if(!size.isEmpty()) + { + m_pKDiff3Shell->resize( size ); + QRect visibleRect = QRect( pos, size ) & QApplication::desktop()->rect(); + if ( visibleRect.width()>100 && visibleRect.height()>100 ) + m_pKDiff3Shell->move( pos ); + }*/ + } + slotRefresh(); + + m_pMainSplitter = this; //new QSplitter(this); + m_pMainSplitter->setOrientation( Qt::Vertical ); +// setCentralWidget( m_pMainSplitter ); + m_pDirectoryMergeSplitter = new QSplitter( m_pMainSplitter ); + m_pDirectoryMergeSplitter->setOrientation( Qt::Horizontal ); + m_pDirectoryMergeWindow = new DirectoryMergeWindow( m_pDirectoryMergeSplitter, m_pOptionDialog, + KApplication::kApplication()->iconLoader() ); + m_pDirectoryMergeInfo = new DirectoryMergeInfo( m_pDirectoryMergeSplitter ); + m_pDirectoryMergeWindow->setDirectoryMergeInfo( m_pDirectoryMergeInfo ); + 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(itemSelectionChanged()), this, SLOT(slotUpdateAvailabilities())); + connect( m_pDirectoryMergeWindow, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), 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&))); + + m_pDirectoryMergeWindow->initDirectoryMergeActions( this, actionCollection() ); + + if ( args!=0 ) args->clear(); // Free up some memory. + + if (m_pKDiff3Shell==0) + { + completeInit(); + } +} + + +void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QString& fn3 ) +{ + if (m_pKDiff3Shell!=0) + { + QSize size=m_pOptionDialog->m_geometry; + QPoint pos=m_pOptionDialog->m_position; + if(!size.isEmpty()) + { + m_pKDiff3Shell->resize( size ); + + QRect visibleRect = QRect( pos, size ) & QApplication::desktop()->rect(); + if ( visibleRect.width()>100 && visibleRect.height()>100 ) + m_pKDiff3Shell->move( pos ); + if (!m_bAuto) + { + if ( m_pOptionDialog->m_bMaximised ) + m_pKDiff3Shell->showMaximized(); + else + m_pKDiff3Shell->show(); + } + } + } + if ( ! fn1.isEmpty() ) { m_sd1.setFilename(fn1); } + if ( ! fn2.isEmpty() ) { m_sd2.setFilename(fn2); } + if ( ! fn3.isEmpty() ) { m_sd3.setFilename(fn3); } + + bool bSuccess = improveFilenames(false); + + if ( m_bAuto && m_bDirCompare ) + { + std::cerr << (const char*)i18n("Option --auto ignored for directory comparison.").toLatin1()<hide(); + + init( m_bAuto ); + if ( m_bAuto ) + { + SourceData* pSD=0; + if ( m_sd3.isEmpty() ) + { + if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd1; } + } + else + { + if ( m_totalDiffStatus.bBinaryBEqC ){ pSD = &m_sd3; } // B==C (assume A is old) + else if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd3; } // assuming C has changed + else if ( m_totalDiffStatus.bBinaryAEqC ){ pSD = &m_sd2; } // assuming B has changed + } + + if ( pSD!=0 ) + { + // Save this file directly, not via the merge result window. + bool bSuccess = false; + FileAccess fa( m_outputFilename ); + if ( m_pOptionDialog->m_bDmCreateBakFiles && fa.exists() ) + { + QString newName = m_outputFilename + ".orig"; + if ( FileAccess::exists( newName ) ) FileAccess::removeFile( newName ); + if ( !FileAccess::exists( newName ) ) fa.rename( newName ); + } + + bSuccess = pSD->saveNormalDataAs( m_outputFilename ); + if ( bSuccess ) ::exit(0); + else KMessageBox::error( this, i18n("Saving failed.") ); + } + else if ( m_pMergeResultWindow->getNrOfUnsolvedConflicts() == 0 ) + { + bool bSuccess = m_pMergeResultWindow->saveDocument( m_pMergeResultWindowTitle->getFileName(), m_pMergeResultWindowTitle->getEncoding() ); + if ( bSuccess ) ::exit(0); + } + } + } + + if (m_pKDiff3Shell) + m_pKDiff3Shell->show(); + + if (statusBar() !=0 ) + statusBar()->setSizeGripEnabled(true); + + slotClipboardChanged(); // For initialisation. + + slotUpdateAvailabilities(); + + if ( ! m_bDirCompare && m_pKDiff3Shell!=0 ) + { + bool bFileOpenError = false; + if ( ! m_sd1.isEmpty() && !m_sd1.hasData() || + ! m_sd2.isEmpty() && !m_sd2.hasData() || + ! m_sd3.isEmpty() && !m_sd3.hasData() ) + { + QString text( i18n("Opening of these files failed:") ); + text += "\n\n"; + if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) + text += " - " + m_sd1.getAliasName() + "\n"; + if ( ! m_sd2.isEmpty() && !m_sd2.hasData() ) + text += " - " + m_sd2.getAliasName() + "\n"; + if ( ! m_sd3.isEmpty() && !m_sd3.hasData() ) + text += " - " + m_sd3.getAliasName() + "\n"; + + KMessageBox::sorry( this, text, i18n("File Open Error") ); + bFileOpenError = true; + } + + if ( m_sd1.isEmpty() || m_sd2.isEmpty() || bFileOpenError ) + slotFileOpen(); + } + else if ( !bSuccess ) // Directory open failed + { + slotFileOpen(); + } +} + +KDiff3App::~KDiff3App() +{ + +} + +void KDiff3App::initActions( KActionCollection* ac ) +{ + if (ac==0) KMessageBox::error(0, "actionCollection==0"); + + fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), ac); + fileOpen->setStatusText(i18n("Opens documents for comparison...")); + + 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!")); + fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), ac); + fileSaveAs->setStatusText(i18n("Saves the current document as...")); + filePrint = KStdAction::print(this, SLOT(slotFilePrint()), ac); + filePrint->setStatusText(i18n("Print the differences")); + fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), ac); + fileQuit->setStatusText(i18n("Quits the application")); + editCut = KStdAction::cut(this, SLOT(slotEditCut()), ac); + editCut->setStatusText(i18n("Cuts the selected section and puts it to the clipboard")); + editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), ac); + editCopy->setStatusText(i18n("Copies the selected section to the clipboard")); + editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), ac); + editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position")); + editSelectAll = KStdAction::selectAll(this, SLOT(slotEditSelectAll()), ac); + editSelectAll->setStatusText(i18n("Select everything in current window")); + editFind = KStdAction::find(this, SLOT(slotEditFind()), ac); + editFind->setStatusText(i18n("Search for a string")); + editFindNext = KStdAction::findNext(this, SLOT(slotEditFindNext()), ac); + editFindNext->setStatusText(i18n("Search again for the string")); + viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), ac); + viewToolBar->setStatusText(i18n("Enables/disables the toolbar")); + viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), ac); + viewStatusBar->setStatusText(i18n("Enables/disables the statusbar")); + KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), ac); + KAction* pAction = KStdAction::preferences(this, SLOT(slotConfigure()), ac ); + if ( isPart() ) + pAction->setText(i18n("Configure KDiff3...")); + + +#include "xpm/downend.xpm" +#include "xpm/currentpos.xpm" +#include "xpm/down1arrow.xpm" +#include "xpm/down2arrow.xpm" +#include "xpm/upend.xpm" +#include "xpm/up1arrow.xpm" +#include "xpm/up2arrow.xpm" +#include "xpm/prevunsolved.xpm" +#include "xpm/nextunsolved.xpm" +#include "xpm/iconA.xpm" +#include "xpm/iconB.xpm" +#include "xpm/iconC.xpm" +#include "xpm/autoadvance.xpm" +#include "xpm/showwhitespace.xpm" +#include "xpm/showwhitespacechars.xpm" +#include "xpm/showlinenumbers.xpm" +//#include "reload.xpm" + + 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"); + chooseAForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose A for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseAForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_a_for_unsolved_whitespace_conflicts"); + chooseBForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose B for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseBForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_b_for_unsolved_whitespace_conflicts"); + chooseCForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose C for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseCForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_c_for_unsolved_whitespace_conflicts"); + autoSolve = new KAction(i18n("Automatically Solve Simple Conflicts"), 0, this, SLOT(slotAutoSolve()), ac, "merge_autosolve"); + unsolve = new KAction(i18n("Set Deltas to Conflicts"), 0, this, SLOT(slotUnsolve()), ac, "merge_autounsolve"); + mergeRegExp = new KAction(i18n("Run Regular Expression Auto Merge"), 0, this, SLOT(slotRegExpAutoMerge()),ac, "merge_regexp_automerge" ); + mergeHistory = new KAction(i18n("Automatically Solve History Conflicts"), 0, this, SLOT(slotMergeHistory()), ac, "merge_versioncontrol_history" ); + splitDiff = new KAction(i18n("Split Diff At Selection"), 0, this, SLOT(slotSplitDiff()), ac, "merge_splitdiff"); + joinDiffs = new KAction(i18n("Join Selected Diffs"), 0, this, SLOT(slotJoinDiffs()), ac, "merge_joindiffs"); + + 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"), 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"); + overviewModeAC = new KToggleAction(i18n("A vs. C Overview"), 0, this, SLOT(slotOverviewAC()), ac, "diff_overview_ac"); + overviewModeBC = new KToggleAction(i18n("B vs. C Overview"), 0, this, SLOT(slotOverviewBC()), ac, "diff_overview_bc"); + wordWrap = new KToggleAction(i18n("Word Wrap Diff Windows"), 0, this, SLOT(slotWordWrapToggled()), ac, "diff_wordwrap"); + addManualDiffHelp = new KAction(i18n("Add Manual Diff Alignment"), Qt::CTRL+Qt::Key_Y, this, SLOT(slotAddManualDiffHelp()), ac, "diff_add_manual_diff_help"); + clearManualDiffHelpList = new KAction(i18n("Clear All Manual Diff Alignments"), Qt::CTRL+Qt::SHIFT+Qt::Key_Y, this, SLOT(slotClearManualDiffHelpList()), ac, "diff_clear_manual_diff_help_list"); + +#ifdef _WIN32 + new KAction(i18n("Focus Next Window"), Qt::CTRL+Qt::Key_Tab, this, SLOT(slotWinFocusNext()), ac, "win_focus_next", false, false); +#endif + winFocusPrev = new KAction(i18n("Focus Prev Window"), Qt::ALT+Qt::Key_Left, this, SLOT(slotWinFocusPrev()), ac, "win_focus_prev"); + winToggleSplitOrientation = new KAction(i18n("Toggle Split Orientation"), 0, this, SLOT(slotWinToggleSplitterOrientation()), ac, "win_toggle_split_orientation"); + + dirShowBoth = new KToggleAction(i18n("Dir && Text Split Screen View"), 0, this, SLOT(slotDirShowBoth()), ac, "win_dir_show_both"); + dirShowBoth->setChecked( true ); + dirViewToggle = new KAction(i18n("Toggle Between Dir && Text View"), 0, this, SLOT(slotDirViewToggle()), actionCollection(), "win_dir_view_toggle"); + + m_pMergeEditorPopupMenu = new QMenu( this ); + chooseA->plug( m_pMergeEditorPopupMenu ); + chooseB->plug( m_pMergeEditorPopupMenu ); + chooseC->plug( m_pMergeEditorPopupMenu ); +} + + +void KDiff3App::showPopupMenu( const QPoint& point ) +{ + m_pMergeEditorPopupMenu->popup( point ); +} + +void KDiff3App::initStatusBar() +{ + /////////////////////////////////////////////////////////////////// + // STATUSBAR + if (statusBar() !=0 ) + statusBar()->showMessage( i18n("Ready.") ); +} + +void KDiff3App::saveOptions( KConfig* config ) +{ + if (!isPart()) + { + m_pOptionDialog->m_bMaximised = m_pKDiff3Shell->isMaximized(); + if( ! m_pKDiff3Shell->isMaximized() ) + { + m_pOptionDialog->m_geometry = m_pKDiff3Shell->size(); + m_pOptionDialog->m_position = m_pKDiff3Shell->pos(); + } + if ( toolBar("mainToolBar")!=0 ) + m_pOptionDialog->m_toolBarPos = (int) toolBar("mainToolBar")->barPos(); + } + + m_pOptionDialog->saveOptions( config ); +} + + + + +bool KDiff3App::queryClose() +{ + saveOptions( isPart() ? m_pKDiff3Part->instance()->config() : kapp->config() ); + + if(m_bOutputModified) + { + int result = KMessageBox::warningYesNoCancel(this, + i18n("The merge result hasn't been saved."), + i18n("Warning"), i18n("Save && Quit"), i18n("Quit Without Saving") ); + if ( result==KMessageBox::Cancel ) + return false; + else if ( result==KMessageBox::Yes ) + { + slotFileSave(); + if ( m_bOutputModified ) + { + KMessageBox::sorry(this, i18n("Saving the merge result failed."), i18n("Warning") ); + return false; + } + } + } + + m_bOutputModified = false; + + if ( m_pDirectoryMergeWindow->isDirectoryMergeInProgress() ) + { + int result = KMessageBox::warningYesNo(this, + i18n("You are currently doing a directory merge. Are you sure, you want to abort?"), + i18n("Warning"), i18n("Quit"), i18n("Continue Merging") ); + if ( result!=KMessageBox::Yes ) + return false; + } + + return true; +} + + +///////////////////////////////////////////////////////////////////// +// SLOT IMPLEMENTATION +///////////////////////////////////////////////////////////////////// + + +void KDiff3App::slotFileSave() +{ + if ( m_bDefaultFilename ) + { + slotFileSaveAs(); + } + else + { + slotStatusMsg(i18n("Saving file...")); + + bool bSuccess = m_pMergeResultWindow->saveDocument( m_outputFilename, m_pMergeResultWindowTitle->getEncoding() ); + if ( bSuccess ) + { + m_bFileSaved = true; + m_bOutputModified = false; + if ( m_bDirCompare ) + m_pDirectoryMergeWindow->mergeResultSaved( m_outputFilename ); + } + + slotStatusMsg(i18n("Ready.")); + } +} + +void KDiff3App::slotFileSaveAs() +{ + slotStatusMsg(i18n("Saving file with a new filename...")); + + QString s = KFileDialog::getSaveURL( QDir::currentPath(), 0, this, i18n("Save As...") ).url(); + if(!s.isEmpty()) + { + m_outputFilename = s; + m_pMergeResultWindowTitle->setFileName( m_outputFilename ); + bool bSuccess = m_pMergeResultWindow->saveDocument( m_outputFilename, m_pMergeResultWindowTitle->getEncoding() ); + if ( bSuccess ) + { + m_bOutputModified = false; + if ( m_bDirCompare ) + m_pDirectoryMergeWindow->mergeResultSaved( m_outputFilename ); + } + //setCaption(url.fileName(),doc->isModified()); + + m_bDefaultFilename = false; + } + + slotStatusMsg(i18n("Ready.")); +} + + +void printDiffTextWindow( MyPainter& painter, const QRect& view, const QString& headerText, DiffTextWindow* pDiffTextWindow, int line, int linesPerPage, QColor fgColor ) +{ + QRect clipRect = view; + clipRect.setTop(0); + painter.setClipRect( clipRect ); + painter.translate( view.left() , 0 ); + QFontMetrics fm = painter.fontMetrics(); + //if ( fm.width(headerText) > view.width() ) + { + // A simple wrapline algorithm + int l=0; + for (int p=0; pview.width()) + { + --i; + break; + } + //QString s2 = s.left(i); + painter.drawText( 0, l*fm.height() + fm.ascent(), s.left(i) ); + p+=i; + ++l; + } + painter.setPen( fgColor ); + painter.drawLine( 0, view.top()-2, view.width(), view.top()-2 ); + } + + painter.translate( 0, view.top() ); + pDiffTextWindow->print( painter, view, line, linesPerPage ); + painter.resetMatrix(); +} + +void KDiff3App::slotFilePrint() +{ + if ( !m_pDiffTextWindow1 ) + return; + + KPrinter printer; + QPrintDialog printDialog(&printer, this); + + int firstSelectionD3LIdx = -1; + int lastSelectionD3LIdx = -1; + if ( m_pDiffTextWindow1 ) { m_pDiffTextWindow1->getSelectionRange(&firstSelectionD3LIdx, &lastSelectionD3LIdx, eD3LLineCoords); } + if ( firstSelectionD3LIdx<0 && m_pDiffTextWindow2 ) { m_pDiffTextWindow2->getSelectionRange(&firstSelectionD3LIdx, &lastSelectionD3LIdx, eD3LLineCoords); } + if ( firstSelectionD3LIdx<0 && m_pDiffTextWindow3 ) { m_pDiffTextWindow3->getSelectionRange(&firstSelectionD3LIdx, &lastSelectionD3LIdx, eD3LLineCoords); } +#ifdef KREPLACEMENTS_H // Currently PrintSelection is not supported in KDEs print dialog. + if ( firstSelectionD3LIdx>=0 ) + { + printDialog.addEnabledOption(QPrintDialog::PrintSelection); + //printer.setOptionEnabled(KPrinter::PrintSelection,true); + } +#endif + + printer.setPageSelection(KPrinter::ApplicationSide); + printDialog.setMinMax(1,10000); + printer.setCurrentPage(10000); + + int currentFirstLine = m_pDiffTextWindow1->getFirstLine(); + int currentFirstD3LIdx = m_pDiffTextWindow1->convertLineToDiff3LineIdx( currentFirstLine ); + + // do some printer initialization + printer.setFullPage( false ); + + // initialize the printer using the print dialog + if (printDialog.exec()== QDialog::Accepted) + { + slotStatusMsg( i18n( "Printing..." ) ); + // create a painter to paint on the printer object + MyPainter painter( 0, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); + + // start painting + if( !painter.begin( &printer ) ) { // paint on printer + slotStatusMsg( i18n( "Printing aborted." ) ); + return; + } + QPaintDevice* pPaintDevice = painter.device(); + int dpiy = pPaintDevice->logicalDpiY(); + int columnDistance = (int) ( (0.5/2.54)*dpiy ); // 0.5 cm between the columns + + int columns = m_bTripleDiff ? 3 : 2; + int columnWidth = ( pPaintDevice->width() - (columns-1)*columnDistance ) / columns; + + QFont f = m_pOptionDialog->m_font; + f.setPointSizeF(f.pointSizeF()-1); // Print with slightly smaller font. + painter.setFont( f ); + QFontMetrics fm = painter.fontMetrics(); + + QString topLineText = i18n("Top line"); + + //int headerWidth = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" ); + int headerLines = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" )/columnWidth+1; + + int headerMargin = headerLines * fm.height() + 3; // Text + one horizontal line + int footerMargin = fm.height() + 3; + + QRect view ( 0, headerMargin, pPaintDevice->width(), pPaintDevice->height() - (headerMargin + footerMargin) ); + QRect view1( 0*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); + QRect view2( 1*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); + QRect view3( 2*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); + + int linesPerPage = view.height() / fm.height(); + int charactersPerLine = columnWidth / fm.width("W"); + if ( m_pOptionDialog->m_bWordWrap ) + { + // For printing the lines are wrapped differently (this invalidates the first line) + recalcWordWrap( charactersPerLine ); + } + + int totalNofLines = max2(m_pDiffTextWindow1->getNofLines(), m_pDiffTextWindow2->getNofLines()); + if ( m_bTripleDiff && m_pDiffTextWindow3) + totalNofLines = max2(totalNofLines, m_pDiffTextWindow3->getNofLines()); + + QList pageList = printer.pageList(); + + bool bPrintCurrentPage=false; + bool bFirstPrintedPage = false; + + bool bPrintSelection = false; + int totalNofPages = (totalNofLines+linesPerPage-1) / linesPerPage; + int line=-1; + int selectionEndLine = -1; + +#ifdef KREPLACEMENTS_H + if ( printer.printRange()==KPrinter::AllPages ) + { + pageList.clear(); + for(int i=0; i=0 ) + { + line = m_pDiffTextWindow1->convertDiff3LineIdxToLine( firstSelectionD3LIdx ); + selectionEndLine = m_pDiffTextWindow1->convertDiff3LineIdxToLine( lastSelectionD3LIdx+1 ); + totalNofPages = (selectionEndLine-line+linesPerPage-1) / linesPerPage; + } + } + + int page = 1; + + QList::iterator pageListIt = pageList.begin(); + for(;;) + { + if (!bPrintSelection) + { + if (pageListIt==pageList.end()) + break; + page = *pageListIt; + line = (page - 1) * linesPerPage; + if (page==10000) // This means "Print the current page" + { + bPrintCurrentPage=true; + // Detect the first visible line in the window. + line = m_pDiffTextWindow1->convertDiff3LineIdxToLine( currentFirstD3LIdx ); + } + } + else + { + if ( line>=selectionEndLine ) + { + break; + } + else + { + if ( selectionEndLine-line < linesPerPage ) + linesPerPage=selectionEndLine-line; + } + } + if (line>=0 && linem_colorA ); + QString headerText1 = m_sd1.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow1->calcTopLineInFile(line)+1); + printDiffTextWindow( painter, view1, headerText1, m_pDiffTextWindow1, line, linesPerPage, m_pOptionDialog->m_fgColor ); + + painter.setPen( m_pOptionDialog->m_colorB ); + QString headerText2 = m_sd2.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow2->calcTopLineInFile(line)+1); + printDiffTextWindow( painter, view2, headerText2, m_pDiffTextWindow2, line, linesPerPage, m_pOptionDialog->m_fgColor ); + + if ( m_bTripleDiff && m_pDiffTextWindow3 ) + { + painter.setPen( m_pOptionDialog->m_colorC ); + QString headerText3 = m_sd3.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow3->calcTopLineInFile(line)+1); + printDiffTextWindow( painter, view3, headerText3, m_pDiffTextWindow3, line, linesPerPage, m_pOptionDialog->m_fgColor ); + } + painter.setClipping(false); + + painter.setPen( m_pOptionDialog->m_fgColor ); + painter.drawLine( 0, view.bottom()+3, view.width(), view.bottom()+3 ); + QString s = bPrintCurrentPage ? QString("") + : QString::number( page ) + "/" + QString::number(totalNofPages); + if ( bPrintSelection ) s+=" (" + i18n("Selection") + ")"; + painter.drawText( (view.right() - painter.fontMetrics().width( s ))/2, + view.bottom() + painter.fontMetrics().ascent() + 5, s ); + + bFirstPrintedPage = true; + } + + if ( bPrintSelection ) + { + line+=linesPerPage; + ++page; + } + else + { + ++pageListIt; + } + } + + painter.end(); + + if ( m_pOptionDialog->m_bWordWrap ) + { + recalcWordWrap(); + m_pDiffVScrollBar->setValue( m_pDiffTextWindow1->convertDiff3LineIdxToLine( currentFirstD3LIdx ) ); + } + + slotStatusMsg( i18n( "Printing completed." ) ); + } + else + { + slotStatusMsg( i18n( "Printing aborted." ) ); + } +} + +void KDiff3App::slotFileQuit() +{ + slotStatusMsg(i18n("Exiting...")); + + if( !queryClose() ) + return; // Don't quit + + KApplication::exit( isFileSaved() ? 0 : 1 ); +} + + + +void KDiff3App::slotViewToolBar() +{ + slotStatusMsg(i18n("Toggling toolbar...")); + m_pOptionDialog->m_bShowToolBar = viewToolBar->isChecked(); + /////////////////////////////////////////////////////////////////// + // turn Toolbar on or off + if ( toolBar("mainToolBar") !=0 ) + { + if(!m_pOptionDialog->m_bShowToolBar) + { + toolBar("mainToolBar")->hide(); + } + else + { + toolBar("mainToolBar")->show(); + } + } + + slotStatusMsg(i18n("Ready.")); +} + +void KDiff3App::slotViewStatusBar() +{ + slotStatusMsg(i18n("Toggle the statusbar...")); + m_pOptionDialog->m_bShowStatusBar = viewStatusBar->isChecked(); + /////////////////////////////////////////////////////////////////// + //turn Statusbar on or off + if (statusBar() !=0 ) + { + if(!viewStatusBar->isChecked()) + { + statusBar()->hide(); + } + else + { + statusBar()->show(); + } + } + + slotStatusMsg(i18n("Ready.")); +} + + +void KDiff3App::slotStatusMsg(const QString &text) +{ + /////////////////////////////////////////////////////////////////// + // change status message permanently + if (statusBar() !=0 ) + { + statusBar()->clearMessage(); + statusBar()->showMessage( text ); + } +} + + + + +//#include "kdiff3.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3.desktop Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,83 @@ + +[Desktop Entry] +Encoding=UTF-8 +Name=KDiff3 +Name[hi]=के-डिफ3 +Name[sv]=Kdiff3 +Name[ta]=கேடிஃபà¯3 +Name[xx]=xxKDiff3xx +GenericName=Diff/Patch Frontend +GenericName[bg]=Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ð° Diff/Patch +GenericName[bs]=Interfejs za Diff/Patch +GenericName[ca]=Interfície per a diff/patch +GenericName[cs]=Rozhraní pro Diff/Patch +GenericName[cy]=Blaen Gwahaniaethau/Clytiau +GenericName[da]=Forende for diff/patch +GenericName[de]=Graphische Oberfläche zu Diff/Patch +GenericName[el]=ΣÏστημα υποστήÏιξης χÏήστη για τα Diff/Patch +GenericName[es]=Interfaz Diff/Patch +GenericName[et]=Võrdlemise ja liitmise rakendus +GenericName[fr]=Interface graphique à diff / patch +GenericName[ga]=Comhéadan Diff/Patch +GenericName[hi]=डिफ/पैच फà¥à¤°à¤¨à¥à¤Ÿà¤à¤£à¥à¤¡ +GenericName[hu]=Grafikus diff/patch +GenericName[is]=Diff/Patch viðmót +GenericName[it]=Interfaccia per diff/patch +GenericName[ja]=Diff/Patch フロントエンド +GenericName[lt]=Diff/Patch naudotojo sÄ…saja +GenericName[ms]=Bahagian Depan Beza/Tampal +GenericName[nb]=Endrings-/lappeprogram +GenericName[nl]=Een schil voor Diff/Patch +GenericName[pa]=Diff/Patch ਮà©à©±à¨– +GenericName[pl]=Interfejs do programów Diff/Patch +GenericName[pt]=Interface do Diff/Patch +GenericName[pt_BR]=Um front-end para Diff/Patch +GenericName[ru]=ГрафичеÑкий Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ðº Diff и Patch +GenericName[sr]=Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÑ˜Ñ Ð·Ð° diff и patch +GenericName[sr@Latn]=Interfejs za diff i patch +GenericName[sv]=Jämförelse- och programfixgränssnitt +GenericName[ta]= Diff/Patch Frontend +GenericName[tg]=ИнтерфейÑи графикӣ ба Diff ва Patch +GenericName[tr]=Diff/Patch Arayüzü +GenericName[uk]=Ð†Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð´Ð¾ diff/patch +GenericName[xx]=xxDiff/Patch Frontendxx +GenericName[zh_CN]=Diff/Patch å‰ç«¯ +GenericName[zu]=Diff/PatchIsiqalo sokugcina +Exec=kdiff3 %i %m -caption "%c" +Icon=kdiff3 +Type=Application +DocPath=kdiff3/index.html +Comment=A File And Directory Comparison And Merge Tool +Comment[bg]=ИнÑтрумент за ÑравнÑване и Ñливане на файлове и директории +Comment[bs]=Alat za uporeÄ‘ivanje i spajanje datoteka i direktorija +Comment[ca]=Una eina per a comparar i fusionar fitxers o directoris +Comment[cs]=Nástroj pro porovnávání a sluÄování souborů a adresářů +Comment[da]=Et indfletningsværktøj for filer og mapper +Comment[de]=Programm zum Vergleichen und Zusammenführen von Dateien und Ordnern +Comment[el]=Ένα εÏγαλείο σÏγκÏισης και συγχώνευσης αÏχείων και καταλόγων +Comment[es]=Una herramienta para mezclar y comparar archivos y directorios +Comment[et]=Failide ja kataloogide võrdlemise ja liitmise tööriist +Comment[fr]=Un outil de comparaison et de fusion de fichiers et dossiers +Comment[hi]=à¤à¤• फाइल तथा डिरेकà¥à¤Ÿà¥à¤°à¥€ तà¥à¤²à¤¨à¤¾ तथा विलीन उपकरण +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 +Comment[ja]=ファイル/ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®æ¯”較/çµ±åˆãƒ„ール +Comment[ka]=ფáƒáƒ˜áƒšáƒ—რდრსáƒáƒ¥áƒáƒ¦áƒáƒšáƒ“ეთრშედáƒáƒ áƒ”ბის დრშერწყმის ხელსáƒáƒ¬áƒ§áƒ +Comment[ms]=Perbandingan Fail Dan Direktori Dan Alatan Gabungan +Comment[nb]=Et verktøy for Ã¥ sammenlikne og slÃ¥ sammen filer og mapper +Comment[nl]=Hulpmiddel voor het vergelijken en samenvoegen van bestanden en mappen +Comment[pa]=ਇੱਕ ਫਾਇਲ ਅਤੇ ਡਾਇਰੈਕਟਰੀ ਤà©à¨²à¨¨à¨¾ ਅਤੇ ਮਿਲਾਨ ਸੰਦ ਹੈ +Comment[pl]=NarzÄ™dzie do porównywania oraz łączenia plików i katalogów +Comment[pt]=Uma Ferramenta de Comparação e Junção de Ficheiros e Pastas +Comment[pt_BR]=Uma Ferramenta de Comparação e Mesclagem de Arquivos e Diretórios +Comment[ru]=Утилита ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ Ð¸ Ð¾Ð±ÑŠÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² и каталогов +Comment[sr]=Ðлат за поређење и Ñтапање фајлова и директоријума +Comment[sr@Latn]=Alat za poreÄ‘enje i stapanje fajlova i direktorijuma +Comment[sv]=Ett jämförelseverktyg för fil- och katalogjämförelser +Comment[tg]=ÐÑбоби баробаркунӣ ва пайванди файлҳо ва каталогҳо +Comment[tr]=Bir Dosya Ve Klasör KarşılaÅŸtırma Ve BirleÅŸtirme Aracı +Comment[uk]=ЗаÑіб-утиліта Ð´Ð»Ñ Ð¿Ð¾Ñ€Ñ–Ð²Ð½ÑÐ½Ð½Ñ Ñ– Ð¿Ð¾Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² та каталогів +Comment[xx]=xxA File And Directory Comparison And Merge Toolxx +Comment[zh_CN]=一个文件和目录的比较åŠåˆå¹¶å·¥å…· +Terminal=false diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,408 @@ +/*************************************************************************** + kdiff3.h - description + ------------------- + begin : Don Jul 11 12:31:29 CEST 2002 + copyright : (C) 2002-2004 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KDIFF3_H +#define KDIFF3_H + +#include "diff.h" + +#ifdef HAVE_CONFIG_H +#include +#endif + +// include files for Qt +#include +#include + +// include files for KDE +#include +#include +#include +#include +#include +#include + + +// forward declaration of the KDiff3 classes +class OptionDialog; +class FindDialog; +class ManualDiffHelpDialog; +class DiffTextWindow; +class DiffTextWindowFrame; +class MergeResultWindow; +class WindowTitleWidget; +class Overview; + +class QScrollBar; +class QComboBox; +class QLineEdit; +class QCheckBox; +class QSplitter; + + +class KDiff3Part; +class DirectoryMergeWindow; +class DirectoryMergeInfo; + + +class ReversibleScrollBar : public QScrollBar +{ + Q_OBJECT + bool* m_pbRightToLeftLanguage; + int m_realVal; +public: + ReversibleScrollBar( Qt::Orientation o, bool* pbRightToLeftLanguage ) + : QScrollBar( o ) + { + m_pbRightToLeftLanguage=pbRightToLeftLanguage; + m_realVal=0; + connect( this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int))); + } + void setAgain(){ setValue(m_realVal); } +public slots: + void slotValueChanged(int i) + { + m_realVal = i; + if(m_pbRightToLeftLanguage && *m_pbRightToLeftLanguage) + m_realVal = maximum()-(i-minimum()); + emit valueChanged2(m_realVal); + } + void setValue(int i) + { + if(m_pbRightToLeftLanguage && *m_pbRightToLeftLanguage) + QScrollBar::setValue( maximum()-(i-minimum()) ); + else + QScrollBar::setValue( i ); + } +signals: + void valueChanged2(int); +}; + +class KDiff3App : public QSplitter +{ + Q_OBJECT + + public: + /** constructor of KDiff3App, calls all init functions to create the application. + */ + KDiff3App( QWidget* parent, const char* name, KDiff3Part* pKDiff3Part ); + ~KDiff3App(); + + bool isPart(); + + /** initializes the KActions of the application */ + void initActions( KActionCollection* ); + + /** save general Options like all bar positions and status as well as the geometry + and the recent file list to the configuration file */ + void saveOptions( KConfig* ); + + /** read general Options again and initialize all variables like the recent file list */ + void readOptions( KConfig* ); + + // Finish initialisation (virtual, so that it can be called from the shell too.) + virtual void completeInit(const QString& fn1="", const QString& fn2="", const QString& fn3=""); + + /** queryClose is called by KMainWindow on each closeEvent of a window. Against the + * default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall + * be saved if Modified; on cancel the closeEvent is rejected. + * @see KMainWindow#queryClose + * @see KMainWindow#closeEvent + */ + virtual bool queryClose(); + virtual bool isFileSaved(); + + signals: + void createNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ); + protected: + void initDirectoryMergeActions(); + /** sets up the statusbar for the main window by initialzing a statuslabel. */ + void initStatusBar(); + + /** creates the centerwidget of the KMainWindow instance and sets it as the view */ + void initView(); + + public slots: + + /** open a file and load it into the document*/ + void slotFileOpen(); + void slotFileOpen2( QString fn1, QString fn2, QString fn3, QString ofn, + QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ); + + void slotFileNameChanged(const QString& fileName, int winIdx); + + /** save a document */ + void slotFileSave(); + /** save a document by a new filename*/ + void slotFileSaveAs(); + + void slotFilePrint(); + + /** closes all open windows by calling close() on each memberList item until the list is empty, then quits the application. + * If queryClose() returns false because the user canceled the saveModified() dialog, the closing breaks. + */ + void slotFileQuit(); + /** put the marked text/object into the clipboard and remove + * it from the document + */ + void slotEditCut(); + /** put the marked text/object into the clipboard + */ + void slotEditCopy(); + /** paste the clipboard into the document + */ + void slotEditPaste(); + /** toggles the toolbar + */ + void slotViewToolBar(); + /** toggles the statusbar + */ + void slotViewStatusBar(); + /** changes the statusbar contents for the standard label permanently, used to indicate current actions. + * @param text the text that is displayed in the statusbar + */ + void slotStatusMsg(const QString &text); + + private: + /** the configuration object of the application */ + //KConfig *config; + + // KAction pointers to enable/disable actions + KAction* fileOpen; + KAction* fileSave; + KAction* fileSaveAs; + KAction* filePrint; + KAction* fileQuit; + KAction* fileReload; + KAction* editCut; + KAction* editCopy; + KAction* editPaste; + KAction* editSelectAll; + KToggleAction* viewToolBar; + KToggleAction* viewStatusBar; + +//////////////////////////////////////////////////////////////////////// +// Special KDiff3 specific stuff starts here + KAction *editFind; + KAction *editFindNext; + + KAction *goCurrent; + KAction *goTop; + KAction *goBottom; + KAction *goPrevUnsolvedConflict; + KAction *goNextUnsolvedConflict; + KAction *goPrevConflict; + KAction *goNextConflict; + KAction *goPrevDelta; + KAction *goNextDelta; + KToggleAction *chooseA; + KToggleAction *chooseB; + KToggleAction *chooseC; + KToggleAction *autoAdvance; + KToggleAction *wordWrap; + KAction* splitDiff; + KAction* joinDiffs; + KAction* addManualDiffHelp; + KAction* clearManualDiffHelpList; + KToggleAction *showWhiteSpaceCharacters; + KToggleAction *showWhiteSpace; + KToggleAction *showLineNumbers; + KAction* chooseAEverywhere; + KAction* chooseBEverywhere; + KAction* chooseCEverywhere; + KAction* chooseAForUnsolvedConflicts; + KAction* chooseBForUnsolvedConflicts; + KAction* chooseCForUnsolvedConflicts; + KAction* chooseAForUnsolvedWhiteSpaceConflicts; + KAction* chooseBForUnsolvedWhiteSpaceConflicts; + KAction* chooseCForUnsolvedWhiteSpaceConflicts; + KAction* autoSolve; + KAction* unsolve; + KAction* mergeHistory; + KAction* mergeRegExp; + KToggleAction *showWindowA; + KToggleAction *showWindowB; + KToggleAction *showWindowC; + KAction *winFocusNext; + KAction *winFocusPrev; + KAction* winToggleSplitOrientation; + KToggleAction *dirShowBoth; + KAction *dirViewToggle; + KToggleAction *overviewModeNormal; + KToggleAction *overviewModeAB; + KToggleAction *overviewModeAC; + KToggleAction *overviewModeBC; + + + QMenu* m_pMergeEditorPopupMenu; + + QSplitter* m_pMainSplitter; + QWidget* m_pMainWidget; + QWidget* m_pMergeWindowFrame; + ReversibleScrollBar* m_pHScrollBar; + QScrollBar* m_pDiffVScrollBar; + QScrollBar* m_pMergeVScrollBar; + + DiffTextWindow* m_pDiffTextWindow1; + DiffTextWindow* m_pDiffTextWindow2; + DiffTextWindow* m_pDiffTextWindow3; + DiffTextWindowFrame* m_pDiffTextWindowFrame1; + DiffTextWindowFrame* m_pDiffTextWindowFrame2; + DiffTextWindowFrame* m_pDiffTextWindowFrame3; + QSplitter* m_pDiffWindowSplitter; + + MergeResultWindow* m_pMergeResultWindow; + WindowTitleWidget* m_pMergeResultWindowTitle; + bool m_bTripleDiff; + + QSplitter* m_pDirectoryMergeSplitter; + DirectoryMergeWindow* m_pDirectoryMergeWindow; + DirectoryMergeInfo* m_pDirectoryMergeInfo; + bool m_bDirCompare; + + Overview* m_pOverview; + + QWidget* m_pCornerWidget; + + TotalDiffStatus m_totalDiffStatus; + + SourceData m_sd1; + SourceData m_sd2; + SourceData m_sd3; + + QString m_outputFilename; + bool m_bDefaultFilename; + + DiffList m_diffList12; + DiffList m_diffList23; + DiffList m_diffList13; + + DiffBufferInfo m_diffBufferInfo; + Diff3LineList m_diff3LineList; + Diff3LineVector m_diff3LineVector; + //ManualDiffHelpDialog* m_pManualDiffHelpDialog; + ManualDiffHelpList m_manualDiffHelpList; + + int m_neededLines; + int m_maxWidth; + int m_DTWHeight; + bool m_bOutputModified; + bool m_bFileSaved; + bool m_bTimerBlock; // Synchronisation + + OptionDialog* m_pOptionDialog; + FindDialog* m_pFindDialog; + + void init( bool bAuto=false, TotalDiffStatus* pTotalDiffStatus=0, bool bLoadFiles=true ); + + virtual bool eventFilter( QObject* o, QEvent* e ); + virtual void resizeEvent(QResizeEvent*); + + bool improveFilenames(bool bCreateNewInstance); + + bool runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList, int winIdx1, int winIdx2 ); + bool runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList ); + bool canContinue(); + + void choose(int choice); + + KActionCollection* actionCollection(); + KStatusBar* statusBar(); + KToolBar* toolBar(const char*); + KDiff3Part* m_pKDiff3Part; + KParts::MainWindow* m_pKDiff3Shell; + bool m_bAuto; + void recalcWordWrap(int nofVisibleColumns=-1); + +public slots: + void resizeDiffTextWindow(int newWidth, int newHeight); + void resizeMergeResultWindow(); + void slotRecalcWordWrap(); + + void showPopupMenu( const QPoint& point ); + + void scrollDiffTextWindow( int deltaX, int deltaY ); + void scrollMergeResultWindow( int deltaX, int deltaY ); + void setDiff3Line( int line ); + void sourceMask( int srcMask, int enabledMask ); + + void slotDirShowBoth(); + void slotDirViewToggle(); + + void slotUpdateAvailabilities(); + void slotEditSelectAll(); + void slotEditFind(); + void slotEditFindNext(); + void slotGoCurrent(); + void slotGoTop(); + void slotGoBottom(); + void slotGoPrevUnsolvedConflict(); + void slotGoNextUnsolvedConflict(); + void slotGoPrevConflict(); + void slotGoNextConflict(); + void slotGoPrevDelta(); + void slotGoNextDelta(); + void slotChooseA(); + void slotChooseB(); + void slotChooseC(); + void slotAutoSolve(); + void slotUnsolve(); + void slotMergeHistory(); + void slotRegExpAutoMerge(); + void slotChooseAEverywhere(); + void slotChooseBEverywhere(); + void slotChooseCEverywhere(); + void slotChooseAForUnsolvedConflicts(); + void slotChooseBForUnsolvedConflicts(); + void slotChooseCForUnsolvedConflicts(); + void slotChooseAForUnsolvedWhiteSpaceConflicts(); + void slotChooseBForUnsolvedWhiteSpaceConflicts(); + void slotChooseCForUnsolvedWhiteSpaceConflicts(); + void slotConfigure(); + void slotConfigureKeys(); + void slotRefresh(); + void slotSelectionEnd(); + void slotSelectionStart(); + void slotClipboardChanged(); + void slotOutputModified(bool); + void slotAfterFirstPaint(); + void slotMergeCurrentFile(); + void slotReload(); + void slotCheckIfCanContinue( bool* pbContinue ); + void slotShowWhiteSpaceToggled(); + void slotShowLineNumbersToggled(); + void slotAutoAdvanceToggled(); + void slotWordWrapToggled(); + void slotShowWindowAToggled(); + void slotShowWindowBToggled(); + void slotShowWindowCToggled(); + void slotWinFocusNext(); + void slotWinFocusPrev(); + void slotWinToggleSplitterOrientation(); + void slotOverviewNormal(); + void slotOverviewAB(); + void slotOverviewAC(); + void slotOverviewBC(); + void slotSplitDiff(); + void slotJoinDiffs(); + void slotAddManualDiffHelp(); + void slotClearManualDiffHelpList(); + + void slotNoRelevantChangesDetected(); +}; + +#endif // KDIFF3_H diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3.ico Binary file kdiff3/src-QT4/kdiff3.ico has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3.lsm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3.lsm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,16 @@ +Begin3 +Title: kdiff3 -- Comparison and Merge of Files and Directories +Version: 0.9.89 +Entered-date: +Description: Tool for comparison and merge of two or three files or directories +Keywords: KDE Qt +Author: Joachim Eibl +Maintained-by: Joachim Eibl +Home-page: http://kdiff3.sourceforge.net +Alternate-site: http://extragear.kde.org/apps/kdiff3 +Primary-site: http://sourceforge.net/project/showfiles.php?group_id=58666 + xxxxxx kdiff3-0.9.89.tar.gz + xxx kdiff3-0.9.89.lsm +Platform: Linux. Needs Qt, runs even better on KDE +Copying-policy: GPL +End diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3.pro Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,58 @@ +TEMPLATE = app +# When unresolved items remain during linking: Try adding "shared" in the CONFIG. +CONFIG += qt warn_on thread release +HEADERS = version.h \ + diff.h \ + difftextwindow.h \ + mergeresultwindow.h \ + kdiff3.h \ + merger.h \ + optiondialog.h \ + kreplacements/kreplacements.h \ + directorymergewindow.h \ + fileaccess.h \ + kdiff3_shell.h \ + kdiff3_part.h \ + smalldialogs.h +SOURCES = main.cpp \ + diff.cpp \ + difftextwindow.cpp \ + kdiff3.cpp \ + merger.cpp \ + mergeresultwindow.cpp \ + optiondialog.cpp \ + pdiff.cpp \ + directorymergewindow.cpp \ + fileaccess.cpp \ + smalldialogs.cpp \ + kdiff3_shell.cpp \ + kdiff3_part.cpp \ + gnudiff_analyze.cpp \ + gnudiff_io.cpp \ + gnudiff_xmalloc.cpp \ + common.cpp \ + kreplacements/kreplacements.cpp \ + kreplacements/ShellContextMenu.cpp +TARGET = kdiff3 +INCLUDEPATH += . ./kreplacements + +win32 { +# QMAKE_CXXFLAGS_DEBUG -= -Zi +# QMAKE_CXXFLAGS_DEBUG += -GX -GR -Z7 /FR -DQT_NO_ASCII_CAST +# QMAKE_LFLAGS_DEBUG += /PDB:NONE +# QMAKE_CXXFLAGS_RELEASE += -GX -GR -DNDEBUG -DQT_NO_ASCII_CAST + + QMAKE_CXXFLAGS_DEBUG += -DQT_NO_ASCII_CAST + QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -DQT_NO_ASCII_CAST + QMAKE_LFLAGS += user32.lib shell32.lib + RC_FILE = kdiff3win.rc +} +unix { + documentation.path = /usr/local/share/doc/kdiff3 + documentation.files = ../doc/* + + INSTALLS += documentation + + target.path = /usr/local/bin + INSTALLS += target +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3_meta_unload.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3_meta_unload.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1 @@ + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3_part.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3_part.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,319 @@ +/*************************************************************************** + * Copyright (C) 2003-2006 Joachim Eibl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "kdiff3_part.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "kdiff3.h" +#include "fileaccess.h" + +#include +#include +#include + +#include "version.h" + +KDiff3Part::KDiff3Part( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name ) + : KParts::ReadOnlyPart(parent, name) +{ + // we need an instance + setInstance( KDiff3PartFactory::instance() ); + + // this should be your custom internal widget + m_widget = new KDiff3App( parentWidget, widgetName, this ); + + // This hack is necessary to avoid a crash when the program terminates. + m_bIsShell = dynamic_cast(parentWidget)!=0; + + // notify the part that this is our internal widget + setWidget(m_widget); + + // create our actions + //KStdAction::open(this, SLOT(fileOpen()), actionCollection()); + //KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); + //KStdAction::save(this, SLOT(save()), actionCollection()); + + setXMLFile("kdiff3_part.rc"); + + // we are read-write by default + setReadWrite(true); + + // we are not modified since we haven't done anything yet + setModified(false); +} + +KDiff3Part::~KDiff3Part() +{ + if ( m_widget!=0 && ! m_bIsShell ) + { + m_widget->saveOptions( m_widget->isPart() ? instance()->config() : kapp->config() ); + } +} + +void KDiff3Part::setReadWrite(bool /*rw*/) +{ +// ReadWritePart::setReadWrite(rw); +} + +void KDiff3Part::setModified(bool /*modified*/) +{ +/* + // get a handle on our Save action and make sure it is valid + KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save)); + if (!save) + return; + + // if so, we either enable or disable it based on the current + // state + if (modified) + save->setEnabled(true); + else + save->setEnabled(false); + + // in any event, we want our parent to do it's thing + ReadWritePart::setModified(modified); +*/ +} + +static void getNameAndVersion( const QString& str, const QString& lineStart, QString& fileName, QString& version ) +{ + if ( str.left( lineStart.length() )==lineStart && fileName.isEmpty() ) + { + int pos = lineStart.length(); + while ( pospos ) + { + while (pos2>pos && str[pos2]!=' ' && str[pos2]!='\t') --pos2; + fileName = str.mid( pos, pos2-pos ); + std::cerr << "KDiff3: " << fileName.toLatin1().constData() << std::endl; + if ( FileAccess(fileName).exists() ) break; + --pos2; + } + + int vpos = str.lastIndexOf("\t", -1); + if ( vpos>0 && vpos>(int)pos2 ) + { + version = str.mid( vpos+1 ); + while( !version.right(1)[0].isLetterOrNumber() ) + version.truncate( version.length()-1 ); + } + } +} + + +bool KDiff3Part::openFile() +{ + // m_file is always local so we can use QFile on it + std::cerr << "KDiff3: " << m_file.toLatin1().constData() << std::endl; + QFile file(m_file); + if (file.open(QIODevice::ReadOnly) == false) + return false; + + // our example widget is text-based, so we use QTextStream instead + // of a raw QDataStream + QTextStream stream(&file); + QString str; + QString fileName1; + QString fileName2; + QString version1; + QString version2; + while (!stream.atEnd() && (fileName1.isEmpty() || fileName2.isEmpty()) ) + { + str = stream.readLine() + "\n"; + getNameAndVersion( str, "---", fileName1, version1 ); + getNameAndVersion( str, "+++", fileName2, version2 ); + } + + file.close(); + + if ( fileName1.isEmpty() && fileName2.isEmpty() ) + { + KMessageBox::sorry(m_widget, i18n("Couldn't find files for comparison.")); + return false; + } + + FileAccess f1(fileName1); + FileAccess f2(fileName2); + + if ( f1.exists() && f2.exists() && fileName1!=fileName2 ) + { + m_widget->slotFileOpen2( fileName1, fileName2, "", "", "", "", "", 0 ); + return true; + } + else if ( version1.isEmpty() && f1.exists() ) + { + // Normal patch + // patch -f -u --ignore-whitespace -i [inputfile] -o [outfile] [patchfile] + QString tempFileName = FileAccess::tempFileName(); + QString cmd = "patch -f -u --ignore-whitespace -i \"" + m_file + + "\" -o \""+tempFileName + "\" \"" + fileName1+ "\""; + + QProcess process; + process.start( cmd ); + process.waitForFinished(-1); + + m_widget->slotFileOpen2( fileName1, tempFileName, "", "", + "", version2.isEmpty() ? fileName2 : "REV:"+version2+":"+fileName2, "", 0 ); // alias names +// std::cerr << "KDiff3: f1:" << fileName1.latin1() <<"<->"<slotFileOpen2( tempFileName, fileName2, "", "", + version1.isEmpty() ? fileName1 : "REV:"+version1+":"+fileName1, "", "", 0 ); // alias name +// std::cerr << "KDiff3: f2:" << fileName2.latin1() <<"<->"<"< [OUTPUTFILE] + + QString tempFileName1 = FileAccess::tempFileName(); + QString cmd1 = "cvs update -p -r " + version1 + " \"" + fileName1 + "\" >\""+tempFileName1+"\""; + QProcess process1; + process1.start( cmd1 ); + process1.waitForFinished(-1); + + QString tempFileName2 = FileAccess::tempFileName(); + QString cmd2 = "cvs update -p -r " + version2 + " \"" + fileName2 + "\" >\""+tempFileName2+"\""; + QProcess process2; + process2.start( cmd2 ); + process2.waitForFinished(-1); + + m_widget->slotFileOpen2( tempFileName1, tempFileName2, "", "", + "REV:"+version1+":"+fileName1, + "REV:"+version2+":"+fileName2, + "", 0 + ); + +// std::cerr << "KDiff3: f1/2:" << tempFileName1.latin1() <<"<->"<text(); + + file.close(); + return true; +*/ + return false; // Not implemented +} + + +// It's usually safe to leave the factory code alone.. with the +// notable exception of the KAboutData data +#include +#include + +KInstance* KDiff3PartFactory::s_instance = 0L; +KAboutData* KDiff3PartFactory::s_about = 0L; + +KDiff3PartFactory::KDiff3PartFactory() + : KParts::Factory() +{ +} + +KDiff3PartFactory::~KDiff3PartFactory() +{ + delete s_instance; + delete s_about; + + s_instance = 0L; +} + +KParts::Part* KDiff3PartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList&/*args*/ ) +{ + // Create an instance of our Part + KDiff3Part* obj = new KDiff3Part( parentWidget, widgetName, parent, name ); + + // See if we are to be read-write or not + if (QString(classname) == "KParts::ReadOnlyPart") + obj->setReadWrite(false); + + return obj; +} + +KInstance* KDiff3PartFactory::instance() +{ + if( !s_instance ) + { + s_about = new KAboutData("kdiff3part", I18N_NOOP("KDiff3Part"), VERSION); + s_about->addAuthor("Joachim Eibl", 0, "joachim.eibl at gmx.de"); + s_instance = new KInstance(s_about); + } + return s_instance; +} + +extern "C" +{ + void* init_libkdiff3part() + { + return new KDiff3PartFactory; + } +} + +// Suppress warning with --enable-final +#undef VERSION + +//#include "kdiff3_part.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3_part.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3_part.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (C) 2003-2006 Joachim Eibl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _KDIFF3PART_H_ +#define _KDIFF3PART_H_ + +#include +#include + +class QWidget; +class QPainter; +class KURL; +class KDiff3App; + +/** + * This is a "Part". It that does all the real work in a KPart + * application. + * + * @short Main Part + * @author Joachim Eibl + */ +class KDiff3Part : public KParts::ReadOnlyPart +{ + Q_OBJECT +public: + /** + * Default constructor + */ + KDiff3Part(QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name); + + /** + * Destructor + */ + virtual ~KDiff3Part(); + + /** + * This is a virtual function inherited from KParts::ReadWritePart. + * A shell will use this to inform this Part if it should act + * read-only + */ + virtual void setReadWrite(bool rw); + + /** + * Reimplemented to disable and enable Save action + */ + virtual void setModified(bool modified); + +protected: + /** + * This must be implemented by each part + */ + virtual bool openFile(); + + /** + * This must be implemented by each read-write part + */ + virtual bool saveFile(); + +private: + KDiff3App* m_widget; + bool m_bIsShell; +}; + +class KInstance; +class KAboutData; + +class KDiff3PartFactory : public KParts::Factory +{ + Q_OBJECT +public: + KDiff3PartFactory(); + virtual ~KDiff3PartFactory(); + virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args ); + static KInstance* instance(); + +private: + static KInstance* s_instance; + static KAboutData* s_about; +}; + +#endif // _KDIFF3PART_H_ diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3_part.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3_part.rc Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,24 @@ + + + + &KDiff3 + + + + + + + + + Configure KDiff3 + + +KDiff3 + + + + + + + + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3_shell.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3_shell.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,195 @@ +/*************************************************************************** + * Copyright (C) 2003-2006 Joachim Eibl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "kdiff3_shell.h" +#include "kdiff3.h" + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + + +KDiff3Shell::KDiff3Shell(bool bCompleteInit) + : KParts::MainWindow( 0L, "kdiff3" ) +{ + m_bUnderConstruction = true; + // set the shell's ui resource file + setXMLFile("kdiff3_shell.rc"); + + // and a status bar + statusBar()->show(); + + // this routine will find and load our Part. it finds the Part by + // name which is a bad idea usually.. but it's alright in this + // case since our Part is made for this Shell + KLibFactory *factory = KLibLoader::self()->factory("libkdiff3part"); + if (factory) + { + // now that the Part is loaded, we cast it to a Part to get + // our hands on it + m_part = static_cast(factory->create(this, + "kdiff3_part", "KParts::ReadWritePart" )); + + if (m_part) + { + // and integrate the part's GUI with the shell's + createGUI(m_part); + + // tell the KParts::MainWindow that this is indeed the main widget + setCentralWidget(m_part->widget()); + + if (bCompleteInit) + ((KDiff3App*)m_part->widget())->completeInit(); + connect(((KDiff3App*)m_part->widget()), SIGNAL(createNewInstance(const QString&, const QString&, const QString&)), this, SLOT(slotNewInstance(const QString&, const QString&, const QString&))); + } + } + else + { + // if we couldn't find our Part, we exit since the Shell by + // itself can't do anything useful + KMessageBox::error(this, i18n("Could not find our part!\n" + "This usually happens due to an installation problem. " + "Please read the README-file in the source package for details.") + ); + //kapp->quit(); + + ::exit(-1); //kapp->quit() doesn't work here yet. + + // we return here, cause kapp->quit() only means "exit the + // next time we enter the event loop... + + return; + } + + // apply the saved mainwindow settings, if any, and ask the mainwindow + // to automatically save settings if changed: window size, toolbar + // position, icon size, etc. + setAutoSaveSettings(); + m_bUnderConstruction = false; +} + +KDiff3Shell::~KDiff3Shell() +{ +} + +bool KDiff3Shell::queryClose() +{ + if (m_part) + return ((KDiff3App*)m_part->widget())->queryClose(); + else + return true; +} + +bool KDiff3Shell::queryExit() +{ + return true; +} + +void KDiff3Shell::closeEvent(QCloseEvent*e) +{ + if ( queryClose() ) + { + e->accept(); + bool bFileSaved = ((KDiff3App*)m_part->widget())->isFileSaved(); + KApplication::exit( bFileSaved ? 0 : 1 ); + } + else + e->ignore(); +} + +void KDiff3Shell::optionsShowToolbar() +{ + // this is all very cut and paste code for showing/hiding the + // toolbar + if (m_toolbarAction->isChecked()) + toolBar()->show(); + else + toolBar()->hide(); +} + +void KDiff3Shell::optionsShowStatusbar() +{ + // this is all very cut and paste code for showing/hiding the + // statusbar + if (m_statusbarAction->isChecked()) + statusBar()->show(); + else + statusBar()->hide(); +} + +void KDiff3Shell::optionsConfigureKeys() +{ + KKeyDialog::configure(actionCollection(), "kdiff3_shell.rc"); +} + +void KDiff3Shell::optionsConfigureToolbars() +{ +#if defined(KDE_MAKE_VERSION) +# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0) + saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); +# else + saveMainWindowSettings(KGlobal::config() ); +# endif +#else + saveMainWindowSettings(KGlobal::config() ); +#endif + + // use the standard toolbar editor + KEditToolbar dlg(factory()); + connect(&dlg, SIGNAL(newToolbarConfig()), + this, SLOT(applyNewToolbarConfig())); + dlg.exec(); +} + +void KDiff3Shell::applyNewToolbarConfig() +{ +#if defined(KDE_MAKE_VERSION) +# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0) + applyMainWindowSettings(KGlobal::config(), autoSaveGroup()); +# else + applyMainWindowSettings(KGlobal::config()); +# endif +#else + applyMainWindowSettings(KGlobal::config()); +#endif +} + +void KDiff3Shell::slotNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ) +{ + KDiff3Shell* pKDiff3Shell = new KDiff3Shell(false); + ((KDiff3App*)pKDiff3Shell->m_part->widget())->completeInit(fn1,fn2,fn3); +} + +//#include "kdiff3_shell.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3_shell.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3_shell.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,74 @@ +/*************************************************************************** + * Copyright (C) 2003-2006 Joachim Eibl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _KDIFF3SHELL_H_ +#define _KDIFF3SHELL_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +class KToggleAction; + +/** + * This is the application "Shell". It has a menubar, toolbar, and + * statusbar but relies on the "Part" to do all the real work. + * + * @short Application Shell + * @author Joachim Eibl + */ +class KDiff3Shell : public KParts::MainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + KDiff3Shell(bool bCompleteInit=true); + + /** + * Default Destructor + */ + virtual ~KDiff3Shell(); + + bool queryClose(); + bool queryExit(); + virtual void closeEvent(QCloseEvent*e); + +private slots: + void optionsShowToolbar(); + void optionsShowStatusbar(); + void optionsConfigureKeys(); + void optionsConfigureToolbars(); + + void applyNewToolbarConfig(); + void slotNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ); + +private: + KParts::ReadWritePart *m_part; + + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; + bool m_bUnderConstruction; +}; + +#endif // _KDIFF3_H_ diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3_shell.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3_shell.rc Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,128 @@ + + + + &File + + + &Directory + + + + + + + + + + + + + + + + + + + + + + Current Item Merge Operation + + + + + + + + Current Item Sync Operation + + + + + + + + + + + + &Movement + + + + + + + + + + + D&iffview + + + + + + + + + + + + &Merge + + + + + + + + + + + + + + + + + + + + + + &Window + + + + + + + + + + +Main Toolbar + + + + + + + + + + + + + + + + + + + + + + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3part.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3part.desktop Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,17 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=KDiff3Part +Name[cs]=Komponenta KDiff3 +Name[fr]=Composant KDiff3 +Name[hi]=के-डिफ3पारà¥à¤Ÿ +Name[nb]=KDiff3-del +Name[pt_BR]=Componente KDiff3 +Name[sv]=Kdiff3-del +Name[ta]=கேடிஃபà¯3 பகà¯à®¤à®¿ +Name[tg]=ҚиÑмиKDiff3 +Name[xx]=xxKDiff3Partxx +Name[zh_CN]=KDiff3 组件 +MimeType=text/x-diff +ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart +X-KDE-Library=libkdiff3part +Type=Service diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kdiff3win.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kdiff3win.rc Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1 @@ +IDI_ICON1 ICON DISCARDABLE "kdiff3.ico" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/README Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,30 @@ +About the "kreplacements"-directory: +==================================== + +I want to be able to compile and use KDiff3 without KDE too. +Since KDiff3 is a KDE program, which uses many KDE-classes and +functions there must be some replacement. + +In many cases this is just the corresponding Qt-class, but often +I wrote something myself. For several very KDE-specific functions +there is no real replacement, but only stub functions that allow +the program to compile and link. + +This stuff is not intended to be used for anything else but KDiff3. +Think of it rather as a big hack, that only has the advantage +that I need not mess up the normal program with many ugly +#ifdef/#endif-clauses. + +Most include files in this directory only include kreplacements.h +where the actual declarations are. The implementions are in +kreplacements.cpp. + +The *.moc-files are dummies. The new KDE-philosophy seems to be +that *.moc-files are directly included into the sources. +The Qt-philosophy still is to generate moc*.cpp files which will +be compiled seperately. With these dummy-moc-files both versions +can be compiled. + + +Joachim +(2003-10-02) diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/ShellContextMenu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/ShellContextMenu.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,475 @@ +// ShellContextMenu.cpp: Implementierung der Klasse CShellContextMenu. +// +////////////////////////////////////////////////////////////////////// +#ifdef _WIN32 +#include +#include +#include +#include +#include +#include +#include +#include +#include "ShellContextMenu.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Konstruktion/Destruktion +////////////////////////////////////////////////////////////////////// + +#define MIN_ID 100 +#define MAX_ID 10000 + + +void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QMenu* pMenu ) +{ + CShellContextMenu scm; + scm.SetObjects(QDir::convertSeparators(itemPath)); + int id = scm.ShowContextMenu (pParentWidget, pt, pMenu); + if (id>=1) + pMenu->actions().value(id-1)->trigger(); +} + +IContextMenu2 * g_IContext2 = NULL; +IContextMenu3 * g_IContext3 = NULL; + +CShellContextMenu::CShellContextMenu() +{ + m_psfFolder = NULL; + m_pidlArray = NULL; + m_hMenu = NULL; +} + +CShellContextMenu::~CShellContextMenu() +{ + // free all allocated datas + if (m_psfFolder && bDelete) + m_psfFolder->Release (); + m_psfFolder = NULL; + FreePIDLArray (m_pidlArray); + m_pidlArray = NULL; + + if (m_hMenu) + DestroyMenu( m_hMenu ); +} + + + +// this functions determines which version of IContextMenu is avaibale for those objects (always the highest one) +// and returns that interface +BOOL CShellContextMenu::GetContextMenu (void ** ppContextMenu, int & iMenuType) +{ + *ppContextMenu = NULL; + LPCONTEXTMENU icm1 = NULL; + + // first we retrieve the normal IContextMenu interface (every object should have it) + m_psfFolder->GetUIObjectOf (NULL, nItems, (LPCITEMIDLIST *) m_pidlArray, IID_IContextMenu, NULL, (void**) &icm1); + + if (icm1) + { // since we got an IContextMenu interface we can now obtain the higher version interfaces via that + if (icm1->QueryInterface (IID_IContextMenu3, ppContextMenu) == NOERROR) + iMenuType = 3; + else if (icm1->QueryInterface (IID_IContextMenu2, ppContextMenu) == NOERROR) + iMenuType = 2; + + if (*ppContextMenu) + icm1->Release(); // we can now release version 1 interface, cause we got a higher one + else + { + iMenuType = 1; + *ppContextMenu = icm1; // since no higher versions were found + } // redirect ppContextMenu to version 1 interface + } + else + return (FALSE); // something went wrong + + return (TRUE); // success +} + + +LRESULT CALLBACK CShellContextMenu::HookWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_MENUCHAR: // only supported by IContextMenu3 + if (g_IContext3) + { + LRESULT lResult = 0; + g_IContext3->HandleMenuMsg2 (message, wParam, lParam, &lResult); + return (lResult); + } + break; + + case WM_DRAWITEM: + case WM_MEASUREITEM: + if (wParam) + break; // if wParam != 0 then the message is not menu-related + + case WM_INITMENUPOPUP: + if (g_IContext2) + g_IContext2->HandleMenuMsg (message, wParam, lParam); + else // version 3 + g_IContext3->HandleMenuMsg (message, wParam, lParam); + return (message == WM_INITMENUPOPUP ? 0 : TRUE); // inform caller that we handled WM_INITPOPUPMENU by ourself + break; + + default: + break; + } + + // call original WndProc of window to prevent undefined bevhaviour of window + return ::CallWindowProc ((WNDPROC) GetProp ( hWnd, TEXT ("OldWndProc")), hWnd, message, wParam, lParam); +} + + +UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QMenu* pMenu ) +{ + HWND hWnd = pParentWidget->winId(); + int iMenuType = 0; // to know which version of IContextMenu is supported + LPCONTEXTMENU pContextMenu; // common pointer to IContextMenu and higher version interface + + if (!GetContextMenu ((void**) &pContextMenu, iMenuType)) + return (0); // something went wrong + + if (!m_hMenu) + { + DestroyMenu( m_hMenu ); + m_hMenu = CreatePopupMenu (); + } + + int i; + QList actionList = pMenu->actions(); + for( i=0; itext(); + if (!s.isEmpty()) + AppendMenuW( m_hMenu, MF_STRING, i+1, (LPCWSTR)s.utf16() ); + } + AppendMenuW( m_hMenu, MF_SEPARATOR, i+1, L"" ); + + // lets fill the our popupmenu + pContextMenu->QueryContextMenu (m_hMenu, GetMenuItemCount (m_hMenu), MIN_ID, MAX_ID, CMF_NORMAL | CMF_EXPLORE); + + // subclass window to handle menurelated messages in CShellContextMenu + WNDPROC OldWndProc; + if (iMenuType > 1) // only subclass if its version 2 or 3 + { + OldWndProc = (WNDPROC) SetWindowLong (hWnd, GWL_WNDPROC, (DWORD) HookWndProc); + if (iMenuType == 2) + g_IContext2 = (LPCONTEXTMENU2) pContextMenu; + else // version 3 + g_IContext3 = (LPCONTEXTMENU3) pContextMenu; + } + else + OldWndProc = NULL; + + UINT idCommand = TrackPopupMenu (m_hMenu,TPM_RETURNCMD | TPM_LEFTALIGN, pt.x(), pt.y(), 0, pParentWidget->winId(), 0); + + if (OldWndProc) // unsubclass + SetWindowLong (hWnd, GWL_WNDPROC, (DWORD) OldWndProc); + + if (idCommand >= MIN_ID && idCommand <= MAX_ID) // see if returned idCommand belongs to shell menu entries + { + InvokeCommand (pContextMenu, idCommand - MIN_ID); // execute related command + idCommand = 0; + } + + pContextMenu->Release(); + g_IContext2 = NULL; + g_IContext3 = NULL; + + return (idCommand); +} + + +void CShellContextMenu::InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand) +{ + CMINVOKECOMMANDINFO cmi = {0}; + cmi.cbSize = sizeof (CMINVOKECOMMANDINFO); + cmi.lpVerb = (LPSTR) MAKEINTRESOURCE (idCommand); + cmi.nShow = SW_SHOWNORMAL; + + pContextMenu->InvokeCommand (&cmi); +} + + +void CShellContextMenu::SetObjects(const QString& strObject) +{ + // only one object is passed + QStringList strArray; + strArray << strObject; // create a CStringArray with one element + + SetObjects (strArray); // and pass it to SetObjects (CStringArray &strArray) + // for further processing +} + + +void CShellContextMenu::SetObjects(const QStringList &strList) +{ + // free all allocated datas + if (m_psfFolder && bDelete) + m_psfFolder->Release (); + m_psfFolder = NULL; + FreePIDLArray (m_pidlArray); + m_pidlArray = NULL; + + // get IShellFolder interface of Desktop (root of shell namespace) + IShellFolder * psfDesktop = NULL; + SHGetDesktopFolder (&psfDesktop); // needed to obtain full qualified pidl + + // ParseDisplayName creates a PIDL from a file system path relative to the IShellFolder interface + // but since we use the Desktop as our interface and the Desktop is the namespace root + // that means that it's a fully qualified PIDL, which is what we need + LPITEMIDLIST pidl = NULL; + + psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[0].utf16(), NULL, &pidl, NULL); + + // now we need the parent IShellFolder interface of pidl, and the relative PIDL to that interface + LPITEMIDLIST pidlItem = NULL; // relative pidl + SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, NULL); + free (pidlItem); + // get interface to IMalloc (need to free the PIDLs allocated by the shell functions) + LPMALLOC lpMalloc = NULL; + SHGetMalloc (&lpMalloc); + lpMalloc->Free (pidl); + + // now we have the IShellFolder interface to the parent folder specified in the first element in strArray + // since we assume that all objects are in the same folder (as it's stated in the MSDN) + // we now have the IShellFolder interface to every objects parent folder + + IShellFolder * psfFolder = NULL; + nItems = strList.size (); + for (int i = 0; i < nItems; i++) + { + pidl=0; + psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[i].utf16(), NULL, &pidl, NULL); + if (pidl) + { + m_pidlArray = (LPITEMIDLIST *) realloc (m_pidlArray, (i + 1) * sizeof (LPITEMIDLIST)); + // get relative pidl via SHBindToParent + SHBindToParentEx (pidl, IID_IShellFolder, (void **) &psfFolder, (LPCITEMIDLIST *) &pidlItem); + m_pidlArray[i] = CopyPIDL (pidlItem); // copy relative pidl to pidlArray + free (pidlItem); + lpMalloc->Free (pidl); // free pidl allocated by ParseDisplayName + psfFolder->Release (); + } + } + lpMalloc->Release (); + psfDesktop->Release (); + + bDelete = TRUE; // indicates that m_psfFolder should be deleted by CShellContextMenu +} + + +// only one full qualified PIDL has been passed +void CShellContextMenu::SetObjects(LPITEMIDLIST /*pidl*/) +{ +/* + // free all allocated datas + if (m_psfFolder && bDelete) + m_psfFolder->Release (); + m_psfFolder = NULL; + FreePIDLArray (m_pidlArray); + m_pidlArray = NULL; + + // full qualified PIDL is passed so we need + // its parent IShellFolder interface and its relative PIDL to that + LPITEMIDLIST pidlItem = NULL; + SHBindToParent ((LPCITEMIDLIST) pidl, IID_IShellFolder, (void **) &m_psfFolder, (LPCITEMIDLIST *) &pidlItem); + + m_pidlArray = (LPITEMIDLIST *) malloc (sizeof (LPITEMIDLIST)); // allocate ony for one elemnt + m_pidlArray[0] = CopyPIDL (pidlItem); + + + // now free pidlItem via IMalloc interface (but not m_psfFolder, that we need later + LPMALLOC lpMalloc = NULL; + SHGetMalloc (&lpMalloc); + lpMalloc->Free (pidlItem); + lpMalloc->Release(); + + nItems = 1; + bDelete = TRUE; // indicates that m_psfFolder should be deleted by CShellContextMenu +*/ +} + + +// IShellFolder interface with a relative pidl has been passed +void CShellContextMenu::SetObjects(IShellFolder *psfFolder, LPITEMIDLIST pidlItem) +{ + // free all allocated datas + if (m_psfFolder && bDelete) + m_psfFolder->Release (); + m_psfFolder = NULL; + FreePIDLArray (m_pidlArray); + m_pidlArray = NULL; + + m_psfFolder = psfFolder; + + m_pidlArray = (LPITEMIDLIST *) malloc (sizeof (LPITEMIDLIST)); + m_pidlArray[0] = CopyPIDL (pidlItem); + + nItems = 1; + bDelete = FALSE; // indicates wheter m_psfFolder should be deleted by CShellContextMenu +} + +void CShellContextMenu::SetObjects(IShellFolder * psfFolder, LPITEMIDLIST *pidlArray, int nItemCount) +{ + // free all allocated datas + if (m_psfFolder && bDelete) + m_psfFolder->Release (); + m_psfFolder = NULL; + FreePIDLArray (m_pidlArray); + m_pidlArray = NULL; + + m_psfFolder = psfFolder; + + m_pidlArray = (LPITEMIDLIST *) malloc (nItemCount * sizeof (LPITEMIDLIST)); + + for (int i = 0; i < nItemCount; i++) + m_pidlArray[i] = CopyPIDL (pidlArray[i]); + + nItems = nItemCount; + bDelete = FALSE; // indicates wheter m_psfFolder should be deleted by CShellContextMenu +} + + +void CShellContextMenu::FreePIDLArray(LPITEMIDLIST *pidlArray) +{ + if (!pidlArray) + return; + + int iSize = _msize (pidlArray) / sizeof (LPITEMIDLIST); + + for (int i = 0; i < iSize; i++) + free (pidlArray[i]); + free (pidlArray); +} + + +LPITEMIDLIST CShellContextMenu::CopyPIDL (LPCITEMIDLIST pidl, int cb) +{ + if (cb == -1) + cb = GetPIDLSize (pidl); // Calculate size of list. + + LPITEMIDLIST pidlRet = (LPITEMIDLIST) calloc (cb + sizeof (USHORT), sizeof (BYTE)); + if (pidlRet) + CopyMemory(pidlRet, pidl, cb); + + return (pidlRet); +} + + +UINT CShellContextMenu::GetPIDLSize (LPCITEMIDLIST pidl) +{ + if (!pidl) + return 0; + int nSize = 0; + LPITEMIDLIST pidlTemp = (LPITEMIDLIST) pidl; + while (pidlTemp->mkid.cb) + { + nSize += pidlTemp->mkid.cb; + pidlTemp = (LPITEMIDLIST) (((LPBYTE) pidlTemp) + pidlTemp->mkid.cb); + } + return nSize; +} + +HMENU CShellContextMenu::GetMenu() +{ + if (!m_hMenu) + { + m_hMenu = CreatePopupMenu(); // create the popupmenu (its empty) + } + return (m_hMenu); +} + + +// this is workaround function for the Shell API Function SHBindToParent +// SHBindToParent is not available under Win95/98 +HRESULT CShellContextMenu::SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast) +{ + HRESULT hr = 0; + if (!pidl || !ppv) + return E_POINTER; + + int nCount = GetPIDLCount (pidl); + if (nCount == 0) // desktop pidl of invalid pidl + return E_POINTER; + + IShellFolder * psfDesktop = NULL; + SHGetDesktopFolder (&psfDesktop); + if (nCount == 1) // desktop pidl + { + if ((hr = psfDesktop->QueryInterface(riid, ppv)) == S_OK) + { + if (ppidlLast) + *ppidlLast = CopyPIDL (pidl); + } + psfDesktop->Release (); + return hr; + } + + LPBYTE pRel = GetPIDLPos (pidl, nCount - 1); + LPITEMIDLIST pidlParent = NULL; + pidlParent = CopyPIDL (pidl, pRel - (LPBYTE) pidl); + IShellFolder * psfFolder = NULL; + + if ((hr = psfDesktop->BindToObject (pidlParent, NULL, IID_IShellFolder, (void **) &psfFolder)) != S_OK) + { + free (pidlParent); + psfDesktop->Release (); + return hr; + } + if ((hr = psfFolder->QueryInterface (riid, ppv)) == S_OK) + { + if (ppidlLast) + *ppidlLast = CopyPIDL ((LPCITEMIDLIST) pRel); + } + free (pidlParent); + psfFolder->Release (); + psfDesktop->Release (); + return hr; +} + + +LPBYTE CShellContextMenu::GetPIDLPos (LPCITEMIDLIST pidl, int nPos) +{ + if (!pidl) + return 0; + int nCount = 0; + + BYTE * pCur = (BYTE *) pidl; + while (((LPCITEMIDLIST) pCur)->mkid.cb) + { + if (nCount == nPos) + return pCur; + nCount++; + pCur += ((LPCITEMIDLIST) pCur)->mkid.cb; // + sizeof(pidl->mkid.cb); + } + if (nCount == nPos) + return pCur; + return NULL; +} + + +int CShellContextMenu::GetPIDLCount (LPCITEMIDLIST pidl) +{ + if (!pidl) + return 0; + + int nCount = 0; + BYTE* pCur = (BYTE *) pidl; + while (((LPCITEMIDLIST) pCur)->mkid.cb) + { + nCount++; + pCur += ((LPCITEMIDLIST) pCur)->mkid.cb; + } + return nCount; +} + +#endif + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/ShellContextMenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/ShellContextMenu.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,44 @@ +// ShellContextMenu.h: Schnittstelle für die Klasse CShellContextMenu. +// +////////////////////////////////////////////////////////////////////// + +#ifndef SHELLCONTEXTMENU_H +#define SHELLCONTEXTMENU_H + +///////////////////////////////////////////////////////////////////// +// class to show shell contextmenu of files/folders/shell objects +// developed by R. Engels 2003 +///////////////////////////////////////////////////////////////////// + +class CShellContextMenu +{ +public: + HMENU GetMenu (); + void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem); + void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount); + void SetObjects (LPITEMIDLIST pidl); + void SetObjects (const QString& strObject); + void SetObjects (const QStringList& strList); + UINT ShowContextMenu (QWidget* pParent, QPoint pt, QMenu* pMenu); + CShellContextMenu(); + virtual ~CShellContextMenu(); + +private: + int nItems; + BOOL bDelete; + HMENU m_hMenu; + IShellFolder * m_psfFolder; + LPITEMIDLIST * m_pidlArray; + + void InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand); + BOOL GetContextMenu (void ** ppContextMenu, int & iMenuType); + HRESULT SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast); + static LRESULT CALLBACK HookWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + void FreePIDLArray (LPITEMIDLIST * pidlArray); + LPITEMIDLIST CopyPIDL (LPCITEMIDLIST pidl, int cb = -1); + UINT GetPIDLSize (LPCITEMIDLIST pidl); + LPBYTE GetPIDLPos (LPCITEMIDLIST pidl, int nPos); + int GetPIDLCount (LPCITEMIDLIST pidl); +}; + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kaboutdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kaboutdata.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kaccel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kaccel.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kaction.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kapplication.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kcmdlineargs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kcmdlineargs.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kcolorbtn.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kcolorbtn.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kconfig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kconfig.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kdialogbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kdialogbase.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kedittoolbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kedittoolbar.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kfiledialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kfiledialog.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kfontdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kfontdialog.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kiconloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kiconloader.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kinstance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kinstance.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kio/global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kio/global.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kio/job.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kio/job.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kio/jobclasses.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kio/jobclasses.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kkeydialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kkeydialog.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/klibloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/klibloader.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/klocale.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/klocale.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kmainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kmainwindow.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kmenubar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kmenubar.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kmessagebox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kmessagebox.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/konq_popupmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/konq_popupmenu.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kparts/factory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kparts/factory.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kparts/mainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kparts/mainwindow.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kparts/part.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kparts/part.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kpopupmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kpopupmenu.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kprinter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kprinter.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kprogress.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kprogress.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kreplacements.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kreplacements.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1199 @@ +/*************************************************************************** + kreplacements.cpp - description + ------------------- + begin : Sat Aug 3 2002 + copyright : (C) 2002-2006 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#include "kreplacements.h" +#include "common.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + + +static QString s_copyright; +static QString s_email; +static QString s_description; +static QString s_appName; +static QString s_version; +static QString s_homepage; +static KAboutData* s_pAboutData; + + +#ifdef _WIN32 +#include +#include +#endif + +static void showHelp() +{ + #ifdef _WIN32 + char buf[200]; + int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); + + QString exePath; + if (r!=0) { exePath = buf; } + else { exePath = "."; } + + QFileInfo helpFile( exePath + "\\doc\\en\\index.html" ); + if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\en\\index.html" ); } + if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\doc\\index.html" ); } + if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\index.html" ); } + if ( ! helpFile.exists() ) + { + QMessageBox::warning( 0, "KDiff3 documentation not found", + "Couldn't find the documentation. \n\n" + "The documentation can also be found at the homepage:\n\n " + " http://kdiff3.sourceforge.net/"); + return; + } + + HINSTANCE hi = FindExecutableA( helpFile.fileName().toAscii(), helpFile.absolutePath().toAscii(), buf ); + if ( int(hi)<=32 ) + { + static QTextBrowser* pBrowser = 0; + if (pBrowser==0) + { + pBrowser = new QTextBrowser( 0 ); + pBrowser->setMinimumSize( 600, 400 ); + } + pBrowser->setSource(helpFile.filePath()); + pBrowser->show(); + } + else + { + QFileInfo prog( buf ); + //_spawnlp( _P_NOWAIT , prog.filePath().toAscii(), prog.fileName().toAscii(), (""+.absFilePath()).toAscii(), NULL ); + QProcess::startDetached ( prog.filePath() + " \"file:///" + helpFile.absolutePath() + "\"" ); + } + + #else + static QTextBrowser* pBrowser = 0; + if (pBrowser==0) + { + pBrowser = new QTextBrowser( 0 ); + pBrowser->setMinimumSize( 600, 400 ); + } + pBrowser->setSource(QUrl("file://usr/local/share/doc/kdiff3/en/index.html")); + pBrowser->show(); + #endif +} + +QString getTranslationDir() +{ + #ifdef _WIN32 + char buf[200]; + int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); + + QString exePath; + if (r!=0) { exePath = buf; } + else { exePath = "."; } + return exePath+"/translations"; + #else + return "."; + #endif +} + +// static +void KMessageBox::error( QWidget* parent, const QString& text, const QString& caption ) +{ + QMessageBox::critical( parent, caption, text ); +} + +int KMessageBox::warningContinueCancel( QWidget* parent, const QString& text, const QString& caption, + const QString& button1 ) +{ + return 0 == QMessageBox::warning( parent, caption, text, button1, "Cancel" ) ? Continue : Cancel; +} + +void KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption ) +{ + QMessageBox::information( parent, caption, text ); +} + +void KMessageBox::information( QWidget* parent, const QString& text, const QString& caption ) +{ + QMessageBox::information( parent, caption, text ); +} + +int KMessageBox::warningYesNo( QWidget* parent, const QString& text, const QString& caption, + const QString& button1, const QString& button2 ) +{ + return 0 == QMessageBox::warning( parent, caption, text, button1, button2, QString::null, 1, 1 ) ? Yes : No; +} + +int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const QString& caption, + const QString& button1, const QString& button2 ) +{ + int val = QMessageBox::warning( parent, caption, text, + button1, button2, i18n("Cancel") ); + if ( val==0 ) return Yes; + if ( val==1 ) return No; + else return Cancel; +} + + +KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, + bool /*modal*/, bool ) +: QDialog( parent ) +{ + setObjectName(name); + setModal(true); + QVBoxLayout *pMainLayout = new QVBoxLayout(this); + m_pTabWidget = new QTabWidget(); + pMainLayout->addWidget(m_pTabWidget,1); + + QHBoxLayout* pButtonLayout = new QHBoxLayout(); + pMainLayout->addLayout( pButtonLayout ); + + pButtonLayout->addStretch(1); + QPushButton* pOk = new QPushButton( i18n("Ok") ); + connect( pOk, SIGNAL( clicked() ), this, SLOT(accept()) ); + pButtonLayout->addWidget( pOk ); + + QPushButton* pHelp = new QPushButton( i18n("Help") ); + connect( pHelp, SIGNAL( clicked() ), this, SLOT(slotHelp())); + pButtonLayout->addWidget( pHelp ); + + QPushButton* pDefaults = new QPushButton( i18n("Defaults") ); + connect( pDefaults, SIGNAL( clicked() ), this, SLOT(slotDefault()) ); + pButtonLayout->addWidget( pDefaults ); + + QPushButton* pCancel = new QPushButton( i18n("Cancel") ); + connect( pCancel, SIGNAL( clicked() ), this, SLOT(reject())); + pButtonLayout->addWidget( pCancel ); + + setWindowTitle( caption ); +} + +KDialogBase::~KDialogBase() +{ +} + +void KDialogBase::incInitialSize ( const QSize& ) +{ +} + +void KDialogBase::setHelp(const QString&, const QString& ) +{ +} + + +int KDialogBase::BarIcon(const QString& /*iconName*/, int ) +{ + return 0; // Not used for replacement. +} + + +QFrame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) +{ + QFrame* p = new QFrame(); + p->setObjectName( name ); + m_pTabWidget->addTab( p, name ); + return p; +} + +int KDialogBase::spacingHint() +{ + return 3; +} + +static bool s_inAccept = false; +static bool s_bAccepted = false; +void KDialogBase::accept() +{ + if( ! s_inAccept ) + { + s_bAccepted = false; + s_inAccept = true; + slotOk(); + s_inAccept = false; + if ( s_bAccepted ) + QDialog::accept(); + } + else + { + s_bAccepted = true; + } +} + +void KDialogBase::slotDefault( ) +{ +} +void KDialogBase::slotOk() +{ +} +void KDialogBase::slotCancel( ) +{ +} +void KDialogBase::slotApply( ) +{ + emit applyClicked(); +} +void KDialogBase::slotHelp( ) +{ + showHelp(); +} + +KURL KFileDialog::getSaveURL( const QString &startDir, + const QString &filter, + QWidget *parent, const QString &caption) +{ + QString s = QFileDialog::getSaveFileName(parent, caption, startDir, filter, 0/*, QFileDialog::DontUseNativeDialog*/); + return KURL(s); +} + +KURL KFileDialog::getOpenURL( const QString & startDir, + const QString & filter, + QWidget * parent, + const QString & caption ) +{ + QString s = QFileDialog::getOpenFileName(parent, caption, startDir, filter ); + return KURL(s); +} + +KURL KFileDialog::getExistingURL( const QString & startDir, + QWidget * parent, + const QString & caption) +{ + QString s = QFileDialog::getExistingDirectory(parent, caption, startDir); + return KURL(s); +} + +QString KFileDialog::getSaveFileName (const QString &startDir, + const QString &filter, + QWidget *parent, + const QString &caption) +{ + return QFileDialog::getSaveFileName( parent, caption, startDir, filter ); +} + + +KToolBar::BarPosition KToolBar::barPos() +{ + if ( m_pMainWindow->toolBarArea(this)==Qt::LeftToolBarArea ) return Left; + if ( m_pMainWindow->toolBarArea(this)==Qt::RightToolBarArea ) return Right; + if ( m_pMainWindow->toolBarArea(this)==Qt::BottomToolBarArea ) return Bottom; + if ( m_pMainWindow->toolBarArea(this)==Qt::TopToolBarArea ) return Top; + return Top; +} + +void KToolBar::setBarPos(BarPosition bp) +{ + if ( bp == Left ) m_pMainWindow->addToolBar ( Qt::LeftToolBarArea, this ); + else if ( bp == Right ) m_pMainWindow->addToolBar ( Qt::RightToolBarArea, this ); + else if ( bp == Bottom ) m_pMainWindow->addToolBar ( Qt::BottomToolBarArea, this ); + else if ( bp == Top ) m_pMainWindow->addToolBar ( Qt::TopToolBarArea, this ); +} + +KToolBar::KToolBar( QMainWindow* parent ) +: QToolBar( parent ) +{ + m_pMainWindow = parent; +} + + +KMainWindow::KMainWindow( QWidget* parent, const char* name ) +: QMainWindow( parent ), m_actionCollection(this) +{ + setObjectName(name); + fileMenu = menuBar()->addMenu( i18n("&File") ); + editMenu = menuBar()->addMenu(i18n("&Edit") ); + directoryMenu = menuBar()->addMenu(i18n("&Directory") ); + dirCurrentItemMenu = 0; + dirCurrentSyncItemMenu = 0; + movementMenu = menuBar()->addMenu(i18n("&Movement") ); + diffMenu = menuBar()->addMenu(i18n("D&iffview") ); + mergeMenu = menuBar()->addMenu(i18n("&Merge") ); + windowsMenu = menuBar()->addMenu(i18n("&Window") ); + settingsMenu = menuBar()->addMenu(i18n("&Settings") ); + helpMenu = menuBar()->addMenu(i18n("&Help") ); + + m_pToolBar = new KToolBar(this); + + memberList = new QList; + memberList->append(this); +} + +KToolBar* KMainWindow::toolBar(const QString&) +{ + return m_pToolBar; +} + +KActionCollection* KMainWindow::actionCollection() +{ + return &m_actionCollection; +} + +void KMainWindow::createGUI() +{ + KStdAction::help(this, SLOT(slotHelp()), actionCollection()); + KStdAction::about(this, SLOT(slotAbout()), actionCollection()); + KStdAction::aboutQt(actionCollection()); +} + +void KMainWindow::slotAbout() +{ + QDialog d; + QVBoxLayout* l = new QVBoxLayout( &d ); + QTabWidget* pTabWidget = new QTabWidget; + l->addWidget( pTabWidget ); + + QPushButton* pOkButton = new QPushButton(i18n("Ok")); + connect( pOkButton, SIGNAL(clicked()), &d, SLOT(accept())); + l->addWidget( pOkButton ); + + d.setWindowTitle("About " + s_appName); + QTextBrowser* tb1 = new QTextBrowser(); + tb1->setWordWrapMode( QTextOption::NoWrap ); + tb1->setText( + s_appName + " Version " + s_version + + "\n\n" + s_description + + "\n\n" + s_copyright + + "\n\nHomepage: " + s_homepage + + "\n\nLicence: GNU GPL Version 2" + ); + pTabWidget->addTab(tb1,i18n("&About")); + + std::list::iterator i; + + QString s2; + for( i=s_pAboutData->m_authorList.begin(); i!=s_pAboutData->m_authorList.end(); ++i ) + { + if ( !i->m_name.isEmpty() ) s2 += i->m_name + "\n"; + if ( !i->m_task.isEmpty() ) s2 += " " + i->m_task + "\n"; + if ( !i->m_email.isEmpty() ) s2 += " " + i->m_email + "\n"; + if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; + s2 += "\n"; + } + QTextBrowser* tb2 = new QTextBrowser(); + tb2->setWordWrapMode( QTextOption::NoWrap ); + tb2->setText(s2); + pTabWidget->addTab(tb2,i18n("A&uthor")); + + QString s3; + for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i ) + { + if ( !i->m_name.isEmpty() ) s3 += i->m_name + "\n"; + if ( !i->m_task.isEmpty() ) s3 += " " + i->m_task + "\n"; + if ( !i->m_email.isEmpty() ) s3 += " " + i->m_email + "\n"; + if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; + s3 += "\n"; + } + QTextBrowser* tb3 = new QTextBrowser(); + tb3->setWordWrapMode( QTextOption::NoWrap ); + tb3->setText(s3); + pTabWidget->addTab(tb3,i18n("&Thanks To")); + + d.resize(400,300); + d.exec(); +/* + QMessageBox::information( + this, + "About " + s_appName, + s_appName + " Version " + s_version + + "\n\n" + s_description + + "\n\n" + s_copyright + + "\n\nHomepage: " + s_homepage + + "\n\nLicence: GNU GPL Version 2" + ); +*/ +} + +void KMainWindow::slotHelp() +{ + showHelp(); +} + + +QString KStandardDirs::findResource(const QString& resource, const QString& /*appName*/) +{ + if (resource=="config") + { + QString home = QDir::homePath(); + return home + "/.kdiff3rc"; + } + return QString(); +} + +KConfig::KConfig() +{ +} + +void KConfig::readConfigFile( const QString& configFileName ) +{ + if ( !configFileName.isEmpty() ) + { + m_fileName = configFileName; + } + else + { + m_fileName = KStandardDirs().findResource("config","kdiff3rc"); + } + + QFile f( m_fileName ); + if ( f.open(QIODevice::ReadOnly) ) + { // file opened successfully + QTextStream t( &f ); // use a text stream + load(t); + f.close(); + } +} + +KConfig::~KConfig() +{ + QFile f(m_fileName); + if ( f.open( QIODevice::WriteOnly | QIODevice::Text ) ) + { // file opened successfully + QTextStream t( &f ); // use a text stream + save(t); + f.close(); + } +} + +void KConfig::setGroup(const QString&) +{ +} + +void KAction::init(QObject* receiver, const char* slot, KActionCollection* actionCollection, + const char* name, bool bToggle, bool bMenu) +{ + QString n(name); + KMainWindow* p = actionCollection->m_pMainWindow; + if( slot!=0 ) + { + if (!bToggle) + connect(this, SIGNAL(triggered()), receiver, slot); + else + { + connect(this, SIGNAL(toggled(bool)), receiver, slot); + } + } + + if (bMenu) + { + if( n[0]=='g') p->movementMenu->addAction( this ); + else if( n.left(16)=="dir_current_sync") + { + if ( p->dirCurrentItemMenu==0 ) + { + p->dirCurrentItemMenu = p->directoryMenu->addMenu( i18n("Current Item Merge Operation") ); + p->dirCurrentSyncItemMenu = p->directoryMenu->addMenu( i18n("Current Item Sync Operation") ); + } + p->dirCurrentItemMenu->addAction( this ); + } + else if( n.left(11)=="dir_current") + { + if ( p->dirCurrentItemMenu==0 ) + { + p->dirCurrentItemMenu = p->directoryMenu->addMenu( i18n("Current Item Merge Operation") ); + p->dirCurrentSyncItemMenu = p->directoryMenu->addMenu( i18n("Current Item Sync Operation") ); + } + p->dirCurrentSyncItemMenu->addAction( this ); + } + else if( n.left(4)=="diff") p->diffMenu->addAction( this ); + else if( name[0]=='d') p->directoryMenu->addAction( this ); + else if( name[0]=='f') p->fileMenu->addAction( this ); + else if( name[0]=='w') p->windowsMenu->addAction( this ); + else p->mergeMenu->addAction( this ); + } +} + + +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 ( icon, text, actionCollection->m_pMainWindow ) +{ + setObjectName(name); + setShortcut( accel ); + setCheckable( bToggle ); + KMainWindow* p = actionCollection->m_pMainWindow; + if ( !icon.isNull() && p ) p->m_pToolBar->addAction( this ); + + init(receiver,slot,actionCollection,name,bToggle,bMenu); +} + +KAction::KAction(const QString& text, int accel, + QObject* receiver, const char* slot, KActionCollection* actionCollection, + const char* name, bool bToggle, bool bMenu + ) +: QAction ( text, actionCollection->m_pMainWindow ) +{ + setObjectName(name); + setShortcut( accel ); + setCheckable( bToggle ); + init(receiver,slot,actionCollection,name,bToggle,bMenu); +} + +void KAction::setStatusText(const QString&) +{ +} + +void KAction::plug(QMenu* menu) +{ + menu->addAction( this ); +} + + +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) +{ +} + +KToggleAction::KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) +: KAction( text, accel, receiver, slot, actionCollection, name, true, 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) +{ +} + +void KToggleAction::setChecked(bool bChecked) +{ + blockSignals( true ); + QAction::setChecked( bChecked ); + blockSignals( false ); +} + + +//static +KAction* KStdAction::open( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + #include "../xpm/fileopen.xpm" + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Open"), QIcon(QPixmap(fileopen)), Qt::CTRL+Qt::Key_O, parent, slot, actionCollection, "open", false, false); + if(p){ p->fileMenu->addAction( a ); } + return a; +} + +KAction* KStdAction::save( QWidget* parent, const char* slot, KActionCollection* actionCollection ) +{ + #include "../xpm/filesave.xpm" + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Save"), QIcon(QPixmap(filesave)), Qt::CTRL+Qt::Key_S, parent, slot, actionCollection, "save", false, false); + if(p){ p->fileMenu->addAction( a ); } + return a; +} + +KAction* KStdAction::saveAs( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Save As..."), 0, parent, slot, actionCollection, "saveas", false, false); + if(p) p->fileMenu->addAction( a ); + return a; +} + +KAction* KStdAction::print( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + #include "../xpm/fileprint.xpm" + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Print..."), QIcon(QPixmap(fileprint)),Qt::CTRL+Qt::Key_P, parent, slot, actionCollection, "print", false, false); + if(p) p->fileMenu->addAction( a ); + return a; +} + +KAction* KStdAction::quit( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Quit"), Qt::CTRL+Qt::Key_Q, parent, slot, actionCollection, "quit", false, false); + if(p) p->fileMenu->addAction( a ); + return a; +} + +KAction* KStdAction::cut( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Cut"), Qt::CTRL+Qt::Key_X, parent, slot, actionCollection, "cut", false, false ); + if(p) p->editMenu->addAction( a ); + return a; +} + +KAction* KStdAction::copy( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Copy"), Qt::CTRL+Qt::Key_C, parent, slot, actionCollection, "copy", false, false ); + if(p) p->editMenu->addAction( a ); + return a; +} + +KAction* KStdAction::paste( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Paste"), Qt::CTRL+Qt::Key_V, parent, slot, actionCollection, "paste", false, false ); + if(p) p->editMenu->addAction( a ); + return a; +} + +KAction* KStdAction::selectAll( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Select All"), Qt::CTRL+Qt::Key_A, parent, slot, actionCollection, "selectall", false, false ); + if(p) p->editMenu->addAction( a ); + return a; +} + +KToggleAction* KStdAction::showToolbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KToggleAction* a = new KToggleAction( i18n("Show Toolbar"), 0, parent, slot, actionCollection, "showtoolbar", false ); + if(p) p->settingsMenu->addAction( a ); + return a; +} + +KToggleAction* KStdAction::showStatusbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KToggleAction* a = new KToggleAction( i18n("Show &Statusbar"), 0, parent, slot, actionCollection, "showstatusbar", false ); + if(p) p->settingsMenu->addAction( a ); + return a; +} + +KAction* KStdAction::preferences( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("&Configure %1...").arg("KDiff3"), 0, parent, slot, actionCollection, "settings", false, false ); + if(p) p->settingsMenu->addAction( a ); + return a; +} +KAction* KStdAction::keyBindings( QWidget*, const char*, KActionCollection*) +{ + return 0; +} + +KAction* KStdAction::about( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("About")+" KDiff3", 0, parent, slot, actionCollection, "about_kdiff3", false, false ); + if(p) p->helpMenu->addAction( a ); + return a; +} + +KAction* KStdAction::aboutQt( KActionCollection* actionCollection ) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("About")+" Qt", 0, qApp, SLOT(aboutQt()), actionCollection, "about_qt", false, false ); + if(p) p->helpMenu->addAction( a ); + return a; +} + +KAction* KStdAction::help( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Help"), Qt::Key_F1, parent, slot, actionCollection, "help", false, false ); + if(p) p->helpMenu->addAction( a ); + return a; +} +KAction* KStdAction::find( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Find"), Qt::CTRL+Qt::Key_F, parent, slot, actionCollection, "find", false, false ); + if(p) p->editMenu->addAction( a ); + return a; +} + +KAction* KStdAction::findNext( QWidget* parent, const char* slot, KActionCollection* actionCollection) +{ + KMainWindow* p = actionCollection->m_pMainWindow; + KAction* a = new KAction( i18n("Find Next"), Qt::Key_F3, parent, slot, actionCollection, "findNext", false, false ); + if(p) p->editMenu->addAction( a ); + return a; +} + + + + +KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, const QStringList&, bool, int ) +: QWidget(pParent) +{ + m_pParent = pParent; + QVBoxLayout* pLayout = new QVBoxLayout( this ); + m_pSelectFont = new QPushButton(i18n("Select Font"), this ); + connect(m_pSelectFont, SIGNAL(clicked()), this, SLOT(slotSelectFont())); + pLayout->addWidget(m_pSelectFont); + + m_pLabel = new QLabel( "", this ); + m_pLabel->setFont( m_font ); + m_pLabel->setMinimumWidth(200); + m_pLabel->setText( "The quick brown fox jumps over the river\n" + "but the little red hen escapes with a shiver.\n" + ":-)"); + pLayout->addWidget(m_pLabel); +} + +QFont KFontChooser::font() +{ + return m_font;//QFont("courier",10); +} + +void KFontChooser::setFont( const QFont& font, bool ) +{ + m_font = font; + m_pLabel->setFont( m_font ); + //update(); +} + +void KFontChooser::slotSelectFont() +{ + for(;;) + { + bool bOk; + m_font = QFontDialog::getFont(&bOk, m_font ); + m_pLabel->setFont( m_font ); + QFontMetrics fm(m_font); + + // Variable width font. + if ( fm.width('W')!=fm.width('i') ) + { + int result = KMessageBox::warningYesNo(m_pParent, i18n( + "You selected a variable width font.\n\n" + "Because this program doesn't handle variable width fonts\n" + "correctly, you might experience problems while editing.\n\n" + "Do you want to continue or do you want to select another font."), + i18n("Incompatible font."), + i18n("Continue at my own risk"), i18n("Select another font")); + if (result==KMessageBox::Yes) + return; + } + else + return; + } +} + + +KColorButton::KColorButton(QWidget* parent) +: QPushButton(parent) +{ + connect( this, SIGNAL(clicked()), this, SLOT(slotClicked())); +} + +QColor KColorButton::color() +{ + return m_color; +} + +void KColorButton::setColor( const QColor& color ) +{ + m_color = color; + update(); +} + +void KColorButton::paintEvent( QPaintEvent* e ) +{ + QPushButton::paintEvent(e); + QPainter p(this); + + int w = width(); + int h = height(); + p.fillRect( 10, 5, w-20, h-10, m_color ); + p.drawRect( 10, 5, w-20, h-10 ); +} + +void KColorButton::slotClicked() +{ + // Under Windows ChooseColor() should be used. (Nicer if few colors exist.) + QColor c = QColorDialog::getColor ( m_color, this ); + if ( c.isValid() ) m_color = c; + update(); +} + +KPrinter::KPrinter() +{ +} +QList KPrinter::pageList() +{ + QList vl; + int to = toPage(); + for(int i=fromPage(); i<=to; ++i) + { + vl.push_back(i); + } + return vl; +} +void KPrinter::setCurrentPage(int) +{ +} +void KPrinter::setPageSelection(e_PageSelection) +{ +} + + +QPixmap KIconLoader::loadIcon( const QString&, int ) +{ + return QPixmap(); +} + +KAboutData::KAboutData( const QString& /*name*/, const QString& appName, const QString& version, + const QString& description, int, + const QString& copyright, int, const QString& homepage, const QString& email) +{ + s_copyright = copyright; + s_email = email; + s_appName = appName; + s_description = description; + s_version = version; + s_homepage = homepage; +} + +KAboutData::KAboutData( const QString& /*name*/, const QString& /*appName*/, const QString& /*version*/ ) +{ +} + +void KAboutData::addAuthor(const char* name, const char* task, const char* email, const char* weblink) +{ + m_authorList.push_back( AboutDataEntry( name, task, email, weblink) ); +} + +void KAboutData::addCredit(const char* name, const char* task, const char* email, const char* weblink) +{ + m_creditList.push_back( AboutDataEntry( name, task, email, weblink) ); +} + +/* Option structure: e.g.: + { "m", 0, 0 }, + { "merge", I18N_NOOP("Automatically merge the input."), 0 }, + { "o", 0, 0 }, + { "output file", I18N_NOOP("Output file. Implies -m. E.g.: -o newfile.txt"), 0 }, + { "+[File1]", I18N_NOOP("file1 to open (base)"), 0 }, + { "+[File2]", I18N_NOOP("file2 to open"), 0 }, + { "+[File3]", I18N_NOOP("file3 to open"), 0 }, +*/ +//////////////// +static KCmdLineArgs s_cmdLineArgs; +static int s_argc; +static char** s_argv; +static KCmdLineOptions* s_pOptions; + +static std::vector s_vOption; +static std::vector s_vArg; + +KCmdLineArgs* KCmdLineArgs::parsedArgs() // static +{ + return &s_cmdLineArgs; +} + +void KCmdLineArgs::init( int argc, char**argv, KAboutData* pAboutData ) // static +{ + s_argc = argc; + s_argv = argv; + s_pAboutData = pAboutData; +} + +void KCmdLineArgs::addCmdLineOptions( KCmdLineOptions* options ) // static +{ + s_pOptions = options; +} + +int KCmdLineArgs::count() +{ + return s_vArg.size(); +} + +QString KCmdLineArgs::arg(int idx) +{ + return QString::fromLocal8Bit( s_vArg[idx] ); +} + +void KCmdLineArgs::clear() +{ +} + +QString KCmdLineArgs::getOption( const QString& s ) +{ + // Find the option + int j=0; + for( j=0; j<(int)s_vOption.size(); ++j ) + { + const char* optName = s_pOptions[j].name; + const char* pos = strchr( optName,' ' ); + int len = pos==0 ? strlen( optName ) : pos - optName; + + if( s == QString::fromLatin1( optName, len ) ) + { + return s_vOption[j].isEmpty() ? QString() : s_vOption[j].last(); + } + } + assert(false); + return QString(); +} + +QCStringList KCmdLineArgs::getOptionList( const QString& s ) +{ + // Find the option + int j=0; + for( j=0; j<(int)s_vOption.size(); ++j ) + { + const char* optName = s_pOptions[j].name; + const char* pos = strchr( optName,' ' ); + int len = pos==0 ? strlen( optName ) : pos - optName; + + if( s == QString::fromLatin1( optName, len) ) + { + return s_vOption[j]; + } + } + + assert(false); + return QCStringList(); +} + +bool KCmdLineArgs::isSet(const QString& s) +{ + // Find the option + int j=0; + for( j=0; j<(int)s_vOption.size(); ++j ) + { + const char* optName = s_pOptions[j].name; + if( s == QString( optName ) ) + { + return ! s_vOption[j].isEmpty(); + } + } + assert(false); + return false; +} + +/////////////////// +KApplication* kapp; + +KApplication::KApplication() +: QApplication( s_argc,s_argv ) +{ + kapp = this; + + int nofOptions=0; + int nofArgs=0; + int i=0; + while( s_pOptions[i].name != 0 ) + { + if ( s_pOptions[i].name[0]=='[' ) + nofArgs++; + else + nofOptions++; + + ++i; + } + + // First find the option "-config" or "--config" to allow loading of options + QString configFileName; + for( i=1; i0 && ( s_argv[i][1]=='-' && len2-2==len && memcmp( &s_argv[i][2], optName, len )==0 || + len2-1==len && memcmp( &s_argv[i][1], optName, len )==0 )) + { + if (s_pOptions[j].description == 0) // alias, because without description. + { + ++j; + optName = s_pOptions[j].name; + pos = strchr( optName,' ' ); + } + if (pos!=0){ ++i; s_vOption[j].append(s_argv[i]); } //use param + else { s_vOption[j].append("1"); } //set state + break; + } + } + if (j==nofOptions) + { + QString s; + 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"; + + s += "KDiff3-Usage when starting via commandline: \n"; + s += "- Comparing 2 files:\t\tkdiff3 file1 file2\n"; + s += "- Merging 2 files: \t\tkdiff3 file1 file2 -o outputfile\n"; + s += "- Comparing 3 files:\t\tkdiff3 file1 file2 file3\n"; + s += "- Merging 3 files: \t\tkdiff3 file1 file2 file3 -o outputfile\n"; + s += " Note that file1 will be treated as base of file2 and file3.\n"; + s += "\n"; + s += "If you start without arguments, then a dialog will appear\n"; + s += "where you can select your files via a filebrowser.\n"; + s += "\n"; + + s += "Options:\n"; + + j=0; + int pos=s.length(); + for( j=0; j1 ) s += "-"; + } + s += s_pOptions[j].name; + s += QString().fill(' ', minMaxLimiter( 20 - ((int)s.length()-pos), 3, 20 ) ); + s += s_pOptions[j].description; + s +="\n"; + pos=s.length(); + } + else + { + s += "-"; + if ( strlen(s_pOptions[j].name)>1 ) s += "-"; + s += s_pOptions[j].name; + s += ", "; + } + } + + s += "\n"+i18n("For more documentation, see the help-menu or the subdirectory doc.")+"\n"; +#ifdef _WIN32 + // A windows program has no console + if ( 0==QMessageBox::information(0, i18n("KDiff3-Usage"), s, i18n("Ignore"),i18n("Exit") ) ) + continue; +#else + std::cerr << s.toLatin1().constData() << std::endl; +#endif + + ::exit(-1); + } + } + else + s_vArg.push_back( s_argv[i] ); + } +} + +KConfig* KApplication::config() +{ + return &m_config; +} + +bool KApplication::isRestored() +{ + return false; +} + +KApplication* KApplication::kApplication() +{ + return kapp; +} + +KIconLoader* KApplication::iconLoader() +{ + return &m_iconLoader; +} + + +namespace KIO +{ + SimpleJob* mkdir( KURL ){return 0;} + SimpleJob* rmdir( KURL ){return 0;} + SimpleJob* file_delete( KURL, bool ){return 0;} + FileCopyJob* file_move( KURL, KURL, int, bool, bool, bool ) {return 0;} + FileCopyJob* file_copy( KURL, KURL, int, bool, bool, bool ) {return 0;} + CopyJob* link( KURL, KURL, bool ) {return 0;} + ListJob* listRecursive( KURL, bool, bool ){return 0;} + ListJob* listDir( KURL, bool, bool ){return 0;} + StatJob* stat( KURL, bool, int, bool ){return 0;} + TransferJob* get( KURL, bool, bool ){return (TransferJob*)0;} + TransferJob* put( KURL, int, bool, bool, bool ){return (TransferJob*)0;} +}; + +KActionCollection* KParts::Part::actionCollection() +{ + return 0; +} + +KApplication* KParts::Part::instance() +{ + return kapp; +} + + +KLibLoader* KLibLoader::self() +{ + static KLibLoader ll; + return ≪ +} + +extern "C" void* init_libkdiff3part(); +KLibFactory* KLibLoader::factory(QString const&) +{ + return (KLibFactory*) init_libkdiff3part(); +} + +QObject* KLibFactory::create(QObject* pParent, const QString& name, const QString& classname ) +{ + KParts::Factory* f = dynamic_cast(this); + if (f!=0) + return f->createPartObject( (QWidget*)pParent, name.toAscii(), + pParent, name.toAscii(), + classname.toAscii(), QStringList() ); + else + return 0; +} + + + + +#include "kreplacements.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kreplacements.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kreplacements.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,501 @@ +/*************************************************************************** + kreplacements.h - description + ------------------- + begin : Sat Aug 3 2002 + copyright : (C) 2002-2006 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KREPLACEMENTS_H +#define KREPLACEMENTS_H + +#include "common.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +class Q3CString; +class QTabWidget; +class QLabel; + +#include +#include + +QString getTranslationDir(); + +class KMainWindow; + +class KURL +{ +public: + KURL(){} + KURL(const QString& s){ m_s = s; } + static KURL fromPathOrURL( const QString& s ){ return KURL(s); } + QString url() const { return m_s; } + bool isEmpty() const { return m_s.isEmpty(); } + QString prettyURL() const { return m_s; } + bool isLocalFile() const { return true; } + bool isValid() const { return true; } + QString path() const { return m_s; } + void setPath( const QString& s ){ m_s=s; } + QString fileName() const { return m_s; } // not really needed + void addPath( const QString& s ){ m_s += "/" + s; } +private: + QString m_s; +}; + +class KMessageBox +{ +public: + static void error( QWidget* parent, const QString& text, const QString& caption=QString() ); + static int warningContinueCancel( QWidget* parent, const QString& text, const QString& caption=QString(), + const QString& button1=QString("Continue") ); + static void sorry( QWidget* parent, const QString& text, const QString& caption=QString() ); + static void information( QWidget* parent, const QString& text, const QString& caption=QString() ); + static int warningYesNo( QWidget* parent, const QString& text, const QString& caption, + const QString& button1, const QString& button2 ); + static int warningYesNoCancel( + QWidget* parent, const QString& text, const QString& caption, + const QString& button1, const QString& button2 ); + + enum {Cancel=-1, No=0, Yes=1, Continue=1}; +}; + +#define i18n(x) QObject::tr(x) +#define I18N_NOOP(x) x +#define RESTORE(x) +#define _UNLOAD(x) + +typedef QMenu KPopupMenu; + +class KDialogBase : public QDialog +{ + Q_OBJECT + QTabWidget* m_pTabWidget; +public: + KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, + bool /*modal*/, bool ); + ~KDialogBase(); + + void incInitialSize ( const QSize& ); + void setHelp(const QString& helpfilename, const QString& ); + enum {IconList, Help, Default, Apply, Ok, Cancel }; + + int BarIcon(const QString& iconName, int ); + + QFrame* addPage( const QString& name, const QString& info, int ); + int spacingHint(); + + virtual void accept(); +signals: + void applyClicked(); + +protected slots: + virtual void slotOk( void ); + virtual void slotApply( void ); + virtual void slotHelp( void ); + virtual void slotCancel( void ); + virtual void slotDefault( void ); +}; + +class KFileDialog //: public QFileDialog +{ +public: + static KURL getSaveURL( const QString &startDir=QString::null, + const QString &filter=QString::null, + QWidget *parent=0, const QString &caption=QString::null); + static KURL getOpenURL( const QString & startDir = QString::null, + const QString & filter = QString::null, + QWidget * parent = 0, + const QString & caption = QString::null ); + static KURL getExistingURL( const QString & startDir = QString::null, + QWidget * parent = 0, + const QString & caption = QString::null ); + static QString getSaveFileName (const QString &startDir=QString::null, + const QString &filter=QString::null, + QWidget *parent=0, + const QString &caption=QString::null); +}; + +typedef QStatusBar KStatusBar; + +class KToolBar : public QToolBar +{ +public: + KToolBar(QMainWindow* parent); + + enum BarPosition {Top, Bottom, Left, Right}; + BarPosition barPos(); + void setBarPos(BarPosition); +private: + QMainWindow* m_pMainWindow; +}; + +class KActionCollection +{ +public: + KMainWindow* m_pMainWindow; + KActionCollection( KMainWindow* p){ m_pMainWindow=p; } +}; + +class KKeyDialog +{ +public: + static void configure(void*, QWidget*){} + static void configureKeys(KActionCollection*, const QString&){} + static void configure(KActionCollection*, const QString&){} +}; + +namespace KParts +{ + class ReadWritePart; +} + +class KMainWindow : public QMainWindow +{ + Q_OBJECT +private: + KActionCollection m_actionCollection; +protected: + virtual bool queryClose() = 0; + virtual bool queryExit() = 0; +public: + QMenu* fileMenu; + QMenu* editMenu; + QMenu* directoryMenu; + QMenu* dirCurrentItemMenu; + QMenu* dirCurrentSyncItemMenu; + QMenu* movementMenu; + QMenu* mergeMenu; + QMenu* diffMenu; + QMenu* windowsMenu; + QMenu* settingsMenu; + QMenu* helpMenu; + + KToolBar* m_pToolBar; + + KMainWindow( QWidget* parent, const char* name ); + KToolBar* toolBar(const QString& s = QString::null); + KActionCollection* actionCollection(); + void createGUI(); + void createGUI(KParts::ReadWritePart*){createGUI();} + + QList* memberList; +public slots: + void slotHelp(); + void slotAbout(); +}; + +class KConfig : public ValueMap +{ + QString m_fileName; +public: + KConfig(); + ~KConfig(); + void readConfigFile(const QString& configFileName); + + void setGroup(const QString&); +}; + +class KAction : public QAction +{ + Q_OBJECT +public: + 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(QMenu*); +}; + +class KToggleAction : public KAction +{ +public: + 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 QIcon& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); + void setChecked(bool); +}; + + +class KStdAction +{ +public: + static KAction* open( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* save( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* saveAs( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* print( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* quit( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* cut( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* copy( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* paste( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* selectAll( QWidget* parent, const char* slot, KActionCollection* ); + static KToggleAction* showToolbar( QWidget* parent, const char* slot, KActionCollection* ); + static KToggleAction* showStatusbar( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* preferences( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* about( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* aboutQt( KActionCollection* ); + static KAction* help( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* find( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* findNext( QWidget* parent, const char* slot, KActionCollection* ); + static KAction* keyBindings( QWidget* parent, const char* slot, KActionCollection* ); +}; + +class KIcon +{ +public: + enum {SizeMedium,Small}; +}; + +class KFontChooser : public QWidget +{ + Q_OBJECT + QFont m_font; + QPushButton* m_pSelectFont; + QLabel* m_pLabel; + QWidget* m_pParent; +public: + KFontChooser( QWidget* pParent, const QString& name, bool, const QStringList&, bool, int ); + QFont font(); + void setFont( const QFont&, bool ); +private slots: + void slotSelectFont(); +}; + +class KColorButton : public QPushButton +{ + Q_OBJECT + QColor m_color; +public: + KColorButton(QWidget* parent); + QColor color(); + void setColor(const QColor&); + virtual void paintEvent(QPaintEvent* e); +public slots: + void slotClicked(); +}; + +class KPrinter : public QPrinter +{ +public: + KPrinter(); + enum e_PageSelection {ApplicationSide}; + QList pageList(); + void setCurrentPage(int); + void setPageSelection(e_PageSelection); +}; + +class KStandardDirs +{ +public: + QString findResource(const QString& resource, const QString& appName); +}; + +struct KCmdLineOptions +{ + const char* name; + const char* description; + int def; +}; + +#define KCmdLineLastOption {0,0,0} + +class KAboutData +{ +public: + KAboutData( const QString& name, const QString& appName, const QString& version, + const QString& description, int licence, + const QString& copyright, int w, const QString& homepage, const QString& email); + KAboutData( const QString& name, const QString& appName, const QString& version ); + void addAuthor(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); + void addCredit(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); + enum { License_GPL }; + + struct AboutDataEntry + { + AboutDataEntry(const QString& name, const QString& task, const QString& email, const QString& weblink) + : m_name(name), m_task(task), m_email(email), m_weblink(weblink) + {} + QString m_name; + QString m_task; + QString m_email; + QString m_weblink; + }; + + std::list m_authorList; + std::list m_creditList; +}; + +typedef QList QCStringList; + +class KCmdLineArgs +{ +public: + static KCmdLineArgs* parsedArgs(); + static void init( int argc, char**argv, KAboutData* ); + static void addCmdLineOptions( KCmdLineOptions* options ); // Add our own options. + + int count(); + QString arg(int); + KURL url(int i){ return KURL(arg(i)); } + void clear(); + QString getOption(const QString&); + QCStringList getOptionList( const QString& ); + bool isSet(const QString&); +}; + +class KIconLoader +{ +public: + QPixmap loadIcon(const QString& name, int); +}; + +class KApplication : public QApplication +{ + KConfig m_config; + KIconLoader m_iconLoader; +public: + KApplication(); + static KApplication* kApplication(); + KIconLoader* iconLoader(); + KConfig* config(); + bool isRestored(); +}; + +extern KApplication* kapp; + +class KLibFactory : public QObject +{ + Q_OBJECT +public: + QObject* create(QObject*,const QString&,const QString&); +}; + +class KLibLoader +{ +public: + static KLibLoader* self(); + KLibFactory* factory(const QString&); +}; + +class KEditToolbar : public QDialog +{ +public: + KEditToolbar( int ){} +}; + +class KGlobal +{ +public: + static KConfig* config() { return 0; } +}; + +namespace KIO +{ + enum UDSEntry {}; + typedef QList UDSEntryList; + class Job : public QObject + { + public: + void kill(bool){} + bool error() {return false;} + void showErrorDialog( QWidget* ) {} + }; + class SimpleJob : public Job {}; + SimpleJob* mkdir( KURL ); + SimpleJob* rmdir( KURL ); + SimpleJob* file_delete( KURL, bool ); + class FileCopyJob : public Job {}; + FileCopyJob* file_move( KURL, KURL, int, bool, bool, bool ); + FileCopyJob* file_copy( KURL, KURL, int, bool, bool, bool ); + class CopyJob : public Job {}; + CopyJob* link( KURL, KURL, bool ); + class ListJob : public Job {}; + ListJob* listRecursive( KURL, bool, bool ); + ListJob* listDir( KURL, bool, bool ); + class StatJob : public Job { + public: UDSEntry statResult(){ return (UDSEntry)0; } + }; + StatJob* stat( KURL, bool, int, bool ); + class TransferJob : public Job {}; + TransferJob* get( KURL, bool, bool ); + TransferJob* put( KURL, int, bool, bool, bool ); +}; + +typedef QProgressBar KProgress; + +class KInstance : public QObject +{ +public: + KInstance(KAboutData*){} +}; + +namespace KParts +{ + class MainWindow : public KMainWindow + { + public: + MainWindow( QWidget* parent, const char* name ) : KMainWindow(parent,name) {} + void setXMLFile(const QString&){} + void setAutoSaveSettings(){} + void saveMainWindowSettings(KConfig*){} + void applyMainWindowSettings(KConfig*){} + int factory(){return 0;} + }; + + class Part : public QObject + { + public: + KActionCollection* actionCollection(); + KApplication* instance(); + void setWidget( QWidget* w ){ m_pWidget=w; } + QWidget* widget(){return m_pWidget;} + void setXMLFile(const QString&){} + private: + QWidget* m_pWidget; + }; + + class ReadOnlyPart : public Part + { + public: + ReadOnlyPart(){} + ReadOnlyPart(QObject*,const QString&){} + void setInstance( KInstance* ){} + QString m_file; + }; + + class ReadWritePart : public ReadOnlyPart + { + public: + ReadWritePart(QObject*,const Q3CString&){} + void setReadWrite(bool){} + }; + + class Factory : public KLibFactory + { + Q_OBJECT + public: + virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args )=0; + }; +}; +#endif + + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kstandarddirs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kstandarddirs.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kstatusbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kstatusbar.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kstdaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kstdaction.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/ktempfile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/ktempfile.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kunload.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kunload.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kurl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kurl.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/kreplacements/kurldrag.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/kreplacements/kurldrag.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#include "kreplacements.h" + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/lo16-app-kdiff3.png Binary file kdiff3/src-QT4/lo16-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/lo32-app-kdiff3.png Binary file kdiff3/src-QT4/lo32-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/main.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,231 @@ +/*************************************************************************** + main.cpp - Where everything starts. + ------------------- + begin : Don Jul 11 12:31:29 CEST 2002 + copyright : (C) 2002-2006 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include "kdiff3_shell.h" +#include +#include "version.h" +#include +#include +#include +#include +#include +#include + +#ifdef KREPLACEMENTS_H +#include "optiondialog.h" +#endif +#include "common.h" + +static const char *description = + I18N_NOOP("Tool for Comparison and Merge of Files and Directories"); + +static KCmdLineOptions options[] = +{ + { "m", 0, 0 }, + { "merge", I18N_NOOP("Merge the input."), 0 }, + { "b", 0, 0 }, + { "base file", I18N_NOOP("Explicit base file. For compatibility with certain tools."), 0 }, + { "o", 0, 0 }, + { "output file", I18N_NOOP("Output file. Implies -m. E.g.: -o newfile.txt"), 0 }, + { "out file", I18N_NOOP("Output file, again. (For compatibility with certain tools.)"), 0 }, + { "auto", I18N_NOOP("No GUI if all conflicts are auto-solvable. (Needs -o file)"), 0 }, + { "qall", I18N_NOOP("Don't solve conflicts automatically. (For compatibility...)"), 0 }, + { "L1 alias1", I18N_NOOP("Visible name replacement for input file 1 (base)."), 0 }, + { "L2 alias2", I18N_NOOP("Visible name replacement for input file 2."), 0 }, + { "L3 alias3", I18N_NOOP("Visible name replacement for input file 3."), 0 }, + { "L", 0, 0 }, + { "fname alias", I18N_NOOP("Alternative visible name replacement. Supply this once for every input."), 0 }, + { "cs string", I18N_NOOP("Override a config setting. Use once for every setting. E.g.: --cs \"AutoAdvance=1\""), 0 }, + { "confighelp", I18N_NOOP("Show list of config settings and current values."), 0 }, + { "config file", I18N_NOOP("Use a different config file."), 0 } +}; +static KCmdLineOptions options2[] = +{ + { "+[File1]", I18N_NOOP("file1 to open (base, if not specified via --base)"), 0 }, + { "+[File2]", I18N_NOOP("file2 to open"), 0 }, + { "+[File3]", I18N_NOOP("file3 to open"), 0 } +}; + + +void initialiseCmdLineArgs(std::vector& vOptions, QStringList& ignorableOptions) +{ + vOptions.insert( vOptions.end(), options, (KCmdLineOptions*)((char*)options+sizeof(options))); + QString configFileName = KStandardDirs().findResource("config","kdiff3rc"); + QFile configFile( configFileName ); + if ( configFile.open( QIODevice::ReadOnly ) ) + { + QTextStream ts( &configFile ); + while(!ts.atEnd()) + { + QString line = ts.readLine(); + if ( line.startsWith("IgnorableCmdLineOptions=") ) + { + int pos = line.indexOf('='); + if (pos>=0) + { + QString s = line.mid(pos+1); + QStringList sl = s.split( '|' ); + if (!sl.isEmpty()) + { + ignorableOptions = sl.front().split( ';' ); + for (QStringList::iterator i=ignorableOptions.begin(); i!=ignorableOptions.end(); ++i) + { + KCmdLineOptions ignoreOption; + (*i).remove('-'); + if (!(*i).isEmpty()) + { + ignoreOption.name = (new QByteArray( (*i).toLatin1() ))->constData(); + ignoreOption.description = I18N_NOOP("Ignored. (User defined.)"); + ignoreOption.def = 0; + vOptions.push_back(ignoreOption); + } + } + } + } + break; + } + } + } + vOptions.insert(vOptions.end(),options2,(KCmdLineOptions*)((char*)options2+sizeof(options2))); + + KCmdLineOptions last = KCmdLineLastOption; + vOptions.push_back(last); + KCmdLineArgs::addCmdLineOptions( &vOptions[0] ); // Add our own options. +} + + +#ifdef _WIN32 +#include +// This command checks the comm +static bool isOptionUsed(const QString& s, int argc, char* argv[]) +{ + for(int j=0; j vOptions; + QStringList ignorableOptions; + initialiseCmdLineArgs(vOptions, ignorableOptions); + + KApplication app; + +#ifdef KREPLACEMENTS_H + QString locale; + + locale = app.config()->readEntry("Language", "Auto"); + int spacePos = locale.indexOf(' '); + if (spacePos>0) locale = locale.left(spacePos); + QTranslator kdiff3Translator( 0 ); + QTranslator qtTranslator( 0 ); + if (locale != "en_orig") + { + if ( locale == "Auto" || locale.isEmpty() ) + locale = locale = QLocale::system().name().left(2); + + QString translationDir = getTranslationDir(); + kdiff3Translator.load( QString("kdiff3_")+locale, translationDir ); + app.installTranslator( &kdiff3Translator ); + + qtTranslator.load( QString("qt_")+locale, translationDir ); + app.installTranslator( &qtTranslator ); + } +#endif + + if (app.isRestored()) + { + RESTORE(KDiff3Shell); + } + else + { + new KDiff3Shell(); + } + + int retVal = app.exec(); + return retVal; +} + +// Suppress warning with --enable-final +#undef VERSION diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/merger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/merger.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,87 @@ +/*************************************************************************** + merger.cpp - description + ------------------- + begin : Sun Mar 24 2002 + copyright : (C) 2002-2004 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "merger.h" +#include +#include +#include + +Merger::Merger( const DiffList* pDiffListAB, const DiffList* pDiffListCA ) +: md1( pDiffListAB, 0 ), md2( pDiffListCA, 1 ) +{ +} + + +Merger::MergeData::MergeData( const DiffList* p, int i ) +: d(0,0,0) +{ + idx=i; + pDiffList = p; + if ( p!=0 ) + { + it=p->begin(); + update(); + } +} + +bool Merger::MergeData::eq() +{ + return pDiffList==0 || d.nofEquals > 0; +} + +bool Merger::MergeData::isEnd() +{ + return ( pDiffList==0 || ( it==pDiffList->end() && d.nofEquals==0 && + ( idx == 0 ? d.diff1==0 : d.diff2==0 ) + ) ); +} + +void Merger::MergeData::update() +{ + if ( d.nofEquals > 0 ) + --d.nofEquals; + else if ( idx==0 && d.diff1 > 0 ) + --d.diff1; + else if ( idx==1 && d.diff2 > 0 ) + --d.diff2; + + while( d.nofEquals == 0 && (idx==0 && d.diff1 == 0 || idx==1 && d.diff2 == 0) + && pDiffList!=0 && it != pDiffList->end() ) + { + d = *it; + ++it; + } +} + +void Merger::next() +{ + md1.update(); + md2.update(); +} + +int Merger::whatChanged() +{ + int changed = 0; + changed |= md1.eq() ? 0 : 1; + changed |= md2.eq() ? 0 : 2; + return changed; +} + +bool Merger::isEndReached() +{ + return md1.isEnd() && md2.isEnd(); +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/merger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/merger.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,61 @@ +/*************************************************************************** + merger.h - description + ------------------- + begin : Sun Mar 24 2002 + copyright : (C) 2002-2004 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef MERGER_H +#define MERGER_H + +#include "diff.h" + + +class Merger +{ +public: + + Merger( const DiffList* pDiffList1, const DiffList* pDiffList2 ); + + /** Go one step. */ + void next(); + + /** Information about what changed. Can be used for coloring. + The return value is 0 if nothing changed here, + bit 1 is set if a difference from pDiffList1 was detected, + bit 2 is set if a difference from pDiffList2 was detected. + */ + int whatChanged(); + + /** End of both diff lists reached. */ + bool isEndReached(); +private: + + struct MergeData + { + DiffList::const_iterator it; + const DiffList* pDiffList; + Diff d; + int idx; + + MergeData( const DiffList* p, int i ); + bool eq(); + void update(); + bool isEnd(); + }; + + MergeData md1; + MergeData md2; +}; + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/mergeresultwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/mergeresultwindow.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,3176 @@ +/*************************************************************************** + mergeresultwindow.cpp - description + ------------------- + begin : Sun Apr 14 2002 + copyright : (C) 2002-2006 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "mergeresultwindow.h" +#include "optiondialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +int g_bAutoSolve = true; + +#undef leftInfoWidth +#define leftInfoWidth 3 + +MergeResultWindow::MergeResultWindow( + QWidget* pParent, + OptionDialog* pOptionDialog, + QStatusBar* pStatusBar + ) +: QWidget( pParent ) +{ + setObjectName( "MergeResultWindow" ); + setFocusPolicy( Qt::ClickFocus ); + + m_firstLine = 0; + m_firstColumn = 0; + m_nofColumns = 0; + m_nofLines = 0; + m_totalSize = 0; + m_bMyUpdate = false; + m_bInsertMode = true; + m_scrollDeltaX = 0; + m_scrollDeltaY = 0; + m_bModified = false; + m_eOverviewMode=Overview::eOMNormal; + + m_pldA = 0; + m_pldB = 0; + m_pldC = 0; + m_sizeA = 0; + m_sizeB = 0; + m_sizeC = 0; + + m_pDiff3LineList = 0; + m_pTotalDiffStatus = 0; + m_pStatusBar = pStatusBar; + + m_pOptionDialog = pOptionDialog; + m_bPaintingAllowed = false; + m_delayedDrawTimer = 0; + + m_cursorXPos=0; + m_cursorOldXPos=0; + m_cursorYPos=0; + m_bCursorOn = true; + m_bCursorUpdate = false; + connect( &m_cursorTimer, SIGNAL(timeout()), this, SLOT( slotCursorUpdate() ) ); + m_cursorTimer.setSingleShot(true); + m_cursorTimer.start( 500 /*ms*/ ); + m_selection.reset(); + + setMinimumSize( QSize(20,20) ); + setFont( m_pOptionDialog->m_font ); +} + +void MergeResultWindow::init( + const LineData* pLineDataA, int sizeA, + const LineData* pLineDataB, int sizeB, + const LineData* pLineDataC, int sizeC, + const Diff3LineList* pDiff3LineList, + TotalDiffStatus* pTotalDiffStatus + ) +{ + m_firstLine = 0; + m_firstColumn = 0; + m_nofColumns = 0; + m_nofLines = 0; + m_bMyUpdate = false; + m_bInsertMode = true; + m_scrollDeltaX = 0; + m_scrollDeltaY = 0; + setModified( false ); + + m_pldA = pLineDataA; + m_pldB = pLineDataB; + m_pldC = pLineDataC; + m_sizeA = sizeA; + m_sizeB = sizeB; + m_sizeC = sizeC; + + m_pDiff3LineList = pDiff3LineList; + m_pTotalDiffStatus = pTotalDiffStatus; + + m_selection.reset(); + m_cursorXPos=0; + m_cursorOldXPos=0; + m_cursorYPos=0; + + merge( g_bAutoSolve, -1 ); + g_bAutoSolve = true; + update(); + updateSourceMask(); + + int wsc; + int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); + if (m_pStatusBar) + m_pStatusBar->showMessage( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") + .arg(nofUnsolved).arg(wsc) ); +} + +void MergeResultWindow::reset() +{ + m_pDiff3LineList = 0; + m_pTotalDiffStatus = 0; + m_pldA = 0; + m_pldB = 0; + m_pldC = 0; +} + +// Calculate the merge information for the given Diff3Line. +// Results will be stored in mergeDetails, bConflict, bLineRemoved and src. +void mergeOneLine( + const Diff3Line& d, e_MergeDetails& mergeDetails, bool& bConflict, + bool& bLineRemoved, int& src, bool bTwoInputs + ) +{ + mergeDetails = eDefault; + bConflict = false; + bLineRemoved = false; + src = 0; + + if ( bTwoInputs ) // Only two input files + { + if ( d.lineA!=-1 && d.lineB!=-1 ) + { + if ( d.pFineAB == 0 ) + { + mergeDetails = eNoChange; src = A; + } + else + { + mergeDetails = eBChanged; bConflict = true; + } + } + else + { + if ( d.lineA!=-1 && d.lineB==-1 ) + { + mergeDetails = eBDeleted; bConflict = true; + } + else if ( d.lineA==-1 && d.lineB!=-1 ) + { + mergeDetails = eBDeleted; bConflict = true; + } + } + return; + } + + // A is base. + if ( d.lineA!=-1 && d.lineB!=-1 && d.lineC!=-1 ) + { + if ( d.pFineAB == 0 && d.pFineBC == 0 && d.pFineCA == 0) + { + mergeDetails = eNoChange; src = A; + } + else if( d.pFineAB == 0 && d.pFineBC != 0 && d.pFineCA != 0 ) + { + mergeDetails = eCChanged; src = C; + } + else if( d.pFineAB != 0 && d.pFineBC != 0 && d.pFineCA == 0 ) + { + mergeDetails = eBChanged; src = B; + } + else if( d.pFineAB != 0 && d.pFineBC == 0 && d.pFineCA != 0 ) + { + mergeDetails = eBCChangedAndEqual; src = C; + } + else if( d.pFineAB != 0 && d.pFineBC != 0 && d.pFineCA != 0 ) + { + mergeDetails = eBCChanged; bConflict = true; + } + else + assert(false); + } + else if ( d.lineA!=-1 && d.lineB!=-1 && d.lineC==-1 ) + { + if( d.pFineAB != 0 ) + { + mergeDetails = eBChanged_CDeleted; bConflict = true; + } + else + { + mergeDetails = eCDeleted; bLineRemoved = true; src = C; + } + } + else if ( d.lineA!=-1 && d.lineB==-1 && d.lineC!=-1 ) + { + if( d.pFineCA != 0 ) + { + mergeDetails = eCChanged_BDeleted; bConflict = true; + } + else + { + mergeDetails = eBDeleted; bLineRemoved = true; src = B; + } + } + else if ( d.lineA==-1 && d.lineB!=-1 && d.lineC!=-1 ) + { + if( d.pFineBC != 0 ) + { + mergeDetails = eBCAdded; bConflict = true; + } + else // B==C + { + mergeDetails = eBCAddedAndEqual; src = C; + } + } + else if ( d.lineA==-1 && d.lineB==-1 && d.lineC!= -1 ) + { + mergeDetails = eCAdded; src = C; + } + else if ( d.lineA==-1 && d.lineB!=-1 && d.lineC== -1 ) + { + mergeDetails = eBAdded; src = B; + } + else if ( d.lineA!=-1 && d.lineB==-1 && d.lineC==-1 ) + { + mergeDetails = eBCDeleted; bLineRemoved = true; src = C; + } + else + assert(false); +} + +bool MergeResultWindow::sameKindCheck( const MergeLine& ml1, const MergeLine& ml2 ) +{ + if ( ml1.bConflict && ml2.bConflict ) + { + // Both lines have conflicts: If one is only a white space conflict and + // the other one is a real conflict, then this line returns false. + return ml1.id3l->bAEqC == ml2.id3l->bAEqC && ml1.id3l->bAEqB == ml2.id3l->bAEqB; + } + else + return ( + !ml1.bConflict && !ml2.bConflict && ml1.bDelta && ml2.bDelta && ml1.srcSelect == ml2.srcSelect || + !ml1.bDelta && !ml2.bDelta + ); +} + +void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly, bool bWhiteSpaceOnly ) +{ + if ( !bConflictsOnly ) + { + if(m_bModified) + { + int result = KMessageBox::warningYesNo(this, + i18n("The output has been modified.\n" + "If you continue your changes will be lost."), + i18n("Warning"), i18n("C&ontinue"), i18n("&Cancel")); + if ( result==KMessageBox::No ) + return; + } + + m_mergeLineList.clear(); + m_totalSize = 0; + int lineIdx = 0; + Diff3LineList::const_iterator it; + for( it=m_pDiff3LineList->begin(); it!=m_pDiff3LineList->end(); ++it, ++lineIdx ) + { + const Diff3Line& d = *it; + + MergeLine ml; + bool bLineRemoved; + mergeOneLine( d, ml.mergeDetails, ml.bConflict, bLineRemoved, ml.srcSelect, m_pldC==0 ); + + // Automatic solving for only whitespace changes. + if ( ml.bConflict && + ( m_pldC==0 && (d.bAEqB || d.bWhiteLineA && d.bWhiteLineB) || + m_pldC!=0 && (d.bAEqB && d.bAEqC || d.bWhiteLineA && d.bWhiteLineB && d.bWhiteLineC ) ) ) + { + ml.bWhiteSpaceConflict = true; + } + + ml.d3lLineIdx = lineIdx; + ml.bDelta = ml.srcSelect != A; + ml.id3l = it; + ml.srcRangeLength = 1; + + MergeLine* back = m_mergeLineList.empty() ? 0 : &m_mergeLineList.back(); + + bool bSame = back!=0 && sameKindCheck( ml, *back ); + if( bSame ) + { + ++back->srcRangeLength; + if ( back->bWhiteSpaceConflict && !ml.bWhiteSpaceConflict ) + back->bWhiteSpaceConflict = false; + } + else + { + if (back!=0 && back->bWhiteSpaceConflict ) + { + if ( m_pldC==0 && m_pOptionDialog->m_whiteSpace2FileMergeDefault != 0 ) // Only two inputs + { + back->srcSelect = m_pOptionDialog->m_whiteSpace2FileMergeDefault; + back->bConflict = false; + } + else if ( m_pldC!=0 && m_pOptionDialog->m_whiteSpace3FileMergeDefault != 0 ) + { + back->srcSelect = m_pOptionDialog->m_whiteSpace3FileMergeDefault; + back->bConflict = false; + } + } + ml.mergeEditLineList.setTotalSizePtr(&m_totalSize); + m_mergeLineList.push_back( ml ); + } + + if ( ! ml.bConflict ) + { + MergeLine& tmpBack = m_mergeLineList.back(); + MergeEditLine mel(ml.id3l); + mel.setSource( ml.srcSelect, bLineRemoved ); + tmpBack.mergeEditLineList.push_back(mel); + } + else if ( back==0 || ! back->bConflict || !bSame ) + { + MergeLine& tmpBack = m_mergeLineList.back(); + MergeEditLine mel(ml.id3l); + mel.setConflict(); + tmpBack.mergeEditLineList.push_back(mel); + } + } + } + + if ( !bAutoSolve ) + { + // Change all auto selections + MergeLineList::iterator mlIt; + for( mlIt=m_mergeLineList.begin(); mlIt!=m_mergeLineList.end(); ++mlIt ) + { + MergeLine& ml = *mlIt; + bool bConflict = ml.mergeEditLineList.empty() || ml.mergeEditLineList.begin()->isConflict(); + if ( ml.bDelta && ( !bConflictsOnly || bConflict ) && (!bWhiteSpaceOnly || ml.bWhiteSpaceConflict )) + { + ml.mergeEditLineList.clear(); + if ( defaultSelector==-1 && ml.bDelta ) + { + MergeEditLine mel(ml.id3l);; + mel.setConflict(); + ml.bConflict = true; + ml.mergeEditLineList.push_back(mel); + } + else + { + Diff3LineList::const_iterator d3llit=ml.id3l; + int j; + + for( j=0; jlineA : + defaultSelector==2 ? d3llit->lineB : + defaultSelector==3 ? d3llit->lineC : -1; + + if ( srcLine != -1 ) + { + ml.mergeEditLineList.push_back(mel); + } + + ++d3llit; + } + + if ( ml.mergeEditLineList.empty() ) // Make a line nevertheless + { + MergeEditLine mel(ml.id3l); + mel.setRemoved( defaultSelector ); + ml.mergeEditLineList.push_back(mel); + } + } + } + } + } + + MergeLineList::iterator mlIt; + for( mlIt=m_mergeLineList.begin(); mlIt!=m_mergeLineList.end(); ++mlIt ) + { + MergeLine& ml = *mlIt; + // Remove all lines that are empty, because no src lines are there. + + int oldSrcLine = -1; + int oldSrc = -1; + MergeEditLineList::iterator melIt; + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ) + { + MergeEditLine& mel = *melIt; + int melsrc = mel.src(); + + int srcLine = mel.isRemoved() ? -1 : + melsrc==1 ? mel.id3l()->lineA : + melsrc==2 ? mel.id3l()->lineB : + melsrc==3 ? mel.id3l()->lineC : -1; + + // At least one line remains because oldSrc != melsrc for first line in list + // Other empty lines will be removed + if ( srcLine == -1 && oldSrcLine==-1 && oldSrc == melsrc ) + melIt = ml.mergeEditLineList.erase( melIt ); + else + ++melIt; + + oldSrcLine = srcLine; + oldSrc = melsrc; + } + } + + if ( bAutoSolve && !bConflictsOnly ) + { + if ( m_pOptionDialog->m_bRunHistoryAutoMergeOnMergeStart ) + slotMergeHistory(); + if ( m_pOptionDialog->m_bRunRegExpAutoMergeOnMergeStart ) + slotRegExpAutoMerge(); + if ( m_pldC != 0 && ! doRelevantChangesExist() ) + emit noRelevantChangesDetected(); + } + + int nrOfSolvedConflicts = 0; + int nrOfUnsolvedConflicts = 0; + int nrOfWhiteSpaceConflicts = 0; + + MergeLineList::iterator i; + for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) + { + if ( i->bConflict ) + ++nrOfUnsolvedConflicts; + else if ( i->bDelta ) + ++nrOfSolvedConflicts; + + if ( i->bWhiteSpaceConflict ) + ++nrOfWhiteSpaceConflicts; + } + + m_pTotalDiffStatus->nofUnsolvedConflicts = nrOfUnsolvedConflicts; + m_pTotalDiffStatus->nofSolvedConflicts = nrOfSolvedConflicts; + m_pTotalDiffStatus->nofWhitespaceConflicts = nrOfWhiteSpaceConflicts; + + + m_cursorXPos=0; + m_cursorOldXPos=0; + m_cursorYPos=0; + //m_firstLine = 0; // Must not set line/column without scrolling there + //m_firstColumn = 0; + + setModified(false); + + m_currentMergeLineIt = m_mergeLineList.begin(); + slotGoTop(); + + updateAvailabilities(); + update(); +} + +void MergeResultWindow::setFirstLine(int firstLine) +{ + m_firstLine = max2(0,firstLine); + update(); +} + +void MergeResultWindow::setFirstColumn(int firstCol) +{ + m_firstColumn = max2(0,firstCol); + update(); +} + +int MergeResultWindow::getNofColumns() +{ + return m_nofColumns; +} + +int MergeResultWindow::getNofLines() +{ + return m_totalSize; +} + +int MergeResultWindow::getNofVisibleColumns() +{ + QFontMetrics fm = fontMetrics(); + return width()/fm.width('W')-4; +} + +int MergeResultWindow::getNofVisibleLines() +{ + QFontMetrics fm = fontMetrics(); + return (height()-3)/fm.height()-2; +} + +void MergeResultWindow::resizeEvent( QResizeEvent* e ) +{ + QWidget::resizeEvent(e); + emit resizeSignal(); +} + +Overview::e_OverviewMode MergeResultWindow::getOverviewMode() +{ + return m_eOverviewMode; +} + +void MergeResultWindow::setOverviewMode( Overview::e_OverviewMode eOverviewMode ) +{ + m_eOverviewMode = eOverviewMode; +} + +// Check whether we should ignore current delta when moving to next/previous delta +bool MergeResultWindow::checkOverviewIgnore(MergeLineList::iterator &i) +{ + if (m_eOverviewMode == Overview::eOMNormal) return false; + if (m_eOverviewMode == Overview::eOMAvsB) + return i->mergeDetails == eCAdded || i->mergeDetails == eCDeleted || i->mergeDetails == eCChanged; + if (m_eOverviewMode == Overview::eOMAvsC) + return i->mergeDetails == eBAdded || i->mergeDetails == eBDeleted || i->mergeDetails == eBChanged; + if (m_eOverviewMode == Overview::eOMBvsC) + return i->mergeDetails == eBCAddedAndEqual || i->mergeDetails == eBCDeleted || i->mergeDetails == eBCChangedAndEqual; + return false; +} + +// Go to prev/next delta/conflict or first/last delta. +void MergeResultWindow::go( e_Direction eDir, e_EndPoint eEndPoint ) +{ + assert( eDir==eUp || eDir==eDown ); + MergeLineList::iterator i = m_currentMergeLineIt; + bool bSkipWhiteConflicts = ! m_pOptionDialog->m_bShowWhiteSpace; + if( eEndPoint==eEnd ) + { + if (eDir==eUp) i = m_mergeLineList.begin(); // first mergeline + else i = --m_mergeLineList.end(); // last mergeline + + while ( i!=m_mergeLineList.end() && ! i->bDelta ) + { + if ( eDir==eUp ) ++i; // search downwards + else --i; // search upwards + } + } + else if ( eEndPoint == eDelta && i!=m_mergeLineList.end()) + { + do + { + if ( eDir==eUp ) --i; + else ++i; + } + while ( i!=m_mergeLineList.end() && ( i->bDelta == false || checkOverviewIgnore(i) || bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ); + } + else if ( eEndPoint == eConflict && i!=m_mergeLineList.end() ) + { + do + { + if ( eDir==eUp ) --i; + else ++i; + } + while ( i!=m_mergeLineList.end() && (i->bConflict == false || bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ); + } + else if ( i!=m_mergeLineList.end() && eEndPoint == eUnsolvedConflict ) + { + do + { + if ( eDir==eUp ) --i; + else ++i; + } + while ( i!=m_mergeLineList.end() && ! i->mergeEditLineList.begin()->isConflict() ); + } + + if ( isVisible() ) + setFocus(); + + setFastSelector( i ); +} + +bool MergeResultWindow::isDeltaAboveCurrent() +{ + bool bSkipWhiteConflicts = ! m_pOptionDialog->m_bShowWhiteSpace; + if (m_mergeLineList.empty()) return false; + MergeLineList::iterator i = m_currentMergeLineIt; + if (i == m_mergeLineList.begin()) return false; + do + { + --i; + if ( i->bDelta && !( bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ) return true; + } + while (i!=m_mergeLineList.begin()); + + return false; +} + +bool MergeResultWindow::isDeltaBelowCurrent() +{ + bool bSkipWhiteConflicts = ! m_pOptionDialog->m_bShowWhiteSpace; + if (m_mergeLineList.empty()) return false; + + MergeLineList::iterator i = m_currentMergeLineIt; + if (i!=m_mergeLineList.end()) + { + ++i; + for( ; i!=m_mergeLineList.end(); ++i ) + { + if ( i->bDelta && !( bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ) return true; + } + } + return false; +} + +bool MergeResultWindow::isConflictAboveCurrent() +{ + if (m_mergeLineList.empty()) return false; + MergeLineList::iterator i = m_currentMergeLineIt; + if (i == m_mergeLineList.begin()) return false; + + do + { + --i; + if ( i->bConflict ) return true; + } + while (i!=m_mergeLineList.begin()); + + return false; +} + +bool MergeResultWindow::isConflictBelowCurrent() +{ + MergeLineList::iterator i = m_currentMergeLineIt; + if (m_mergeLineList.empty()) return false; + + if (i!=m_mergeLineList.end()) + { + ++i; + for( ; i!=m_mergeLineList.end(); ++i ) + { + if ( i->bConflict ) return true; + } + } + return false; +} + +bool MergeResultWindow::isUnsolvedConflictAboveCurrent() +{ + if (m_mergeLineList.empty()) return false; + MergeLineList::iterator i = m_currentMergeLineIt; + if (i == m_mergeLineList.begin()) return false; + + do + { + --i; + if ( i->mergeEditLineList.begin()->isConflict() ) return true; + } + while (i!=m_mergeLineList.begin()); + + return false; +} + +bool MergeResultWindow::isUnsolvedConflictBelowCurrent() +{ + MergeLineList::iterator i = m_currentMergeLineIt; + if (m_mergeLineList.empty()) return false; + + if (i!=m_mergeLineList.end()) + { + ++i; + for( ; i!=m_mergeLineList.end(); ++i ) + { + if ( i->mergeEditLineList.begin()->isConflict() ) return true; + } + } + return false; +} + +void MergeResultWindow::slotGoTop() +{ + go( eUp, eEnd ); +} + +void MergeResultWindow::slotGoCurrent() +{ + setFastSelector( m_currentMergeLineIt ); +} + +void MergeResultWindow::slotGoBottom() +{ + go( eDown, eEnd ); +} + +void MergeResultWindow::slotGoPrevDelta() +{ + go( eUp, eDelta ); +} + +void MergeResultWindow::slotGoNextDelta() +{ + go( eDown, eDelta ); +} + +void MergeResultWindow::slotGoPrevConflict() +{ + go( eUp, eConflict ); +} + +void MergeResultWindow::slotGoNextConflict() +{ + go( eDown, eConflict ); +} + +void MergeResultWindow::slotGoPrevUnsolvedConflict() +{ + go( eUp, eUnsolvedConflict ); +} + +void MergeResultWindow::slotGoNextUnsolvedConflict() +{ + go( eDown, eUnsolvedConflict ); +} + +/** The line is given as a index in the Diff3LineList. + The function calculates the corresponding iterator. */ +void MergeResultWindow::slotSetFastSelectorLine( int line ) +{ + MergeLineList::iterator i; + for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) + { + if ( line>=i->d3lLineIdx && line < i->d3lLineIdx + i->srcRangeLength ) + { + //if ( i->bDelta ) + { + setFastSelector( i ); + } + break; + } + } +} + +int MergeResultWindow::getNrOfUnsolvedConflicts( int* pNrOfWhiteSpaceConflicts ) +{ + int nrOfUnsolvedConflicts = 0; + if (pNrOfWhiteSpaceConflicts!=0) + *pNrOfWhiteSpaceConflicts = 0; + + MergeLineList::iterator mlIt = m_mergeLineList.begin(); + for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) + { + MergeLine& ml = *mlIt; + MergeEditLineList::iterator melIt = ml.mergeEditLineList.begin(); + if ( melIt->isConflict() ) + { + ++nrOfUnsolvedConflicts; + if ( ml.bWhiteSpaceConflict && pNrOfWhiteSpaceConflicts!=0 ) + ++ *pNrOfWhiteSpaceConflicts; + } + } + + return nrOfUnsolvedConflicts; +} + +void MergeResultWindow::showNrOfConflicts() +{ + int nrOfConflicts = 0; + MergeLineList::iterator i; + for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) + { + if ( i->bConflict || i->bDelta ) + ++nrOfConflicts; + } + QString totalInfo; + if ( m_pTotalDiffStatus->bBinaryAEqB && m_pTotalDiffStatus->bBinaryAEqC ) + totalInfo += i18n("All input files are binary equal."); + else if ( m_pTotalDiffStatus->bTextAEqB && m_pTotalDiffStatus->bTextAEqC ) + totalInfo += i18n("All input files contain the same text."); + else { + if ( m_pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files A and B are binary equal.\n"); + else if ( m_pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files A and B have equal text. \n"); + if ( m_pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files A and C are binary equal.\n"); + else if ( m_pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files A and C have equal text. \n"); + if ( m_pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files B and C are binary equal.\n"); + else if ( m_pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files B and C have equal text. \n"); + } + + int nrOfUnsolvedConflicts = getNrOfUnsolvedConflicts(); + + KMessageBox::information( this, + i18n("Total number of conflicts: ") + QString::number(nrOfConflicts) + + i18n("\nNr of automatically solved conflicts: ") + QString::number(nrOfConflicts-nrOfUnsolvedConflicts) + + i18n("\nNr of unsolved conflicts: ") + QString::number(nrOfUnsolvedConflicts) + + "\n"+totalInfo, + i18n("Conflicts") + ); +} + +void MergeResultWindow::setFastSelector(MergeLineList::iterator i) +{ + if ( i==m_mergeLineList.end() ) + return; + m_currentMergeLineIt = i; + emit setFastSelectorRange( i->d3lLineIdx, i->srcRangeLength ); + + int line1 = 0; + + MergeLineList::iterator mlIt = m_mergeLineList.begin(); + for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) + { + if(mlIt==m_currentMergeLineIt) + break; + line1 += mlIt->mergeEditLineList.size(); + } + + int nofLines = m_currentMergeLineIt->mergeEditLineList.size(); + int newFirstLine = getBestFirstLine( line1, nofLines, m_firstLine, getNofVisibleLines() ); + if ( newFirstLine != m_firstLine ) + { + scroll( 0, newFirstLine - m_firstLine ); + } + + if ( m_selection.isEmpty() ) + { + m_cursorXPos = 0; + m_cursorOldXPos = 0; + m_cursorYPos = line1; + } + + update(); + updateSourceMask(); + emit updateAvailabilities(); +} + +void MergeResultWindow::choose( int selector ) +{ + if ( m_currentMergeLineIt==m_mergeLineList.end() ) + return; + + setModified(); + + // First find range for which this change works. + MergeLine& ml = *m_currentMergeLineIt; + + MergeEditLineList::iterator melIt; + + // Now check if selector is active for this range already. + bool bActive = false; + + // Remove unneeded lines in the range. + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ) + { + MergeEditLine& mel = *melIt; + if ( mel.src()==selector ) + bActive = true; + + if ( mel.src()==selector || !mel.isEditableText() || mel.isModified() ) + melIt = ml.mergeEditLineList.erase( melIt ); + else + ++melIt; + } + + if ( !bActive ) // Selected source wasn't active. + { // Append the lines from selected source here at rangeEnd. + Diff3LineList::const_iterator d3llit=ml.id3l; + int j; + + for( j=0; jlineA : + mel.src()==2 ? mel.id3l()->lineB : + mel.src()==3 ? mel.id3l()->lineC : -1; + + if ( srcLine == -1 ) + melIt = ml.mergeEditLineList.erase( melIt ); + else + ++melIt; + } + } + + if ( ml.mergeEditLineList.empty() ) + { + // Insert a dummy line: + MergeEditLine mel(ml.id3l); + + if ( bActive ) mel.setConflict(); // All src entries deleted => conflict + else mel.setRemoved(selector); // No lines in corresponding src found. + + ml.mergeEditLineList.push_back(mel); + } + + if ( m_cursorYPos >= m_totalSize ) + { + m_cursorYPos = m_totalSize-1; + m_cursorXPos = 0; + } + + update(); + updateSourceMask(); + emit updateAvailabilities(); + int wsc; + int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); + m_pStatusBar->showMessage( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") + .arg(nofUnsolved).arg(wsc) ); +} + +// bConflictsOnly: automatically choose for conflicts only (true) or for everywhere (false) +void MergeResultWindow::chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ) +{ + resetSelection(); + + merge( false, selector, bConflictsOnly, bWhiteSpaceOnly ); + setModified( true ); + update(); + int wsc; + int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); + m_pStatusBar->showMessage( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") + .arg(nofUnsolved).arg(wsc) ); +} + +void MergeResultWindow::slotAutoSolve() +{ + resetSelection(); + merge( true, -1 ); + setModified( true ); + update(); + int wsc; + int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); + m_pStatusBar->showMessage( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") + .arg(nofUnsolved).arg(wsc) ); +} + +void MergeResultWindow::slotUnsolve() +{ + resetSelection(); + merge( false, -1 ); + setModified( true ); + update(); + int wsc; + int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); + m_pStatusBar->showMessage( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") + .arg(nofUnsolved).arg(wsc) ); +} + + +static void findHistoryRange( bool bThreeFiles, const Diff3LineList* pD3LList, + Diff3LineList::const_iterator& iBegin, Diff3LineList::const_iterator& iEnd, int& idxBegin, int& idxEnd ) +{ + QRegExp historyStart(".*\\$Log.*\\$.*"); + QString historyLead; + // Search for start of history + for( iBegin = pD3LList->begin(), idxBegin=0; iBegin!=pD3LList->end(); ++iBegin, ++idxBegin ) + { + if ( historyStart.exactMatch( iBegin->getString(A) ) && + historyStart.exactMatch( iBegin->getString(B) ) && + ( !bThreeFiles || historyStart.exactMatch( iBegin->getString(C) ) ) ) + { + historyLead = iBegin->getString(A).section(' ', 0, 0, QString::SectionIncludeLeadingSep); + break; + } + } + // Search for end of history + for( iEnd = iBegin, idxEnd = idxBegin; iEnd!=pD3LList->end(); ++iEnd, ++idxEnd ) + { + QString sA = iEnd->getString(A); + QString sB = iEnd->getString(B); + QString sC = iEnd->getString(C); + if ( ! ((sA.isNull() || historyLead == sA.section(' ',0,0,QString::SectionIncludeLeadingSep)) && + (sB.isNull() || historyLead == sB.section(' ',0,0,QString::SectionIncludeLeadingSep)) && + (!bThreeFiles || sC.isNull() || historyLead == sC.section(' ',0,0,QString::SectionIncludeLeadingSep)) + )) + { + break; // End of the history + } + } +} + +bool findParenthesesGroups( const QString& s, QStringList& sl ) +{ + sl.clear(); + int i=0; + std::list startPosStack; + int length = s.length(); + for( i=0; i(int)parenthesesGroupList.size() ) + continue; + QString s = matchedRegExpr.cap( groupIdx ); + if ( groupIdx == 0 ) + { + key += s + " "; + continue; + } + + QString groupRegExp = parenthesesGroupList[groupIdx-1]; + if( groupRegExp.indexOf('|')<0 || groupRegExp.indexOf('(')>=0 ) + { + bool bOk = false; + int i = s.toInt( &bOk ); + if ( bOk && i>=0 && i<10000 ) + s.sprintf("%04d", i); // This should help for correct sorting of numbers. + key += s + " "; + } + else + { + // Assume that the groupRegExp consists of something like "Jan|Feb|Mar|Apr" + // s is the string that managed to match. + // Now we want to know at which position it occurred. e.g. Jan=0, Feb=1, Mar=2, etc. + QStringList sl = groupRegExp.split( '|' ); + int idx = sl.indexOf( s ); + if (idx<0) + { + // Didn't match + } + else + { + QString sIdx; + sIdx.sprintf("%02d", idx+1 ); // Up to 99 words in the groupRegExp (more than 12 aren't expected) + key += sIdx + " "; + } + } + } + return key; +} + +void MergeResultWindow::collectHistoryInformation( + int src, Diff3LineList::const_iterator iHistoryBegin, Diff3LineList::const_iterator iHistoryEnd, + HistoryMap& historyMap, + std::list< HistoryMap::iterator >& hitList // list of iterators + ) +{ + std::list< HistoryMap::iterator >::iterator itHitListFront = hitList.begin(); + Diff3LineList::const_iterator id3l = iHistoryBegin; + QString historyLead; + { + const LineData* pld = id3l->getLineData(src); + QString s( pld->pLine, pld->size ); + historyLead = s.section(' ',0,0,QString::SectionIncludeLeadingSep); + } + QRegExp historyStart( m_pOptionDialog->m_historyStartRegExp ); + ++id3l; // Skip line with "$Log ... $" + QRegExp newHistoryEntry( m_pOptionDialog->m_historyEntryStartRegExp ); + QStringList parenthesesGroups; + findParenthesesGroups( m_pOptionDialog->m_historyEntryStartRegExp, parenthesesGroups ); + QString key; + MergeEditLineList melList; + bool bPrevLineIsEmpty = true; + bool bUseRegExp = !m_pOptionDialog->m_historyEntryStartRegExp.isEmpty(); + for(; id3l != iHistoryEnd; ++id3l ) + { + const LineData* pld = id3l->getLineData(src); + if ( !pld ) continue; + QString s( pld->pLine, pld->size ); + if (historyLead.isNull()) historyLead = s.section(' ',0,0,QString::SectionIncludeLeadingSep); + QString sLine = s.mid(historyLead.length()); + if ( ( !bUseRegExp && !sLine.trimmed().isEmpty() && bPrevLineIsEmpty ) + || bUseRegExp && newHistoryEntry.exactMatch( sLine ) + ) + { + if ( !key.isEmpty() && !melList.empty() ) + { + // Only insert new HistoryMapEntry if key not found; in either case p.first is a valid iterator to element key. + std::pair p = historyMap.insert(HistoryMap::value_type(key,HistoryMapEntry())); + HistoryMapEntry& hme = p.first->second; + if ( src==A ) hme.mellA = melList; + if ( src==B ) hme.mellB = melList; + if ( src==C ) hme.mellC = melList; + if ( p.second ) // Not in list yet? + { + hitList.insert( itHitListFront, p.first ); + } + } + + if ( ! bUseRegExp ) + key = sLine; + else + key = calcHistorySortKey(m_pOptionDialog->m_historyEntryStartSortKeyOrder,newHistoryEntry,parenthesesGroups); + + melList.clear(); + melList.push_back( MergeEditLine(id3l,src) ); + } + else if ( ! historyStart.exactMatch( s ) ) + { + melList.push_back( MergeEditLine(id3l,src) ); + } + + bPrevLineIsEmpty = sLine.trimmed().isEmpty(); + } + if ( !key.isEmpty() ) + { + // Only insert new HistoryMapEntry if key not found; in either case p.first is a valid iterator to element key. + std::pair p = historyMap.insert(HistoryMap::value_type(key,HistoryMapEntry())); + HistoryMapEntry& hme = p.first->second; + if ( src==A ) hme.mellA = melList; + if ( src==B ) hme.mellB = melList; + if ( src==C ) hme.mellC = melList; + if ( p.second ) // Not in list yet? + { + hitList.insert( itHitListFront, p.first ); + } + } + // End of the history +} + +MergeResultWindow::MergeEditLineList& MergeResultWindow::HistoryMapEntry::choice( bool bThreeInputs ) +{ + if ( !bThreeInputs ) + return mellA.empty() ? mellB : mellA; + else + { + if ( mellA.empty() ) + return mellC.empty() ? mellB : mellC; // A doesn't exist, return one that exists + else if ( ! mellB.empty() && ! mellC.empty() ) + { // A, B and C exist + return mellA; + } + else + return mellB.empty() ? mellB : mellC; // A exists, return the one that doesn't exist + } +} + +bool MergeResultWindow::HistoryMapEntry::staysInPlace( bool bThreeInputs, Diff3LineList::const_iterator& iHistoryEnd ) +{ + // The entry should stay in place if the decision made by the automerger is correct. + Diff3LineList::const_iterator& iHistoryLast = iHistoryEnd; + --iHistoryLast; + if ( !bThreeInputs ) + { + if ( !mellA.empty() && !mellB.empty() && mellA.begin()->id3l()==mellB.begin()->id3l() && + mellA.back().id3l() == iHistoryLast && mellB.back().id3l() == iHistoryLast ) + { + iHistoryEnd = mellA.begin()->id3l(); + return true; + } + else + { + return false; + } + } + else + { + if ( !mellA.empty() && !mellB.empty() && !mellC.empty() + && mellA.begin()->id3l()==mellB.begin()->id3l() && mellA.begin()->id3l()==mellC.begin()->id3l() + && mellA.back().id3l() == iHistoryLast && mellB.back().id3l() == iHistoryLast && mellC.back().id3l() == iHistoryLast ) + { + iHistoryEnd = mellA.begin()->id3l(); + return true; + } + else + { + return false; + } + } +} + +void MergeResultWindow::slotMergeHistory() +{ + Diff3LineList::const_iterator iD3LHistoryBegin; + Diff3LineList::const_iterator iD3LHistoryEnd; + int d3lHistoryBeginLineIdx = -1; + int d3lHistoryEndLineIdx = -1; + + // Search for history start, history end in the diff3LineList + findHistoryRange( m_pldC!=0, m_pDiff3LineList, iD3LHistoryBegin, iD3LHistoryEnd, d3lHistoryBeginLineIdx, d3lHistoryEndLineIdx ); + + if ( iD3LHistoryBegin != m_pDiff3LineList->end() ) + { + // Now collect the historyMap information + HistoryMap historyMap; + std::list< HistoryMap::iterator > hitList; + if (m_pldC==0) + { + collectHistoryInformation( A, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); + collectHistoryInformation( B, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); + } + else + { + collectHistoryInformation( A, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); + collectHistoryInformation( B, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); + collectHistoryInformation( C, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); + } + + Diff3LineList::const_iterator iD3LHistoryOrigEnd = iD3LHistoryEnd; + + bool bHistoryMergeSorting = m_pOptionDialog->m_bHistoryMergeSorting && ! m_pOptionDialog->m_historyEntryStartSortKeyOrder.isEmpty() && + ! m_pOptionDialog->m_historyEntryStartRegExp.isEmpty(); + + // Remove parts from the historyMap and hitList that stay in place + if ( bHistoryMergeSorting ) + { + while ( ! historyMap.empty() ) + { + HistoryMap::iterator hMapIt = historyMap.begin(); + if( hMapIt->second.staysInPlace( m_pldC!=0, iD3LHistoryEnd ) ) + historyMap.erase(hMapIt); + else + break; + } + } + else + { + while ( ! hitList.empty() ) + { + HistoryMap::iterator hMapIt = hitList.back(); + if( hMapIt->second.staysInPlace( m_pldC!=0, iD3LHistoryEnd ) ) + hitList.pop_back(); + else + break; + } + } + while (iD3LHistoryOrigEnd != iD3LHistoryEnd) + { + --iD3LHistoryOrigEnd; + --d3lHistoryEndLineIdx; + } + + MergeLineList::iterator iMLLStart = splitAtDiff3LineIdx(d3lHistoryBeginLineIdx); + MergeLineList::iterator iMLLEnd = splitAtDiff3LineIdx(d3lHistoryEndLineIdx); + // Now join all MergeLines in the history + MergeLineList::iterator i = iMLLStart; + if ( i != iMLLEnd ) + { + ++i; + while ( i!=iMLLEnd ) + { + iMLLStart->join(*i); + i = m_mergeLineList.erase( i ); + } + } + iMLLStart->mergeEditLineList.clear(); + // Now insert the complete history into the first MergeLine of the history + iMLLStart->mergeEditLineList.push_back( MergeEditLine( iD3LHistoryBegin, m_pldC == 0 ? B : C ) ); + QString lead = iD3LHistoryBegin->getString(A).section(' ',0,0,QString::SectionIncludeLeadingSep); + MergeEditLine mel( m_pDiff3LineList->end() ); + mel.setString( lead ); + iMLLStart->mergeEditLineList.push_back(mel); + + if ( bHistoryMergeSorting ) + { + // Create a sorted history + HistoryMap::reverse_iterator hmit; + for ( hmit = historyMap.rbegin(); hmit != historyMap.rend(); ++hmit ) + { + HistoryMapEntry& hme = hmit->second; + MergeEditLineList& mell = hme.choice(m_pldC!=0); + if (!mell.empty()) + iMLLStart->mergeEditLineList.splice( iMLLStart->mergeEditLineList.end(), mell, mell.begin(), mell.end() ); + } + } + else + { + // Create history in order of appearance + std::list< HistoryMap::iterator >::iterator hlit; + for ( hlit = hitList.begin(); hlit != hitList.end(); ++hlit ) + { + HistoryMapEntry& hme = (*hlit)->second; + MergeEditLineList& mell = hme.choice(m_pldC!=0); + if (!mell.empty()) + iMLLStart->mergeEditLineList.splice( iMLLStart->mergeEditLineList.end(), mell, mell.begin(), mell.end() ); + } + } + setFastSelector( iMLLStart ); + update(); + } +} + +void MergeResultWindow::slotRegExpAutoMerge() +{ + if ( m_pOptionDialog->m_autoMergeRegExp.isEmpty() ) + return; + + QRegExp vcsKeywords( m_pOptionDialog->m_autoMergeRegExp ); + MergeLineList::iterator i; + for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) + { + if (i->bConflict ) + { + Diff3LineList::const_iterator id3l = i->id3l; + if ( vcsKeywords.exactMatch( id3l->getString(A) ) && + vcsKeywords.exactMatch( id3l->getString(B) ) && + (m_pldC==0 || vcsKeywords.exactMatch( id3l->getString(C) ))) + { + MergeEditLine& mel = *i->mergeEditLineList.begin(); + mel.setSource( m_pldC==0 ? B : C, false ); + splitAtDiff3LineIdx( i->d3lLineIdx+1 ); + } + } + } + update(); +} + +// This doesn't detect user modifications and should only be called after automatic merge +// This will only do something for three file merge. +// Irrelevant changes are those where all contributions from B are already contained in C. +// Also irrelevant are conflicts automatically solved (automerge regexp and history automerge) +// Precondition: The VCS-keyword would also be C. +bool MergeResultWindow::doRelevantChangesExist() +{ + if ( m_pldC==0 || m_mergeLineList.size() <= 1 ) + return true; + + MergeLineList::iterator i; + for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) + { + if ( ( i->bConflict && i->mergeEditLineList.begin()->src()!=C ) + || i->srcSelect == B ) + { + return true; + } + } + + return false; +} + +// Returns the iterator to the MergeLine after the split +MergeResultWindow::MergeLineList::iterator MergeResultWindow::splitAtDiff3LineIdx( int d3lLineIdx ) +{ + MergeLineList::iterator i; + for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) + { + if ( i->d3lLineIdx==d3lLineIdx ) + { + // No split needed, this is the beginning of a MergeLine + return i; + } + else if ( i->d3lLineIdx > d3lLineIdx ) + { + // The split must be in the previous MergeLine + --i; + MergeLine& ml = *i; + MergeLine newML; + ml.split(newML,d3lLineIdx); + ++i; + return m_mergeLineList.insert( i, newML ); + } + } + // The split must be in the previous MergeLine + --i; + MergeLine& ml = *i; + MergeLine newML; + ml.split(newML,d3lLineIdx); + ++i; + return m_mergeLineList.insert( i, newML ); +} + +void MergeResultWindow::slotSplitDiff( int firstD3lLineIdx, int lastD3lLineIdx ) +{ + if (lastD3lLineIdx>=0) + splitAtDiff3LineIdx( lastD3lLineIdx + 1 ); + setFastSelector( splitAtDiff3LineIdx(firstD3lLineIdx) ); +} + +void MergeResultWindow::slotJoinDiffs( int firstD3lLineIdx, int lastD3lLineIdx ) +{ + MergeLineList::iterator i; + MergeLineList::iterator iMLLStart = m_mergeLineList.end(); + MergeLineList::iterator iMLLEnd = m_mergeLineList.end(); + for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) + { + MergeLine& ml = *i; + if ( firstD3lLineIdx >= ml.d3lLineIdx && firstD3lLineIdx < ml.d3lLineIdx + ml.srcRangeLength ) + { + iMLLStart = i; + } + if ( lastD3lLineIdx >= ml.d3lLineIdx && lastD3lLineIdx < ml.d3lLineIdx + ml.srcRangeLength ) + { + iMLLEnd = i; + ++iMLLEnd; + break; + } + } + + bool bJoined = false; + for( i=iMLLStart; i!=iMLLEnd && i!=m_mergeLineList.end(); ) + { + if ( i==iMLLStart ) + { + ++i; + } + else + { + iMLLStart->join(*i); + i = m_mergeLineList.erase( i ); + bJoined = true; + } + } + if (bJoined) + { + iMLLStart->mergeEditLineList.clear(); + // Insert a conflict line as placeholder + iMLLStart->mergeEditLineList.push_back( MergeEditLine( iMLLStart->id3l ) ); + } + setFastSelector( iMLLStart ); +} + +void MergeResultWindow::myUpdate(int afterMilliSecs) +{ + if ( m_delayedDrawTimer ) + killTimer(m_delayedDrawTimer); + m_bMyUpdate = true; + m_delayedDrawTimer = startTimer( afterMilliSecs ); +} + +void MergeResultWindow::timerEvent(QTimerEvent*) +{ + killTimer(m_delayedDrawTimer); + m_delayedDrawTimer = 0; + + if ( m_bMyUpdate ) + { + update(); + m_bMyUpdate = false; + } + + if ( m_scrollDeltaX != 0 || m_scrollDeltaY != 0 ) + { + m_selection.end( m_selection.lastLine + m_scrollDeltaY, m_selection.lastPos + m_scrollDeltaX ); + emit scroll( m_scrollDeltaX, m_scrollDeltaY ); + killTimer(m_delayedDrawTimer); + m_delayedDrawTimer = startTimer(50); + } +} + +QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mrw ) +{ + if ( isRemoved() ) { return QString(); } + + if ( ! isModified() ) + { + int src = m_src; + const Diff3Line& d3l = *m_id3l; + if ( src == 0 ) { return QString(); } + + const LineData* pld = 0; + assert( src == A || src == B || src == C ); + if ( src == A && d3l.lineA!=-1 ) pld = &mrw->m_pldA[ d3l.lineA ]; + else if ( src == B && d3l.lineB!=-1 ) pld = &mrw->m_pldB[ d3l.lineB ]; + else if ( src == C && d3l.lineC!=-1 ) pld = &mrw->m_pldC[ d3l.lineC ]; + + if ( pld == 0 ) + { + // assert(false); This is no error. + return QString(); + } + + return QString( pld->pLine, pld->size ); + } + else + { + return m_str; + } + return 0; +} + +/// Converts the cursor-posOnScreen into a text index, considering tabulators. +int convertToPosInText( const QString& s, int posOnScreen, int tabSize ) +{ + int localPosOnScreen = 0; + int size=s.length(); + for ( int i=0; i=posOnScreen ) + return i; + + // All letters except tabulator have width one. + int letterWidth = s[i]!='\t' ? 1 : tabber( localPosOnScreen, tabSize ); + + localPosOnScreen += letterWidth; + + if ( localPosOnScreen>posOnScreen ) + return i; + } + return size; +} + + +/// Converts the index into the text to a cursor-posOnScreen considering tabulators. +int convertToPosOnScreen( const QString& p, int posInText, int tabSize ) +{ + int posOnScreen = 0; + for ( int i=0; i height() ) + return; + + yOffset += topLineYOffset; + + QString srcName = " "; + if ( bUserModified ) srcName = "m"; + else if ( srcSelect == A && mergeDetails != eNoChange ) srcName = "A"; + else if ( srcSelect == B ) srcName = "B"; + else if ( srcSelect == C ) srcName = "C"; + + if ( rangeMark & 4 ) + { + p.fillRect( xOffset, yOffset, width(), fontHeight, m_pOptionDialog->m_currentRangeBgColor ); + } + + if( (srcSelect > 0 || bUserModified ) && !bLineRemoved ) + { + int outPos = 0; + QString s; + int size = str.length(); + for ( int i=0; im_tabSize ); + for( int j=0; jm_tabSize ),m_pOptionDialog->m_tabSize ); + int lastPosInLine = convertToPosOnScreen( str, convertToPosInText( str, m_selection.lastPosInLine(line), m_pOptionDialog->m_tabSize ), m_pOptionDialog->m_tabSize ); + int lengthInLine = max2(0,lastPosInLine - firstPosInLine); + if (lengthInLine>0) m_selection.bSelectionContainsData = true; + + if ( lengthInLine < int(s.length()) ) + { // Draw a normal line first + p.setPen( m_pOptionDialog->m_fgColor ); + p.drawText( xOffset, yOffset+fontAscent, s.mid(m_firstColumn), true ); + } + int firstPosInLine2 = max2( firstPosInLine, m_firstColumn ); + int lengthInLine2 = max2(0,lastPosInLine - firstPosInLine2); + + if( m_selection.lineWithin( line+1 ) ) + p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset, + width(), fontHeight, palette().highlight() ); + else if ( lengthInLine2>0 ) + p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset, + fontWidth*lengthInLine2, fontHeight, palette().highlight() ); + + p.setPen( palette().highlightedText().color() ); + p.drawText( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset+fontAscent, + s.mid(firstPosInLine2,lengthInLine2), true ); + } + else + { + p.setPen( m_pOptionDialog->m_fgColor ); + p.drawText( xOffset, yOffset+fontAscent, s.mid(m_firstColumn), true ); + } + + p.setPen( m_pOptionDialog->m_fgColor ); + if ( m_cursorYPos==line ) + { + m_cursorXPos = minMaxLimiter( m_cursorXPos, 0, outPos ); + m_cursorXPos = convertToPosOnScreen( str, convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ),m_pOptionDialog->m_tabSize ); + } + + p.drawText( 1, yOffset+fontAscent, srcName, true ); + } + else if ( bLineRemoved ) + { + p.setPen( m_pOptionDialog->m_colorForConflict ); + p.drawText( xOffset, yOffset+fontAscent, i18n("") ); + p.drawText( 1, yOffset+fontAscent, srcName ); + if ( m_cursorYPos==line ) m_cursorXPos = 0; + } + else if ( srcSelect == 0 ) + { + p.setPen( m_pOptionDialog->m_colorForConflict ); + if ( bWhiteSpaceConflict ) + p.drawText( xOffset, yOffset+fontAscent, i18n("") ); + else + p.drawText( xOffset, yOffset+fontAscent, i18n("") ); + p.drawText( 1, yOffset+fontAscent, "?" ); + if ( m_cursorYPos==line ) m_cursorXPos = 0; + } + else assert(false); + + xOffset -= fontWidth; + p.setPen( m_pOptionDialog->m_fgColor ); + if ( rangeMark & 1 ) // begin mark + { + p.drawLine( xOffset, yOffset+1, xOffset, yOffset+fontHeight/2 ); + p.drawLine( xOffset, yOffset+1, xOffset-2, yOffset+1 ); + } + else + { + p.drawLine( xOffset, yOffset, xOffset, yOffset+fontHeight/2 ); + } + + if ( rangeMark & 2 ) // end mark + { + p.drawLine( xOffset, yOffset+fontHeight/2, xOffset, yOffset+fontHeight-1 ); + p.drawLine( xOffset, yOffset+fontHeight-1, xOffset-2, yOffset+fontHeight-1 ); + } + else + { + p.drawLine( xOffset, yOffset+fontHeight/2, xOffset, yOffset+fontHeight ); + } + + if ( rangeMark & 4 ) + { + p.fillRect( xOffset + 3, yOffset, 3, fontHeight, m_pOptionDialog->m_fgColor ); +/* p.setPen( blue ); + p.drawLine( xOffset+2, yOffset, xOffset+2, yOffset+fontHeight-1 ); + p.drawLine( xOffset+3, yOffset, xOffset+3, yOffset+fontHeight-1 );*/ + } +} + +void MergeResultWindow::setPaintingAllowed(bool bPaintingAllowed) +{ + m_bPaintingAllowed = bPaintingAllowed; + if ( !m_bPaintingAllowed ) + { + m_currentMergeLineIt = m_mergeLineList.end(); + reset(); + } +} + +void MergeResultWindow::paintEvent( QPaintEvent* ) +{ + if (m_pDiff3LineList==0 || !m_bPaintingAllowed) return; + + bool bOldSelectionContainsData = m_selection.bSelectionContainsData; + const QFontMetrics& fm = fontMetrics(); + int fontHeight = fm.height(); + int fontWidth = fm.width("W"); + int fontAscent = fm.ascent(); + + if ( !m_bCursorUpdate ) // Don't redraw everything for blinking cursor? + { + m_selection.bSelectionContainsData = false; + if ( size() != m_pixmap.size() ) + m_pixmap = QPixmap(size()); + + MyPainter p(&m_pixmap, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); + p.setFont( font() ); + p.QPainter::fillRect( rect(), m_pOptionDialog->m_bgColor ); + + //int visibleLines = height() / fontHeight; + + int lastVisibleLine = m_firstLine + getNofVisibleLines() + 5; + int nofColumns = 0; + int line = 0; + MergeLineList::iterator mlIt = m_mergeLineList.begin(); + for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) + { + MergeLine& ml = *mlIt; + if ( line > lastVisibleLine || line + ml.mergeEditLineList.size() < m_firstLine) + { + line += ml.mergeEditLineList.size(); + } + else + { + MergeEditLineList::iterator melIt; + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) + { + if (line>=m_firstLine && line<=lastVisibleLine) + { + MergeEditLine& mel = *melIt; + MergeEditLineList::iterator melIt1 = melIt; + ++melIt1; + + int rangeMark = 0; + if ( melIt==ml.mergeEditLineList.begin() ) rangeMark |= 1; // Begin range mark + if ( melIt1==ml.mergeEditLineList.end() ) rangeMark |= 2; // End range mark + + if ( mlIt == m_currentMergeLineIt ) rangeMark |= 4; // Mark of the current line + + QString s; + s = mel.getString( this ); + if ( convertToPosOnScreen(s,s.length(),m_pOptionDialog->m_tabSize) >nofColumns) + nofColumns = s.length(); + + writeLine( p, line, s, mel.src(), ml.mergeDetails, rangeMark, + mel.isModified(), mel.isRemoved(), ml.bWhiteSpaceConflict ); + } + ++line; + } + } + } + + if ( line != m_nofLines || nofColumns != m_nofColumns ) + { + m_nofLines = line; + assert( m_nofLines == m_totalSize ); + + m_nofColumns = nofColumns; + emit resizeSignal(); + } + + p.end(); + } + + QPainter painter(this); + + int topLineYOffset = 0; + int xOffset = fontWidth * leftInfoWidth; + int yOffset = ( m_cursorYPos - m_firstLine ) * fontHeight + topLineYOffset; + int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset; + + if ( !m_bCursorUpdate ) + painter.drawPixmap(0,0, m_pixmap); + else + { + if (!m_pOptionDialog->m_bRightToLeftLanguage) + painter.drawPixmap(xCursor-2, yOffset, m_pixmap, + xCursor-2, yOffset, 5, fontAscent+2 ); + else + painter.drawPixmap(width()-1-4-(xCursor-2), yOffset, m_pixmap, + width()-1-4-(xCursor-2), yOffset, 5, fontAscent+2 ); + m_bCursorUpdate = false; + } + painter.end(); + + if ( m_bCursorOn && hasFocus() && m_cursorYPos>=m_firstLine ) + { + MyPainter painter(this, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); + int topLineYOffset = 0; + int xOffset = fontWidth * leftInfoWidth; + + int yOffset = ( m_cursorYPos-m_firstLine ) * fontHeight + topLineYOffset; + + int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset; + + painter.setPen( m_pOptionDialog->m_fgColor ); + + painter.drawLine( xCursor, yOffset, xCursor, yOffset+fontAscent ); + painter.drawLine( xCursor-2, yOffset, xCursor+2, yOffset ); + painter.drawLine( xCursor-2, yOffset+fontAscent+1, xCursor+2, yOffset+fontAscent+1 ); + } + + if( !bOldSelectionContainsData && m_selection.bSelectionContainsData ) + emit newSelection(); +} + +void MergeResultWindow::updateSourceMask() +{ + int srcMask=0; + int enabledMask = 0; + if( !hasFocus() || m_pDiff3LineList==0 || !m_bPaintingAllowed || m_currentMergeLineIt == m_mergeLineList.end() ) + { + srcMask = 0; + enabledMask = 0; + } + else + { + enabledMask = m_pldC==0 ? 3 : 7; + MergeLine& ml = *m_currentMergeLineIt; + + srcMask = 0; + bool bModified = false; + MergeEditLineList::iterator melIt; + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) + { + MergeEditLine& mel = *melIt; + if ( mel.src()==1 ) srcMask |= 1; + if ( mel.src()==2 ) srcMask |= 2; + if ( mel.src()==3 ) srcMask |= 4; + if ( mel.isModified() || !mel.isEditableText() ) bModified = true; + } + + if ( ml.mergeDetails == eNoChange ) + { + srcMask = 0; + enabledMask = bModified ? 1 : 0; + } + } + + emit sourceMask( srcMask, enabledMask ); +} + +void MergeResultWindow::focusInEvent( QFocusEvent* e ) +{ + updateSourceMask(); + QWidget::focusInEvent(e); +} + +void MergeResultWindow::convertToLinePos( int x, int y, int& line, int& pos ) +{ + const QFontMetrics& fm = fontMetrics(); + int fontHeight = fm.height(); + int fontWidth = fm.width('W'); + int xOffset = (leftInfoWidth-m_firstColumn)*fontWidth; + int topLineYOffset = 0; + + int yOffset = topLineYOffset - m_firstLine * fontHeight; + + line = min2( ( y - yOffset ) / fontHeight, m_totalSize-1 ); + if ( ! m_pOptionDialog->m_bRightToLeftLanguage ) + pos = ( x - xOffset ) / fontWidth; + else + pos = ( (width() - 1 - x) - xOffset ) / fontWidth; +} + +void MergeResultWindow::mousePressEvent ( QMouseEvent* e ) +{ + m_bCursorOn = true; + + int line; + int pos; + convertToLinePos( e->x(), e->y(), line, pos ); + + bool bLMB = e->button() == Qt::LeftButton; + bool bMMB = e->button() == Qt::MidButton; + bool bRMB = e->button() == Qt::RightButton; + + if ( bLMB && pos < m_firstColumn || bRMB ) // Fast range selection + { + m_cursorXPos = 0; + m_cursorOldXPos = 0; + m_cursorYPos = max2(line,0); + int l = 0; + MergeLineList::iterator i = m_mergeLineList.begin(); + for(i = m_mergeLineList.begin();i!=m_mergeLineList.end(); ++i) + { + if (l==line) + break; + + l += i->mergeEditLineList.size(); + if (l>line) + break; + } + m_selection.reset(); // Disable current selection + + m_bCursorOn = true; + setFastSelector( i ); + + if (bRMB) + { + showPopupMenu( QCursor::pos() ); + } + } + else if ( bLMB ) // Normal cursor placement + { + pos = max2(pos,0); + line = max2(line,0); + if ( e->QInputEvent::modifiers() & Qt::ShiftModifier ) + { + if (m_selection.firstLine==-1) + m_selection.start( line, pos ); + m_selection.end( line, pos ); + } + else + { + // Selection + m_selection.reset(); + m_selection.start( line, pos ); + m_selection.end( line, pos ); + } + m_cursorXPos = pos; + m_cursorOldXPos = pos; + m_cursorYPos = line; + + update(); + //showStatusLine( line, m_winIdx, m_pFilename, m_pDiff3LineList, m_pStatusBar ); + } + else if ( bMMB ) // Paste clipboard + { + pos = max2(pos,0); + line = max2(line,0); + + m_selection.reset(); + m_cursorXPos = pos; + m_cursorOldXPos = pos; + m_cursorYPos = line; + + pasteClipboard( true ); + } +} + +void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e ) +{ + if ( e->button() == Qt::LeftButton ) + { + int line; + int pos; + convertToLinePos( e->x(), e->y(), line, pos ); + m_cursorXPos = pos; + m_cursorOldXPos = pos; + m_cursorYPos = line; + + // Get the string data of the current line + + MergeLineList::iterator mlIt; + MergeEditLineList::iterator melIt; + calcIteratorFromLineNr( line, mlIt, melIt ); + QString s = melIt->getString( this ); + + if ( !s.isEmpty() ) + { + int pos1, pos2; + + calcTokenPos( s, pos, pos1, pos2, m_pOptionDialog->m_tabSize ); + + resetSelection(); + m_selection.start( line, convertToPosOnScreen( s, pos1, m_pOptionDialog->m_tabSize ) ); + m_selection.end( line, convertToPosOnScreen( s, pos2, m_pOptionDialog->m_tabSize ) ); + + update(); + // emit selectionEnd() happens in the mouseReleaseEvent. + } + } +} + +void MergeResultWindow::mouseReleaseEvent ( QMouseEvent * e ) +{ + if ( e->button() == Qt::LeftButton ) + { + if (m_delayedDrawTimer) + { + killTimer(m_delayedDrawTimer); + m_delayedDrawTimer = 0; + } + + if (m_selection.firstLine != -1 ) + { + emit selectionEnd(); + } + } +} + +void MergeResultWindow::mouseMoveEvent ( QMouseEvent * e ) +{ + int line; + int pos; + convertToLinePos( e->x(), e->y(), line, pos ); + m_cursorXPos = pos; + m_cursorOldXPos = pos; + m_cursorYPos = line; + if (m_selection.firstLine != -1 ) + { + m_selection.end( line, pos ); + myUpdate(0); + + //showStatusLine( line, m_winIdx, m_pFilename, m_pDiff3LineList, m_pStatusBar ); + + // Scroll because mouse moved out of the window + const QFontMetrics& fm = fontMetrics(); + int fontWidth = fm.width('W'); + int topLineYOffset = 0; + int deltaX=0; + int deltaY=0; + if ( ! m_pOptionDialog->m_bRightToLeftLanguage ) + { + if ( e->x() < leftInfoWidth*fontWidth ) deltaX=-1; + if ( e->x() > width() ) deltaX=+1; + } + else + { + if ( e->x() > width()-1-leftInfoWidth*fontWidth ) deltaX=-1; + if ( e->x() < fontWidth ) deltaX=+1; + } + if ( e->y() < topLineYOffset ) deltaY=-1; + if ( e->y() > height() ) deltaY=+1; + m_scrollDeltaX = deltaX; + m_scrollDeltaY = deltaY; + if ( deltaX != 0 || deltaY!= 0) + { + emit scroll( deltaX, deltaY ); + } + } +} + + +void MergeResultWindow::slotCursorUpdate() +{ + m_cursorTimer.stop(); + m_bCursorOn = !m_bCursorOn; + + if ( isVisible() ) + { + m_bCursorUpdate = true; + + const QFontMetrics& fm = fontMetrics(); + int fontWidth = fm.width("W"); + int topLineYOffset = 0; + int xOffset = fontWidth * leftInfoWidth; + int yOffset = ( m_cursorYPos - m_firstLine ) * fm.height() + topLineYOffset; + int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset; + + if (!m_pOptionDialog->m_bRightToLeftLanguage) + repaint( xCursor-2, yOffset, 5, fm.ascent()+2 ); + else + repaint( width()-1-4-(xCursor-2), yOffset, 5, fm.ascent()+2 ); + + m_bCursorUpdate=false; + } + + m_cursorTimer.start(500); +} + + +void MergeResultWindow::wheelEvent( QWheelEvent* e ) +{ + int d = -e->delta()*QApplication::wheelScrollLines()/120; + e->accept(); + scroll( 0, min2(d, getNofVisibleLines()) ); +} + + +void MergeResultWindow::keyPressEvent( QKeyEvent* e ) +{ + int y = m_cursorYPos; + MergeLineList::iterator mlIt; + MergeEditLineList::iterator melIt; + calcIteratorFromLineNr( y, mlIt, melIt ); + + QString str = melIt->getString( this ); + int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ); + + bool bCtrl = ( e->QInputEvent::modifiers() & Qt::ControlModifier ) != 0 ; + bool bShift = ( e->QInputEvent::modifiers() & Qt::ShiftModifier ) != 0 ; + #ifdef _WIN32 + bool bAlt = ( e->QInputEvent::modifiers() & Qt::AltModifier ) != 0 ; + if ( bCtrl && bAlt ){ bCtrl=false; bAlt=false; } // AltGr-Key pressed. + #endif + + bool bYMoveKey = false; + // Special keys + switch ( e->key() ) + { + case Qt::Key_Escape: break; + //case Key_Tab: break; + case Qt::Key_Backtab: break; + case Qt::Key_Delete: + { + if ( deleteSelection2( str, x, y, mlIt, melIt )) break; + if( !melIt->isEditableText() ) break; + if (x>=(int)str.length()) + { + if ( yisEditableText() ) + { + QString s2 = melIt1->getString( this ); + melIt->setString( str + s2 ); + + // Remove the line + if ( mlIt1->mergeEditLineList.size()>1 ) + mlIt1->mergeEditLineList.erase( melIt1 ); + else + melIt1->setRemoved(); + } + } + } + else + { + QString s = str.left(x); + s += str.mid( x+1 ); + melIt->setString( s ); + setModified(); + } + break; + } + case Qt::Key_Backspace: + { + if ( deleteSelection2( str, x, y, mlIt, melIt )) break; + if( !melIt->isEditableText() ) break; + if (x==0) + { + if ( y>0 ) + { + setModified(); + MergeLineList::iterator mlIt1; + MergeEditLineList::iterator melIt1; + calcIteratorFromLineNr( y-1, mlIt1, melIt1 ); + if ( melIt1->isEditableText() ) + { + QString s1 = melIt1->getString( this ); + melIt1->setString( s1 + str ); + + // Remove the previous line + if ( mlIt->mergeEditLineList.size()>1 ) + mlIt->mergeEditLineList.erase( melIt ); + else + melIt->setRemoved(); + + --y; + x=str.length(); + } + } + } + else + { + QString s = str.left( x-1 ); + s += str.mid( x ); + --x; + melIt->setString( s ); + setModified(); + } + break; + } + case Qt::Key_Return: + case Qt::Key_Enter: + { + if( !melIt->isEditableText() ) break; + deleteSelection2( str, x, y, mlIt, melIt ); + setModified(); + QString indentation; + if ( m_pOptionDialog->m_bAutoIndentation ) + { // calc last indentation + MergeLineList::iterator mlIt1 = mlIt; + MergeEditLineList::iterator melIt1 = melIt; + for(;;) { + const QString s = melIt1->getString(this); + if ( !s.isEmpty() ) { + int i; + for( i=0; imergeEditLineList.end() ) { + --mlIt1; + if ( mlIt1 == m_mergeLineList.end() ) break; + melIt1 = mlIt1->mergeEditLineList.end(); + --melIt1; + } + } + } + MergeEditLine mel(mlIt->id3l); // Associate every mel with an id3l, even if not really valid. + mel.setString( indentation + str.mid(x) ); + + if ( x<(int)str.length() ) // Cut off the old line. + { + // Since ps possibly points into melIt->str, first copy it into a temporary. + QString temp = str.left(x); + melIt->setString( temp ); + } + + ++melIt; + mlIt->mergeEditLineList.insert( melIt, mel ); + x = indentation.length(); + ++y; + break; + } + case Qt::Key_Insert: m_bInsertMode = !m_bInsertMode; break; + case Qt::Key_Pause: break; + case Qt::Key_Print: break; + case Qt::Key_SysReq: break; + case Qt::Key_Home: x=0; if(bCtrl){y=0; } break; // cursor movement + case Qt::Key_End: x=INT_MAX; if(bCtrl){y=INT_MAX;} break; + + case Qt::Key_Left: + case Qt::Key_Right: + if ( (e->key()==Qt::Key_Left) ^ m_pOptionDialog->m_bRightToLeftLanguage ) // operator^: XOR + { + if ( !bCtrl ) + { + --x; + if(x<0 && y>0){--y; x=INT_MAX;} + } + else + { + while( x>0 && (str[x-1]==' ' || str[x-1]=='\t') ) --x; + while( x>0 && (str[x-1]!=' ' && str[x-1]!='\t') ) --x; + } + } + else + { + if ( !bCtrl ) + { + ++x; if(x>(int)str.length() && ytext(); + if( t.isEmpty() || bCtrl ) + { e->ignore(); return; } + else + { + if( bCtrl ) + { + e->ignore(); return; + } + else + { + if( !melIt->isEditableText() ) break; + deleteSelection2( str, x, y, mlIt, melIt ); + + setModified(); + // Characters to insert + QString s=str; + if ( t[0]=='\t' && m_pOptionDialog->m_bReplaceTabs ) + { + int spaces = (m_cursorXPos / m_pOptionDialog->m_tabSize + 1)*m_pOptionDialog->m_tabSize - m_cursorXPos; + t.fill( ' ', spaces ); + } + if ( m_bInsertMode ) + s.insert( x, t ); + else + s.replace( x, t.length(), t ); + + melIt->setString( s ); + x += t.length(); + bShift = false; + } + } + } + } + + y = minMaxLimiter( y, 0, m_totalSize-1 ); + + calcIteratorFromLineNr( y, mlIt, melIt ); + str = melIt->getString( this ); + + x = minMaxLimiter( x, 0, (int)str.length() ); + + int newFirstLine = m_firstLine; + int newFirstColumn = m_firstColumn; + + if ( y m_firstLine + getNofVisibleLines() ) + newFirstLine = y - getNofVisibleLines(); + + if (bYMoveKey) + x=convertToPosInText( str, m_cursorOldXPos, m_pOptionDialog->m_tabSize ); + + int xOnScreen = convertToPosOnScreen( str, x, m_pOptionDialog->m_tabSize ); + if ( xOnScreen m_firstColumn + getNofVisibleColumns() ) + newFirstColumn = xOnScreen - getNofVisibleColumns(); + + if ( bShift ) + { + if (m_selection.firstLine==-1) + m_selection.start( m_cursorYPos, m_cursorXPos ); + + m_selection.end( y, xOnScreen ); + } + else + m_selection.reset(); + + m_cursorYPos = y; + m_cursorXPos = xOnScreen; + if ( ! bYMoveKey ) + m_cursorOldXPos = m_cursorXPos; + + m_bCursorOn = false; + + if ( newFirstLine!=m_firstLine || newFirstColumn!=m_firstColumn ) + { + m_bCursorOn = true; + scroll( newFirstColumn-m_firstColumn, newFirstLine-m_firstLine ); + return; + } + + m_bCursorOn = true; + update(); +} + +void MergeResultWindow::calcIteratorFromLineNr( + int line, + MergeResultWindow::MergeLineList::iterator& mlIt, + MergeResultWindow::MergeEditLineList::iterator& melIt + ) +{ + for( mlIt = m_mergeLineList.begin(); mlIt!=m_mergeLineList.end(); ++mlIt) + { + MergeLine& ml = *mlIt; + if ( line > ml.mergeEditLineList.size() ) + { + line -= ml.mergeEditLineList.size(); + } + else + { + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) + { + --line; + if (line<0) return; + } + } + } + assert(false); +} + + +QString MergeResultWindow::getSelection() +{ + QString selectionString; + + int line = 0; + MergeLineList::iterator mlIt = m_mergeLineList.begin(); + for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) + { + MergeLine& ml = *mlIt; + MergeEditLineList::iterator melIt; + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) + { + MergeEditLine& mel = *melIt; + + if ( m_selection.lineWithin(line) ) + { + int outPos = 0; + if (mel.isEditableText()) + { + const QString str = mel.getString( this ); + + // Consider tabs + + for( int i=0; im_tabSize ); + } + + if( m_selection.within( line, outPos ) ) + { + selectionString += str[i]; + } + + outPos += spaces; + } + } + else if ( mel.isConflict() ) + { + selectionString += i18n(""); + } + + if( m_selection.within( line, outPos ) ) + { + #ifdef _WIN32 + selectionString += '\r'; + #endif + selectionString += '\n'; + } + } + + ++line; + } + } + + return selectionString; +} + +bool MergeResultWindow::deleteSelection2( QString& s, int& x, int& y, + MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt ) +{ + if (m_selection.firstLine!=-1 && m_selection.bSelectionContainsData ) + { + deleteSelection(); + y = m_cursorYPos; + calcIteratorFromLineNr( y, mlIt, melIt ); + s = melIt->getString( this ); + x = convertToPosInText( s, m_cursorXPos, m_pOptionDialog->m_tabSize ); + return true; + } + return false; +} + +void MergeResultWindow::deleteSelection() +{ + if ( m_selection.firstLine==-1 || !m_selection.bSelectionContainsData ) + { + return; + } + setModified(); + + int line = 0; + MergeLineList::iterator mlItFirst; + MergeEditLineList::iterator melItFirst; + QString firstLineString; + + int firstLine = -1; + int lastLine = -1; + + MergeLineList::iterator mlIt; + for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) + { + MergeLine& ml = *mlIt; + MergeEditLineList::iterator melIt; + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) + { + MergeEditLine& mel = *melIt; + + if ( mel.isEditableText() && m_selection.lineWithin(line) ) + { + if ( firstLine==-1 ) + firstLine = line; + lastLine = line; + } + + ++line; + } + } + + if ( firstLine == -1 ) + { + return; // Nothing to delete. + } + + line = 0; + for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) + { + MergeLine& ml = *mlIt; + MergeEditLineList::iterator melIt, melIt1; + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ) + { + MergeEditLine& mel = *melIt; + melIt1 = melIt; + ++melIt1; + + if ( mel.isEditableText() && m_selection.lineWithin(line) ) + { + QString lineString = mel.getString( this ); + + int firstPosInLine = m_selection.firstPosInLine(line); + int lastPosInLine = m_selection.lastPosInLine(line); + + if ( line==firstLine ) + { + mlItFirst = mlIt; + melItFirst = melIt; + int pos = convertToPosInText( lineString, firstPosInLine, m_pOptionDialog->m_tabSize ); + firstLineString = lineString.left( pos ); + } + + if ( line==lastLine ) + { + // This is the last line in the selection + int pos = convertToPosInText( lineString, lastPosInLine, m_pOptionDialog->m_tabSize ); + firstLineString += lineString.mid( pos ); // rest of line + melItFirst->setString( firstLineString ); + } + + if ( line!=firstLine ) + { + // Remove the line + if ( mlIt->mergeEditLineList.size()>1 ) + mlIt->mergeEditLineList.erase( melIt ); + else + melIt->setRemoved(); + } + } + + ++line; + melIt = melIt1; + } + } + + m_cursorYPos = m_selection.beginLine(); + m_cursorXPos = m_selection.beginPos(); + m_cursorOldXPos = m_cursorXPos; + + m_selection.reset(); +} + +void MergeResultWindow::pasteClipboard( bool bFromSelection ) +{ + if (m_selection.firstLine != -1 ) + deleteSelection(); + + setModified(); + + int y = m_cursorYPos; + MergeLineList::iterator mlIt; + MergeEditLineList::iterator melIt, melItAfter; + calcIteratorFromLineNr( y, mlIt, melIt ); + melItAfter = melIt; + ++melItAfter; + QString str = melIt->getString( this ); + int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ); + + if ( !QApplication::clipboard()->supportsSelection() ) + bFromSelection = false; + + QString clipBoard = QApplication::clipboard()->text( bFromSelection ? QClipboard::Selection : QClipboard::Clipboard ); + + QString currentLine = str.left(x); + QString endOfLine = str.mid(x); + int i; + int len = clipBoard.length(); + for( i=0; isetString( currentLine ); + MergeEditLine mel(mlIt->id3l); // Associate every mel with an id3l, even if not really valid. + melIt = mlIt->mergeEditLineList.insert( melItAfter, mel ); + currentLine = ""; + x=0; + ++y; + } + else + { + currentLine += c; + ++x; + } + } + + currentLine += endOfLine; + melIt->setString( currentLine ); + + m_cursorYPos = y; + m_cursorXPos = convertToPosOnScreen( currentLine, x, m_pOptionDialog->m_tabSize ); + m_cursorOldXPos = m_cursorXPos; + + update(); +} + +void MergeResultWindow::resetSelection() +{ + m_selection.reset(); + update(); +} + +void MergeResultWindow::setModified(bool bModified) +{ + if (bModified != m_bModified) + { + m_bModified = bModified; + emit modifiedChanged(m_bModified); + } +} + +/// Saves and returns true when successful. +bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEncoding ) +{ + // Are still conflicts somewhere? + if ( getNrOfUnsolvedConflicts()>0 ) + { + KMessageBox::error( this, + i18n("Not all conflicts are solved yet.\n" + "File not saved.\n"), + i18n("Conflicts Left")); + return false; + } + + update(); + + FileAccess file( fileName, true /*bWantToWrite*/ ); + if ( m_pOptionDialog->m_bDmCreateBakFiles && file.exists() ) + { + bool bSuccess = file.createBackup(".orig"); + if ( !bSuccess ) + { + KMessageBox::error( this, file.getStatusText() + i18n("\n\nCreating backup failed. File not saved."), i18n("File Save Error") ); + return false; + } + } + + QByteArray dataArray; + QTextStream textOutStream(&dataArray, QIODevice::WriteOnly); + textOutStream.setGenerateByteOrderMark( true ); // Only for UTF-16 + textOutStream.setCodec( pEncoding ); + + int line = 0; + MergeLineList::iterator mlIt = m_mergeLineList.begin(); + for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) + { + MergeLine& ml = *mlIt; + MergeEditLineList::iterator melIt; + for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) + { + MergeEditLine& mel = *melIt; + + if ( mel.isEditableText() ) + { + QString str = mel.getString( this ); + + if (line>0) // Prepend line feed, but not for first line + { + if ( m_pOptionDialog->m_lineEndStyle == eLineEndDos ) + { str.prepend("\r\n"); } + else + { str.prepend("\n"); } + } + + textOutStream << str; + } + + ++line; + } + } + textOutStream.flush(); + bool bSuccess = file.writeFile( dataArray.data(), dataArray.size() ); + if ( ! bSuccess ) + { + KMessageBox::error( this, i18n("Error while writing."), i18n("File Save Error") ); + return false; + } + + setModified( false ); + update(); + + return true; +} + +QString MergeResultWindow::getString( int lineIdx ) +{ + MergeResultWindow::MergeLineList::iterator mlIt; + MergeResultWindow::MergeEditLineList::iterator melIt; + calcIteratorFromLineNr( lineIdx, mlIt, melIt ); + QString s = melIt->getString( this ); + return s; +} + +bool MergeResultWindow::findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) +{ + int it = d3vLine; + int endIt = bDirDown ? getNofLines() : -1; + int step = bDirDown ? 1 : -1; + int startPos = posInLine; + + for( ; it!=endIt; it+=step ) + { + QString line = getString( it ); + if ( !line.isEmpty() ) + { + int pos = line.indexOf( s, startPos, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive ); + if ( pos != -1 ) + { + d3vLine = it; + posInLine = pos; + return true; + } + + startPos = 0; + } + } + return false; +} + +void MergeResultWindow::setSelection( int firstLine, int startPos, int lastLine, int endPos ) +{ + if ( lastLine >= getNofLines() ) + { + lastLine = getNofLines()-1; + QString s = getString( lastLine ); + endPos = s.length(); + } + m_selection.reset(); + m_selection.start( firstLine, convertToPosOnScreen( getString(firstLine), startPos, m_pOptionDialog->m_tabSize ) ); + m_selection.end( lastLine, convertToPosOnScreen( getString(lastLine), endPos, m_pOptionDialog->m_tabSize ) ); + update(); +} + +Overview::Overview( OptionDialog* pOptions ) +//: QWidget( pParent, 0, Qt::WNoAutoErase ) +{ + m_pDiff3LineList = 0; + m_pOptions = pOptions; + m_bTripleDiff = false; + m_eOverviewMode = eOMNormal; + m_nofLines = 1; + m_bPaintingAllowed = false; + setFixedWidth(20); +} + +void Overview::init( Diff3LineList* pDiff3LineList, bool bTripleDiff ) +{ + m_pDiff3LineList = pDiff3LineList; + m_bTripleDiff = bTripleDiff; + m_pixmap = QPixmap( QSize(0,0) ); // make sure that a redraw happens + update(); +} + +void Overview::reset() +{ + m_pDiff3LineList = 0; +} + +void Overview::slotRedraw() +{ + m_pixmap = QPixmap( QSize(0,0) ); // make sure that a redraw happens + update(); +} + +void Overview::setRange( int firstLine, int pageHeight ) +{ + m_firstLine = firstLine; + m_pageHeight = pageHeight; + update(); +} +void Overview::setFirstLine( int firstLine ) +{ + m_firstLine = firstLine; + update(); +} + +void Overview::setOverviewMode( e_OverviewMode eOverviewMode ) +{ + m_eOverviewMode = eOverviewMode; + slotRedraw(); +} + +Overview::e_OverviewMode Overview::getOverviewMode() +{ + return m_eOverviewMode; +} + +void Overview::mousePressEvent( QMouseEvent* e ) +{ + int h = height()-1; + int h1 = h * m_pageHeight / max2(1,m_nofLines)+3; + if ( h>0 ) + emit setLine( ( e->y() - h1/2 )*m_nofLines/h ); +} + +void Overview::mouseMoveEvent( QMouseEvent* e ) +{ + mousePressEvent(e); +} + +void Overview::setPaintingAllowed( bool bAllowPainting ) +{ + if (m_bPaintingAllowed != bAllowPainting) + { + m_bPaintingAllowed = bAllowPainting; + if ( m_bPaintingAllowed ) update(); + else reset(); + } +} + +void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ) +{ + p.setPen(Qt::black); + p.drawLine( x, 0, x, h ); + + if (nofLines==0) return; + + int line = 0; + int oldY = 0; + int oldConflictY = -1; + int wrapLineIdx=0; + Diff3LineList::const_iterator i; + for( i = m_pDiff3LineList->begin(); i!= m_pDiff3LineList->end(); ) + { + const Diff3Line& d3l = *i; + int y = h * (line+1) / nofLines; + e_MergeDetails md; + bool bConflict; + bool bLineRemoved; + int src; + mergeOneLine( d3l, md, bConflict, bLineRemoved, src, !m_bTripleDiff ); + + QColor c = m_pOptions->m_bgColor; + bool bWhiteSpaceChange = false; + //if( bConflict ) c=m_pOptions->m_colorForConflict; + //else + if ( eOverviewMode==eOMNormal ) + { + switch( md ) + { + case eDefault: + case eNoChange: + c = m_pOptions->m_bgColor; + break; + + case eBAdded: + case eBDeleted: + case eBChanged: + c = bConflict ? m_pOptions->m_colorForConflict : m_pOptions->m_colorB; + bWhiteSpaceChange = d3l.bAEqB || d3l.bWhiteLineA && d3l.bWhiteLineB; + break; + + case eCAdded: + case eCDeleted: + case eCChanged: + bWhiteSpaceChange = d3l.bAEqC || d3l.bWhiteLineA && d3l.bWhiteLineC; + c = bConflict ? m_pOptions->m_colorForConflict : m_pOptions->m_colorC; + break; + + case eBCChanged: // conflict + case eBCChangedAndEqual: // possible conflict + case eBCDeleted: // possible conflict + case eBChanged_CDeleted: // conflict + case eCChanged_BDeleted: // conflict + case eBCAdded: // conflict + case eBCAddedAndEqual: // possible conflict + c=m_pOptions->m_colorForConflict; + break; + default: assert(false); break; + } + } + else if ( eOverviewMode==eOMAvsB ) + { + switch( md ) + { + case eDefault: + case eNoChange: + case eCAdded: + case eCDeleted: + case eCChanged: break; + default: c = m_pOptions->m_colorForConflict; + bWhiteSpaceChange = d3l.bAEqB || d3l.bWhiteLineA && d3l.bWhiteLineB; + break; + } + } + else if ( eOverviewMode==eOMAvsC ) + { + switch( md ) + { + case eDefault: + case eNoChange: + case eBAdded: + case eBDeleted: + case eBChanged: break; + default: c = m_pOptions->m_colorForConflict; + bWhiteSpaceChange = d3l.bAEqC || d3l.bWhiteLineA && d3l.bWhiteLineC; + break; + } + } + else if ( eOverviewMode==eOMBvsC ) + { + switch( md ) + { + case eDefault: + case eNoChange: + case eBCChangedAndEqual: + case eBCDeleted: + case eBCAddedAndEqual: break; + default: c=m_pOptions->m_colorForConflict; + bWhiteSpaceChange = d3l.bBEqC || d3l.bWhiteLineB && d3l.bWhiteLineC; + break; + } + } + + if (!bWhiteSpaceChange || m_pOptions->m_bShowWhiteSpace ) + { + // Make sure that lines with conflict are not overwritten. + if ( c == m_pOptions->m_colorForConflict ) + { + p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) ); + oldConflictY = oldY; + } + else if ( c!=m_pOptions->m_bgColor && oldY>oldConflictY ) + { + p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) ); + } + } + + oldY = y; + + ++line; + if ( m_pOptions->m_bWordWrap ) + { + ++wrapLineIdx; + if(wrapLineIdx>=d3l.linesNeededForDisplay) + { + wrapLineIdx=0; + ++i; + } + } + else + { + ++i; + } + } +} + +void Overview::paintEvent( QPaintEvent* ) +{ + if (m_pDiff3LineList==0 || !m_bPaintingAllowed ) return; + int h = height()-1; + int w = width(); + + + if ( m_pixmap.size() != size() ) + { + if ( m_pOptions->m_bWordWrap ) + { + m_nofLines = 0; + Diff3LineList::const_iterator i; + for( i = m_pDiff3LineList->begin(); i!= m_pDiff3LineList->end(); ++i ) + { + m_nofLines += i->linesNeededForDisplay; + } + } + else + { + m_nofLines = m_pDiff3LineList->size(); + } + + m_pixmap = QPixmap( size() ); + + QPainter p(&m_pixmap); + p.fillRect( rect(), m_pOptions->m_bgColor ); + + if ( !m_bTripleDiff || m_eOverviewMode == eOMNormal ) + { + drawColumn( p, eOMNormal, 0, w, h, m_nofLines ); + } + else + { + drawColumn( p, eOMNormal, 0, w/2, h, m_nofLines ); + drawColumn( p, m_eOverviewMode, w/2, w/2, h, m_nofLines ); + } + } + + QPainter painter( this ); + painter.drawPixmap( 0,0, m_pixmap ); + + int y1 = h * m_firstLine / m_nofLines-1; + int h1 = h * m_pageHeight / m_nofLines+3; + painter.setPen(Qt::black); + painter.drawRect( 1, y1, w-1, h1 ); +} + +WindowTitleWidget::WindowTitleWidget(OptionDialog* pOptionDialog) +{ + m_pOptionDialog = pOptionDialog; + setAutoFillBackground(true); + + QHBoxLayout* pHLayout = new QHBoxLayout(this); + pHLayout->setMargin(2); + pHLayout->setSpacing(2); + + m_pLabel = new QLabel(i18n("Output")+":"); + pHLayout->addWidget( m_pLabel ); + + m_pFileNameLineEdit = new QLineEdit(); + pHLayout->addWidget( m_pFileNameLineEdit, 6 ); + m_pFileNameLineEdit->installEventFilter( this ); + m_pFileNameLineEdit->setReadOnly( true ); + + //m_pBrowseButton = new QPushButton("..."); + //pHLayout->addWidget( m_pBrowseButton, 0 ); + //connect( m_pBrowseButton, SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked())); + + m_pModifiedLabel = new QLabel(i18n("[Modified]")); + pHLayout->addWidget( m_pModifiedLabel ); + m_pModifiedLabel->setMinimumSize( m_pModifiedLabel->sizeHint() ); + m_pModifiedLabel->setText(""); + + pHLayout->addStretch(1); + + m_pEncodingLabel = new QLabel(i18n("Encoding for saving")+":"); + pHLayout->addWidget( m_pEncodingLabel ); + + m_pEncodingSelector = new QComboBox(); + pHLayout->addWidget( m_pEncodingSelector, 2 ); + setEncodings(0,0,0); +} + +void WindowTitleWidget::setFileName( const QString& fileName ) +{ + m_pFileNameLineEdit->setText( QDir::toNativeSeparators(fileName) ); +} + +QString WindowTitleWidget::getFileName() +{ + return m_pFileNameLineEdit->text(); +} + +void WindowTitleWidget::setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodecForB, QTextCodec* pCodecForC ) +{ + m_pEncodingSelector->clear(); + + // First sort codec names: + std::map names; + QList mibs = QTextCodec::availableMibs(); + foreach(int i, mibs) + { + QTextCodec* c = QTextCodec::codecForMib(i); + if ( c!=0 ) + names[QString(c->name())]=c; + } + + if ( pCodecForA ) + m_pEncodingSelector->addItem( i18n("Codec from") + " A: " + pCodecForA->name(), QVariant::fromValue((void*)pCodecForA) ); + if ( pCodecForB ) + m_pEncodingSelector->addItem( i18n("Codec from") + " B: " + pCodecForB->name(), QVariant::fromValue((void*)pCodecForB) ); + if ( pCodecForC ) + m_pEncodingSelector->addItem( i18n("Codec from") + " C: " + pCodecForC->name(), QVariant::fromValue((void*)pCodecForC) ); + + std::map::iterator it; + for(it=names.begin();it!=names.end();++it) + { + m_pEncodingSelector->addItem( it->first, QVariant::fromValue((void*)it->second) ); + } + m_pEncodingSelector->setMinimumSize( m_pEncodingSelector->sizeHint() ); + + if ( pCodecForC && pCodecForB && pCodecForA ) + { + if ( pCodecForA == pCodecForB ) + m_pEncodingSelector->setCurrentIndex( 2 ); // C + else if ( pCodecForA == pCodecForC ) + m_pEncodingSelector->setCurrentIndex( 1 ); // B + else + m_pEncodingSelector->setCurrentIndex( 2 ); // C + } + else if ( pCodecForA && pCodecForB ) + m_pEncodingSelector->setCurrentIndex( 1 ); // B + else + m_pEncodingSelector->setCurrentIndex( 0 ); +} + +QTextCodec* WindowTitleWidget::getEncoding() +{ + return (QTextCodec*)m_pEncodingSelector->itemData( m_pEncodingSelector->currentIndex() ).value(); +} + +void WindowTitleWidget::setEncoding(QTextCodec* pEncoding) +{ + int idx = m_pEncodingSelector->findText( pEncoding->name() ); + if (idx>=0) + m_pEncodingSelector->setCurrentIndex( idx ); +} + +//void WindowTitleWidget::slotBrowseButtonClicked() +//{ +// QString current = m_pFileNameLineEdit->text(); +// +// KURL newURL = KFileDialog::getSaveURL( current, 0, this, i18n("Select file (not saving yet)")); +// if ( !newURL.isEmpty() ) +// { +// m_pFileNameLineEdit->setText( newURL.url() ); +// } +//} + +void WindowTitleWidget::slotSetModified( bool bModified ) +{ + m_pModifiedLabel->setText( bModified ? i18n("[Modified]") : "" ); +} + +bool WindowTitleWidget::eventFilter( QObject* o, QEvent* e ) +{ + if ( e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut ) + { + QPalette p = m_pLabel->palette(); + + QColor c1 = m_pOptionDialog->m_fgColor; + QColor c2 = Qt::lightGray; + if ( e->type()==QEvent::FocusOut ) + c2 = m_pOptionDialog->m_bgColor; + + p.setColor(QPalette::Window, c2); + setPalette( p ); + + p.setColor(QPalette::WindowText, c1); + m_pLabel->setPalette( p ); + m_pEncodingLabel->setPalette( p ); + m_pEncodingSelector->setPalette( p ); + } + if (o == m_pFileNameLineEdit && e->type()==QEvent::Drop) + { + QDropEvent* d = static_cast(e); + + if ( d->mimeData()->hasUrls() ) + { + QList lst = d->mimeData()->urls(); + + if ( lst.count() > 0 ) + { + static_cast(o)->setText( lst[0].toString() ); + static_cast(o)->setFocus(); + return true; + } + } + } + return false; +} + +//#include "mergeresultwindow.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/mergeresultwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/mergeresultwindow.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,442 @@ +/*************************************************************************** + mergeresultwindow.h - description + ------------------- + begin : Mon Mar 18 2002 + copyright : (C) 2002-2006 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef MERGERESULTWINDOW_H +#define MERGERESULTWINDOW_H + +#include "diff.h" + +#include +#include +#include + +class QPainter; + +class Overview : public QWidget +{ + Q_OBJECT +public: + Overview( OptionDialog* pOptions ); + + void init( Diff3LineList* pDiff3LineList, bool bTripleDiff ); + void reset(); + void setRange( int firstLine, int pageHeight ); + void setPaintingAllowed( bool bAllowPainting ); + + enum e_OverviewMode { eOMNormal, eOMAvsB, eOMAvsC, eOMBvsC }; + void setOverviewMode( e_OverviewMode eOverviewMode ); + e_OverviewMode getOverviewMode(); + +public slots: + void setFirstLine(int firstLine); + void slotRedraw(); +signals: + void setLine(int); +private: + const Diff3LineList* m_pDiff3LineList; + OptionDialog* m_pOptions; + bool m_bTripleDiff; + int m_firstLine; + int m_pageHeight; + QPixmap m_pixmap; + bool m_bPaintingAllowed; + e_OverviewMode m_eOverviewMode; + int m_nofLines; + + virtual void paintEvent( QPaintEvent* e ); + virtual void mousePressEvent( QMouseEvent* e ); + virtual void mouseMoveEvent( QMouseEvent* e ); + void drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ); +}; + + +enum e_MergeDetails +{ + eDefault, + eNoChange, + eBChanged, + eCChanged, + eBCChanged, // conflict + eBCChangedAndEqual, // possible conflict + eBDeleted, + eCDeleted, + eBCDeleted, // possible conflict + + eBChanged_CDeleted, // conflict + eCChanged_BDeleted, // conflict + eBAdded, + eCAdded, + eBCAdded, // conflict + eBCAddedAndEqual // possible conflict +}; + +void mergeOneLine( const Diff3Line& d, e_MergeDetails& mergeDetails, bool& bConflict, bool& bLineRemoved, int& src, bool bTwoInputs ); + +enum e_MergeSrcSelector +{ + A=1, + B=2, + C=3 +}; + +class MergeResultWindow : public QWidget +{ + Q_OBJECT +public: + MergeResultWindow( + QWidget* pParent, + OptionDialog* pOptionDialog, + QStatusBar* pStatusBar + ); + + void init( + const LineData* pLineDataA, int sizeA, + const LineData* pLineDataB, int sizeB, + const LineData* pLineDataC, int sizeC, + const Diff3LineList* pDiff3LineList, + TotalDiffStatus* pTotalDiffStatus + ); + + void reset(); + + bool saveDocument( const QString& fileName, QTextCodec* pEncoding ); + int getNrOfUnsolvedConflicts(int* pNrOfWhiteSpaceConflicts=0); + void choose(int selector); + void chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ); + + int getNofColumns(); + int getNofLines(); + int getNofVisibleColumns(); + int getNofVisibleLines(); + QString getSelection(); + void resetSelection(); + void showNrOfConflicts(); + bool isDeltaAboveCurrent(); + bool isDeltaBelowCurrent(); + bool isConflictAboveCurrent(); + bool isConflictBelowCurrent(); + bool isUnsolvedConflictAboveCurrent(); + bool isUnsolvedConflictBelowCurrent(); + bool findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); + void setSelection( int firstLine, int startPos, int lastLine, int endPos ); + void setOverviewMode( Overview::e_OverviewMode eOverviewMode ); + Overview::e_OverviewMode getOverviewMode(); +public slots: + void setFirstLine(int firstLine); + void setFirstColumn(int firstCol); + + void slotGoCurrent(); + void slotGoTop(); + void slotGoBottom(); + void slotGoPrevDelta(); + void slotGoNextDelta(); + void slotGoPrevUnsolvedConflict(); + void slotGoNextUnsolvedConflict(); + void slotGoPrevConflict(); + void slotGoNextConflict(); + void slotAutoSolve(); + void slotUnsolve(); + void slotMergeHistory(); + void slotRegExpAutoMerge(); + void slotSplitDiff( int firstD3lLineIdx, int lastD3lLineIdx ); + void slotJoinDiffs( int firstD3lLineIdx, int lastD3lLineIdx ); + void slotSetFastSelectorLine(int); + void setPaintingAllowed(bool); + void updateSourceMask(); + +signals: + void scroll( int deltaX, int deltaY ); + void modifiedChanged(bool bModified); + void setFastSelectorRange( int line1, int nofLines ); + void sourceMask( int srcMask, int enabledMask ); + void resizeSignal(); + void selectionEnd(); + void newSelection(); + void updateAvailabilities(); + void showPopupMenu( const QPoint& point ); + void noRelevantChangesDetected(); + +private: + void merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly=false, bool bWhiteSpaceOnly=false ); + QString getString( int lineIdx ); + + OptionDialog* m_pOptionDialog; + + const LineData* m_pldA; + const LineData* m_pldB; + const LineData* m_pldC; + int m_sizeA; + int m_sizeB; + int m_sizeC; + + const Diff3LineList* m_pDiff3LineList; + TotalDiffStatus* m_pTotalDiffStatus; + + bool m_bPaintingAllowed; + int m_delayedDrawTimer; + Overview::e_OverviewMode m_eOverviewMode; + +private: + class MergeEditLine + { + public: + MergeEditLine(Diff3LineList::const_iterator i, int src=0){m_id3l=i; m_src=src; m_bLineRemoved=false; } + void setConflict() { m_src=0; m_bLineRemoved=false; m_str=QString(); } + bool isConflict() { return m_src==0 && !m_bLineRemoved && m_str.isNull(); } + void setRemoved(int src=0) { m_src=src; m_bLineRemoved=true; m_str=QString(); } + bool isRemoved() { return m_bLineRemoved; } + bool isEditableText() { return !isConflict() && !isRemoved(); } + void setString( const QString& s ){ m_str=s; m_bLineRemoved=false; m_src=0; } + QString getString( const MergeResultWindow* ); + bool isModified() { return ! m_str.isNull() || (m_bLineRemoved && m_src==0); } + + void setSource( int src, bool bLineRemoved ) { m_src=src; m_bLineRemoved =bLineRemoved; } + int src() { return m_src; } + Diff3LineList::const_iterator id3l(){return m_id3l;} + // getString() is implemented as MergeResultWindow::getString() + private: + Diff3LineList::const_iterator m_id3l; + int m_src; // 1, 2 or 3 for A, B or C respectively, or 0 when line is from neither source. + QString m_str; // String when modified by user or null-string when orig data is used. + bool m_bLineRemoved; + }; + + class MergeEditLineList : private std::list + { // I want to know the size immediately! + private: + typedef std::list BASE; + int m_size; + int* m_pTotalSize; + public: + typedef std::list::iterator iterator; + typedef std::list::const_iterator const_iterator; + MergeEditLineList(){m_size=0; m_pTotalSize=0; } + void clear() { ds(-m_size); BASE::clear(); } + void push_back( const MergeEditLine& m) { ds(+1); BASE::push_back(m); } + void push_front( const MergeEditLine& m) { ds(+1); BASE::push_front(m); } + iterator erase( iterator i ) { ds(-1); return BASE::erase(i); } + iterator insert( iterator i, const MergeEditLine& m ) { ds(+1); return BASE::insert(i,m); } + int size(){ if (!m_pTotalSize) m_size = BASE::size(); return m_size; } + iterator begin(){return BASE::begin();} + iterator end(){return BASE::end();} + MergeEditLine& front(){return BASE::front();} + MergeEditLine& back(){return BASE::back();} + bool empty() { return m_size==0; } + void splice(iterator destPos, MergeEditLineList& srcList, iterator srcFirst, iterator srcLast) + { + int* pTotalSize = getTotalSizePtr() ? getTotalSizePtr() : srcList.getTotalSizePtr(); + srcList.setTotalSizePtr(0); // Force size-recalc after splice, because splice doesn't handle size-tracking + setTotalSizePtr(0); + BASE::splice( destPos, srcList, srcFirst, srcLast ); + srcList.setTotalSizePtr( pTotalSize ); + setTotalSizePtr( pTotalSize ); + } + + void setTotalSizePtr(int* pTotalSize) + { + if ( pTotalSize==0 && m_pTotalSize!=0 ) { *m_pTotalSize -= size(); } + else if ( pTotalSize!=0 && m_pTotalSize==0 ) { *pTotalSize += size(); } + m_pTotalSize = pTotalSize; + } + int* getTotalSizePtr() + { + return m_pTotalSize; + } + + private: + void ds(int deltaSize) + { + m_size+=deltaSize; + if (m_pTotalSize!=0) *m_pTotalSize+=deltaSize; + } + }; + + friend class MergeEditLine; + + struct MergeLine + { + MergeLine() + { + srcSelect=0; mergeDetails=eDefault; d3lLineIdx = -1; srcRangeLength=0; + bConflict=false; bDelta=false; bWhiteSpaceConflict=false; + } + Diff3LineList::const_iterator id3l; + int d3lLineIdx; // Needed to show the correct window pos. + int srcRangeLength; // how many src-lines have this properties + e_MergeDetails mergeDetails; + bool bConflict; + bool bWhiteSpaceConflict; + bool bDelta; + int srcSelect; + MergeEditLineList mergeEditLineList; + void split( MergeLine& ml2, int d3lLineIdx2 ) // The caller must insert the ml2 after this ml in the m_mergeLineList + { + if ( d3lLineIdx2= d3lLineIdx + srcRangeLength ) + return; //Error + ml2.mergeDetails = mergeDetails; + ml2.bConflict = bConflict; + ml2.bWhiteSpaceConflict = bWhiteSpaceConflict; + ml2.bDelta = bDelta; + ml2.srcSelect = srcSelect; + + ml2.d3lLineIdx = d3lLineIdx2; + ml2.srcRangeLength = srcRangeLength - (d3lLineIdx2-d3lLineIdx); + srcRangeLength = d3lLineIdx2-d3lLineIdx; // current MergeLine controls fewer lines + ml2.id3l = id3l; + for(int i=0; iid3l()==ml2.id3l) + { + ml2.mergeEditLineList.splice( ml2.mergeEditLineList.begin(), mergeEditLineList, i, mergeEditLineList.end() ); + return; + } + } + ml2.mergeEditLineList.setTotalSizePtr( mergeEditLineList.getTotalSizePtr() ); + ml2.mergeEditLineList.push_back(MergeEditLine(ml2.id3l)); + } + void join( MergeLine& ml2 ) // The caller must remove the ml2 from the m_mergeLineList after this call + { + srcRangeLength += ml2.srcRangeLength; + ml2.mergeEditLineList.clear(); + mergeEditLineList.clear(); + mergeEditLineList.push_back(MergeEditLine(id3l)); // Create a simple conflict + if ( ml2.bConflict ) bConflict = true; + if ( !ml2.bWhiteSpaceConflict ) bWhiteSpaceConflict = false; + if ( ml2.bDelta ) bDelta = true; + } + }; + +private: + static bool sameKindCheck( const MergeLine& ml1, const MergeLine& ml2 ); + struct HistoryMapEntry + { + MergeEditLineList mellA; + MergeEditLineList mellB; + MergeEditLineList mellC; + MergeEditLineList& choice( bool bThreeInputs ); + bool staysInPlace( bool bThreeInputs, Diff3LineList::const_iterator& iHistoryEnd ); + }; + typedef std::map HistoryMap; + void collectHistoryInformation( int src, Diff3LineList::const_iterator iHistoryBegin, Diff3LineList::const_iterator iHistoryEnd, HistoryMap& historyMap, std::list< HistoryMap::iterator >& hitList ); + + typedef std::list MergeLineList; + MergeLineList m_mergeLineList; + MergeLineList::iterator m_currentMergeLineIt; + int m_currentPos; + bool checkOverviewIgnore(MergeLineList::iterator &i); + + enum e_Direction { eUp, eDown }; + enum e_EndPoint { eDelta, eConflict, eUnsolvedConflict, eLine, eEnd }; + void go( e_Direction eDir, e_EndPoint eEndPoint ); + void calcIteratorFromLineNr( + int line, + MergeLineList::iterator& mlIt, + MergeEditLineList::iterator& melIt + ); + MergeLineList::iterator splitAtDiff3LineIdx( int d3lLineIdx ); + + virtual void paintEvent( QPaintEvent* e ); + + + void myUpdate(int afterMilliSecs); + virtual void timerEvent(QTimerEvent*); + void writeLine( + MyPainter& p, int line, const QString& str, + int srcSelect, e_MergeDetails mergeDetails, int rangeMark, bool bUserModified, bool bLineRemoved, bool bWhiteSpaceConflict + ); + void setFastSelector(MergeLineList::iterator i); + void convertToLinePos( int x, int y, int& line, int& pos ); + virtual void mousePressEvent ( QMouseEvent* e ); + virtual void mouseDoubleClickEvent ( QMouseEvent* e ); + virtual void mouseReleaseEvent ( QMouseEvent * ); + virtual void mouseMoveEvent ( QMouseEvent * ); + virtual void resizeEvent( QResizeEvent* e ); + virtual void keyPressEvent( QKeyEvent* e ); + virtual void wheelEvent( QWheelEvent* e ); + virtual void focusInEvent( QFocusEvent* e ); + + QPixmap m_pixmap; + int m_firstLine; + int m_firstColumn; + int m_nofColumns; + int m_nofLines; + int m_totalSize; //Same as m_nofLines, but calculated differently + bool m_bMyUpdate; + bool m_bInsertMode; + bool m_bModified; + void setModified(bool bModified=true); + + int m_scrollDeltaX; + int m_scrollDeltaY; + int m_cursorXPos; + int m_cursorYPos; + int m_cursorOldXPos; + bool m_bCursorOn; // blinking on and off each second + QTimer m_cursorTimer; + bool m_bCursorUpdate; + QStatusBar* m_pStatusBar; + + Selection m_selection; + + bool deleteSelection2( QString& str, int& x, int& y, + MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt ); + bool doRelevantChangesExist(); +public slots: + void deleteSelection(); + void pasteClipboard(bool bFromSelection); +private slots: + void slotCursorUpdate(); +}; + +class QLineEdit; +class QTextCodec; +class QComboBox; +class QLabel; +class WindowTitleWidget : public QWidget +{ + Q_OBJECT +private: + QLabel* m_pLabel; + QLineEdit* m_pFileNameLineEdit; + //QPushButton* m_pBrowseButton; + QLabel* m_pModifiedLabel; + QLabel* m_pEncodingLabel; + QComboBox* m_pEncodingSelector; + OptionDialog* m_pOptionDialog; +public: + WindowTitleWidget(OptionDialog* pOptionDialog); + QTextCodec* getEncoding(); + void setFileName(const QString& fileName ); + QString getFileName(); + void setEncodings( QTextCodec* pCodecForA, QTextCodec* pCodecForB, QTextCodec* pCodecForC ); + void setEncoding( QTextCodec* pCodec ); + + bool eventFilter( QObject* o, QEvent* e ); +public slots: + void slotSetModified( bool bModified ); +//private slots: +// void slotBrowseButtonClicked(); + +}; + +#endif + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/optiondialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/optiondialog.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1703 @@ +/* + * kdiff3 - Text Diff And Merge Tool + * Copyright (C) 2002-2006 Joachim Eibl, joachim.eibl at gmx.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include // For KFontChooser +#include +#include +#include +#include +#include //For ktoolbar.h + +//#include +#include + +#include "optiondialog.h" +#include "diff.h" +#include "smalldialogs.h" + +#include + +#ifndef KREPLACEMENTS_H +#include +#endif + +static QString s_historyEntryStartRegExpToolTip; +static QString s_historyEntryStartSortKeyOrderToolTip; +static QString s_autoMergeRegExpToolTip; +static QString s_historyStartRegExpToolTip; + +void OptionDialog::addOptionItem(OptionItem* p) +{ + m_optionItemList.push_back(p); +} + +class OptionItem +{ +public: + OptionItem( OptionDialog* pOptionDialog, const QString& saveName ) + { + assert(pOptionDialog!=0); + pOptionDialog->addOptionItem( this ); + m_saveName = saveName; + } + virtual ~OptionItem(){} + virtual void setToDefault()=0; + virtual void setToCurrent()=0; + virtual void apply()=0; + virtual void write(ValueMap*)=0; + virtual void read(ValueMap*)=0; + QString getSaveName(){return m_saveName;} +protected: + QString m_saveName; +}; + +class OptionCheckBox : public QCheckBox, public OptionItem +{ +public: + OptionCheckBox( QString text, bool bDefaultVal, const QString& saveName, bool* pbVar, + QWidget* pParent, OptionDialog* pOD ) + : QCheckBox( text, pParent ), OptionItem( pOD, saveName ) + { + m_pbVar = pbVar; + m_bDefaultVal = bDefaultVal; + } + void setToDefault(){ setChecked( m_bDefaultVal ); } + void setToCurrent(){ setChecked( *m_pbVar ); } + void apply() { *m_pbVar = isChecked(); } + void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pbVar ); } + void read (ValueMap* config){ *m_pbVar = config->readBoolEntry( m_saveName, *m_pbVar ); } +private: + OptionCheckBox( const OptionCheckBox& ); // private copy constructor without implementation + bool* m_pbVar; + bool m_bDefaultVal; +}; + +class OptionRadioButton : public QRadioButton, public OptionItem +{ +public: + OptionRadioButton( QString text, bool bDefaultVal, const QString& saveName, bool* pbVar, + QWidget* pParent, OptionDialog* pOD ) + : QRadioButton( text, pParent ), OptionItem( pOD, saveName ) + { + m_pbVar = pbVar; + m_bDefaultVal = bDefaultVal; + } + void setToDefault(){ setChecked( m_bDefaultVal ); } + void setToCurrent(){ setChecked( *m_pbVar ); } + void apply() { *m_pbVar = isChecked(); } + void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pbVar ); } + void read (ValueMap* config){ *m_pbVar = config->readBoolEntry( m_saveName, *m_pbVar ); } +private: + OptionRadioButton( const OptionRadioButton& ); // private copy constructor without implementation + bool* m_pbVar; + bool m_bDefaultVal; +}; + + +template +class OptionT : public OptionItem +{ +public: + OptionT( const T& defaultVal, const QString& saveName, T* pVar, OptionDialog* pOD ) + : OptionItem( pOD, saveName ) + { + m_pVar = pVar; + *m_pVar = defaultVal; + } + OptionT( const QString& saveName, T* pVar, OptionDialog* pOD ) + : OptionItem( pOD, saveName ) + { + m_pVar = pVar; + } + void setToDefault(){} + void setToCurrent(){} + void apply() {} + void write(ValueMap* vm){ writeEntry( vm, m_saveName, *m_pVar ); } + void read (ValueMap* vm){ readEntry ( vm, m_saveName, *m_pVar ); } +private: + OptionT( const OptionT& ); // private copy constructor without implementation + T* m_pVar; +}; + +template void writeEntry(ValueMap* vm, const QString& saveName, const T& v ) { vm->writeEntry( saveName, v ); } +static void writeEntry(ValueMap* vm, const QString& saveName, const QStringList& v ) { vm->writeEntry( saveName, v, '|' ); } + +static void readEntry(ValueMap* vm, const QString& saveName, bool& v ) { v = vm->readBoolEntry( saveName, v ); } +static void readEntry(ValueMap* vm, const QString& saveName, int& v ) { v = vm->readNumEntry( saveName, v ); } +static void readEntry(ValueMap* vm, const QString& saveName, QSize& v ) { v = vm->readSizeEntry( saveName, &v ); } +static void readEntry(ValueMap* vm, const QString& saveName, QPoint& v ) { v = vm->readPointEntry( saveName, &v ); } +static void readEntry(ValueMap* vm, const QString& saveName, QStringList& v ){ v = vm->readListEntry( saveName, QStringList(), '|' ); } + +typedef OptionT OptionToggleAction; +typedef OptionT OptionNum; +typedef OptionT OptionPoint; +typedef OptionT OptionSize; +typedef OptionT OptionStringList; + +class OptionFontChooser : public KFontChooser, public OptionItem +{ +public: + OptionFontChooser( const QFont& defaultVal, const QString& saveName, QFont* pbVar, QWidget* pParent, OptionDialog* pOD ) + :KFontChooser( pParent,"font",true/*onlyFixed*/,QStringList(),false,6 ), + OptionItem( pOD, saveName ) + { + m_pbVar = pbVar; + *m_pbVar = defaultVal; + m_default = defaultVal; + } + void setToDefault(){ setFont( m_default, true /*only fixed*/ ); } + void setToCurrent(){ setFont( *m_pbVar, true /*only fixed*/ ); } + void apply() { *m_pbVar = font();} + void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pbVar ); } + void read (ValueMap* config){ *m_pbVar = config->readFontEntry( m_saveName, m_pbVar ); } +private: + OptionFontChooser( const OptionToggleAction& ); // private copy constructor without implementation + QFont* m_pbVar; + QFont m_default; +}; + +class OptionColorButton : public KColorButton, public OptionItem +{ +public: + OptionColorButton( QColor defaultVal, const QString& saveName, QColor* pVar, QWidget* pParent, OptionDialog* pOD ) + : KColorButton( pParent ), OptionItem( pOD, saveName ) + { + m_pVar = pVar; + m_defaultVal = defaultVal; + } + void setToDefault(){ setColor( m_defaultVal ); } + void setToCurrent(){ setColor( *m_pVar ); } + void apply() { *m_pVar = color(); } + void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pVar ); } + void read (ValueMap* config){ *m_pVar = config->readColorEntry( m_saveName, m_pVar ); } +private: + OptionColorButton( const OptionColorButton& ); // private copy constructor without implementation + QColor* m_pVar; + QColor m_defaultVal; +}; + +class OptionLineEdit : public QComboBox, public OptionItem +{ +public: + OptionLineEdit( const QString& defaultVal, const QString& saveName, QString* pVar, + QWidget* pParent, OptionDialog* pOD ) + : QComboBox( pParent ), OptionItem( pOD, saveName ) + { + setMinimumWidth(50); + setEditable(true); + m_pVar = pVar; + m_defaultVal = defaultVal; + m_list.push_back(defaultVal); + insertText(); + } + void setToDefault(){ setEditText( m_defaultVal ); } + void setToCurrent(){ setEditText( *m_pVar ); } + 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, QStringList(m_defaultVal), '|' ); + if ( !m_list.empty() ) *m_pVar = m_list.front(); + clear(); + insertItems(0,m_list); + } +private: + void insertText() + { // Check if the text exists. If yes remove it and push it in as first element + QString current = currentText(); + m_list.removeAll( current ); + m_list.push_front( current ); + clear(); + if ( m_list.size()>10 ) + m_list.erase( m_list.begin()+10, m_list.end() ); + insertItems(0,m_list); + } + OptionLineEdit( const OptionLineEdit& ); // private copy constructor without implementation + QString* m_pVar; + QString m_defaultVal; + QStringList m_list; +}; + +#if defined QT_NO_VALIDATOR +#error No validator +#endif +class OptionIntEdit : public QLineEdit, public OptionItem +{ +public: + OptionIntEdit( int defaultVal, const QString& saveName, int* pVar, int rangeMin, int rangeMax, + QWidget* pParent, OptionDialog* pOD ) + : QLineEdit( pParent ), OptionItem( pOD, saveName ) + { + m_pVar = pVar; + m_defaultVal = defaultVal; + QIntValidator* v = new QIntValidator(this); + v->setRange( rangeMin, rangeMax ); + setValidator( v ); + } + void setToDefault(){ QString s; s.setNum(m_defaultVal); setText( s ); } + void setToCurrent(){ QString s; s.setNum(*m_pVar); setText( s ); } + void apply() { const QIntValidator* v=static_cast(validator()); + *m_pVar = minMaxLimiter( text().toInt(), v->bottom(), v->top()); + setText( QString::number(*m_pVar) ); } + void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pVar ); } + void read (ValueMap* config){ *m_pVar = config->readNumEntry( m_saveName, *m_pVar ); } +private: + OptionIntEdit( const OptionIntEdit& ); // private copy constructor without implementation + int* m_pVar; + int m_defaultVal; +}; + +class OptionComboBox : public QComboBox, public OptionItem +{ +public: + OptionComboBox( int defaultVal, const QString& saveName, int* pVarNum, + QWidget* pParent, OptionDialog* pOD ) + : QComboBox( pParent ), OptionItem( pOD, saveName ) + { + setMinimumWidth(50); + m_pVarNum = pVarNum; + m_pVarStr = 0; + m_defaultVal = defaultVal; + setEditable(false); + } + OptionComboBox( int defaultVal, const QString& saveName, QString* pVarStr, + QWidget* pParent, OptionDialog* pOD ) + : QComboBox( pParent ), OptionItem( pOD, saveName ) + { + m_pVarNum = 0; + m_pVarStr = pVarStr; + m_defaultVal = defaultVal; + setEditable(false); + } + void setToDefault() + { + setCurrentIndex( m_defaultVal ); + if (m_pVarStr!=0){ *m_pVarStr=currentText(); } + } + void setToCurrent() + { + if (m_pVarNum!=0) setCurrentIndex( *m_pVarNum ); + else setText( *m_pVarStr ); + } + void apply() + { + if (m_pVarNum!=0){ *m_pVarNum = currentIndex(); } + else { *m_pVarStr = currentText(); } + } + void write(ValueMap* config) + { + if (m_pVarStr!=0) config->writeEntry(m_saveName, *m_pVarStr ); + else config->writeEntry(m_saveName, *m_pVarNum ); + } + void read (ValueMap* config) + { + if (m_pVarStr!=0) setText( config->readEntry( m_saveName, currentText() ) ); + else *m_pVarNum = config->readNumEntry( m_saveName, *m_pVarNum ); + } +private: + OptionComboBox( const OptionIntEdit& ); // private copy constructor without implementation + int* m_pVarNum; + QString* m_pVarStr; + int m_defaultVal; + + void setText(const QString& s) + { + // Find the string in the combobox-list, don't change the value if nothing fits. + for( int i=0; i m_codecVec; + QTextCodec** m_ppVarCodec; +public: + OptionEncodingComboBox( const QString& saveName, QTextCodec** ppVarCodec, + QWidget* pParent, OptionDialog* pOD ) + : QComboBox( pParent ), OptionItem( pOD, saveName ) + { + m_ppVarCodec = ppVarCodec; + insertCodec( i18n("Unicode, 8 bit"), QTextCodec::codecForName("UTF-8") ); + insertCodec( i18n("Unicode"), QTextCodec::codecForName("iso-10646-UCS-2") ); + insertCodec( i18n("Latin1"), QTextCodec::codecForName("iso 8859-1") ); + + // First sort codec names: + std::map names; + QList mibs = QTextCodec::availableMibs(); + foreach(int i, mibs) + { + QTextCodec* c = QTextCodec::codecForMib(i); + if ( c!=0 ) + names[QString(c->name()).toUpper()]=c; + } + + std::map::iterator it; + for(it=names.begin();it!=names.end();++it) + { + insertCodec( "", it->second ); + } + + this->setToolTip( i18n( + "Change this if non-ASCII characters are not displayed correctly." + )); + } + void insertCodec( const QString& visibleCodecName, QTextCodec* c ) + { + if (c!=0) + { + for( unsigned int i=0; iname()) : visibleCodecName+" ("+c->name()+")", m_codecVec.size() ); + m_codecVec.push_back( c ); + } + } + void setToDefault() + { + QString defaultName = QTextCodec::codecForLocale()->name(); + for(int i=0;iwriteEntry(m_saveName, QString((*m_ppVarCodec)->name()) ); + } + void read (ValueMap* config) + { + QString codecName = config->readEntry( m_saveName, m_codecVec[ currentIndex() ]->name() ); + for(unsigned int i=0; iname() ) + { + setCurrentIndex( i ); + if (m_ppVarCodec!=0) *m_ppVarCodec = m_codecVec[i]; + break; + } + } + } +}; + + +OptionDialog::OptionDialog( bool bShowDirMergeSettings, QWidget *parent, char *name ) + :KDialogBase( IconList, i18n("Configure"), Help|Default|Apply|Ok|Cancel, + Ok, parent, name, true /*modal*/, true ) +{ + setHelp( "kdiff3/index.html", QString::null ); + + setupFontPage(); + setupColorPage(); + setupEditPage(); + setupDiffPage(); + setupMergePage(); + setupOtherOptions(); + if (bShowDirMergeSettings) + setupDirectoryMergePage(); + + setupRegionalPage(); + setupIntegrationPage(); + + //setupKeysPage(); + + // Initialize all values in the dialog + resetToDefaults(); + slotApply(); +} + +OptionDialog::~OptionDialog( void ) +{ +} + +void OptionDialog::setupOtherOptions() +{ + new OptionToggleAction( false, "AutoAdvance", &m_bAutoAdvance, this ); + new OptionToggleAction( true, "ShowWhiteSpaceCharacters", &m_bShowWhiteSpaceCharacters, this ); + new OptionToggleAction( true, "ShowWhiteSpace", &m_bShowWhiteSpace, this ); + new OptionToggleAction( false, "ShowLineNumbers", &m_bShowLineNumbers, this ); + new OptionToggleAction( true, "HorizDiffWindowSplitting", &m_bHorizDiffWindowSplitting, this ); + new OptionToggleAction( false, "WordWrap", &m_bWordWrap, this ); + + new OptionToggleAction( true, "ShowIdenticalFiles", &m_bDmShowIdenticalFiles, this ); + + new OptionToggleAction( true, "Show Toolbar", &m_bShowToolBar, this ); + new OptionToggleAction( true, "Show Statusbar", &m_bShowStatusBar, this ); + + new OptionNum( (int)KToolBar::Top, "ToolBarPos", &m_toolBarPos, this ); + new OptionSize( QSize(600,400),"Geometry", &m_geometry, this ); + new OptionPoint( QPoint(0,22), "Position", &m_position, this ); + new OptionToggleAction( false, "WindowStateMaximised", &m_bMaximised, this ); + + new OptionStringList( "RecentAFiles", &m_recentAFiles, this ); + new OptionStringList( "RecentBFiles", &m_recentBFiles, this ); + new OptionStringList( "RecentCFiles", &m_recentCFiles, this ); + new OptionStringList( "RecentOutputFiles", &m_recentOutputFiles, this ); +} + +void OptionDialog::setupFontPage( void ) +{ + QFrame *page = addPage( i18n("Font"), i18n("Editor & Diff Output Font" ), + BarIcon("fonts", KIcon::SizeMedium ) ); + + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + QFont defaultFont = +#ifdef _WIN32 + QFont("Courier New", 10 ); +#elif defined( KREPLACEMENTS_H ) + QFont("Courier", 10 ); +#else + KGlobalSettings::fixedFont(); +#endif + + OptionFontChooser* pFontChooser = new OptionFontChooser( defaultFont, "Font", &m_font, page, this ); + topLayout->addWidget( pFontChooser ); + + QGridLayout *gbox = new QGridLayout(); + topLayout->addLayout( gbox ); + int line=0; + + OptionCheckBox* pItalicDeltas = new OptionCheckBox( i18n("Italic font for deltas"), false, "ItalicForDeltas", &m_bItalicForDeltas, page, this ); + gbox->addWidget( pItalicDeltas, line, 0, 1, 2 ); + pItalicDeltas->setToolTip( i18n( + "Selects the italic version of the font for differences.\n" + "If the font doesn't support italic characters, then this does nothing.") + ); +} + + +void OptionDialog::setupColorPage( void ) +{ + QFrame *page = addPage( i18n("Color"), i18n("Colors Settings"), + BarIcon("colorize", KIcon::SizeMedium ) ); + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + + QGridLayout *gbox = new QGridLayout(); + gbox->setColumnStretch(1,5); + topLayout->addLayout(gbox); + + QLabel* label; + int line = 0; + + int depth = QPixmap::defaultDepth(); + bool bLowColor = depth<=8; + + label = new QLabel( i18n("Editor and Diff Views:"), page ); + gbox->addWidget( label, line, 0 ); + QFont f( label->font() ); + f.setBold(true); + label->setFont(f); + ++line; + + OptionColorButton* pFgColor = new OptionColorButton( Qt::black,"FgColor", &m_fgColor, page, this ); + label = new QLabel( i18n("Foreground color:"), page ); + label->setBuddy(pFgColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pFgColor, line, 1 ); + ++line; + + OptionColorButton* pBgColor = new OptionColorButton( Qt::white, "BgColor", &m_bgColor, page, this ); + label = new QLabel( i18n("Background color:"), page ); + label->setBuddy(pBgColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pBgColor, line, 1 ); + + ++line; + + OptionColorButton* pDiffBgColor = new OptionColorButton( + bLowColor ? QColor(Qt::lightGray) : qRgb(224,224,224), "DiffBgColor", &m_diffBgColor, page, this ); + label = new QLabel( i18n("Diff background color:"), page ); + label->setBuddy(pDiffBgColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pDiffBgColor, line, 1 ); + ++line; + + OptionColorButton* pColorA = new OptionColorButton( + bLowColor ? qRgb(0,0,255) : qRgb(0,0,200)/*blue*/, "ColorA", &m_colorA, page, this ); + label = new QLabel( i18n("Color A:"), page ); + label->setBuddy(pColorA); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColorA, line, 1 ); + ++line; + + OptionColorButton* pColorB = new OptionColorButton( + bLowColor ? qRgb(0,128,0) : qRgb(0,150,0)/*green*/, "ColorB", &m_colorB, page, this ); + label = new QLabel( i18n("Color B:"), page ); + label->setBuddy(pColorB); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColorB, line, 1 ); + ++line; + + OptionColorButton* pColorC = new OptionColorButton( + bLowColor ? qRgb(128,0,128) : qRgb(150,0,150)/*magenta*/, "ColorC", &m_colorC, page, this ); + label = new QLabel( i18n("Color C:"), page ); + label->setBuddy(pColorC); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColorC, line, 1 ); + ++line; + + OptionColorButton* pColorForConflict = new OptionColorButton( Qt::red, "ColorForConflict", &m_colorForConflict, page, this ); + label = new QLabel( i18n("Conflict color:"), page ); + label->setBuddy(pColorForConflict); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColorForConflict, line, 1 ); + ++line; + + OptionColorButton* pColor = new OptionColorButton( + bLowColor ? qRgb(192,192,192) : qRgb(220,220,100), "CurrentRangeBgColor", &m_currentRangeBgColor, page, this ); + label = new QLabel( i18n("Current range background color:"), page ); + label->setBuddy(pColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColor, line, 1 ); + ++line; + + pColor = new OptionColorButton( + bLowColor ? qRgb(255,255,0) : qRgb(255,255,150), "CurrentRangeDiffBgColor", &m_currentRangeDiffBgColor, page, this ); + label = new QLabel( i18n("Current range diff background color:"), page ); + label->setBuddy(pColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColor, line, 1 ); + ++line; + + pColor = new OptionColorButton( qRgb(0xff,0xd0,0x80), "ManualAlignmentRangeColor", &m_manualHelpRangeColor, page, this ); + label = new QLabel( i18n("Color for manually aligned difference ranges:"), page ); + label->setBuddy(pColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColor, line, 1 ); + ++line; + + label = new QLabel( i18n("Directory Comparison View:"), page ); + gbox->addWidget( label, line, 0 ); + label->setFont(f); + ++line; + + pColor = new OptionColorButton( qRgb(0,0xd0,0), "NewestFileColor", &m_newestFileColor, page, this ); + label = new QLabel( i18n("Newest file color:"), page ); + label->setBuddy(pColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColor, line, 1 ); + QString dirColorTip = i18n( "Changing this color will only be effective when starting the next directory comparison."); + label->setToolTip( dirColorTip ); + ++line; + + pColor = new OptionColorButton( qRgb(0xf0,0,0), "OldestFileColor", &m_oldestFileColor, page, this ); + label = new QLabel( i18n("Oldest file color:"), page ); + label->setBuddy(pColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColor, line, 1 ); + label->setToolTip( dirColorTip ); + ++line; + + pColor = new OptionColorButton( qRgb(0xc0,0xc0,0), "MidAgeFileColor", &m_midAgeFileColor, page, this ); + label = new QLabel( i18n("Middle age file color:"), page ); + label->setBuddy(pColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColor, line, 1 ); + label->setToolTip( dirColorTip ); + ++line; + + pColor = new OptionColorButton( qRgb(0,0,0), "MissingFileColor", &m_missingFileColor, page, this ); + label = new QLabel( i18n("Color for missing files:"), page ); + label->setBuddy(pColor); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pColor, line, 1 ); + label->setToolTip( dirColorTip ); + ++line; + + topLayout->addStretch(10); +} + + +void OptionDialog::setupEditPage( void ) +{ + QFrame *page = addPage( i18n("Editor"), i18n("Editor Behavior"), + BarIcon("edit", KIcon::SizeMedium ) ); + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + + QGridLayout *gbox = new QGridLayout(); + gbox->setColumnStretch(1,5); + topLayout->addLayout( gbox ); + QLabel* label; + int line=0; + + OptionCheckBox* pReplaceTabs = new OptionCheckBox( i18n("Tab inserts spaces"), false, "ReplaceTabs", &m_bReplaceTabs, page, this ); + gbox->addWidget( pReplaceTabs, line, 0, 1, 2 ); + pReplaceTabs->setToolTip( i18n( + "On: Pressing tab generates the appropriate number of spaces.\n" + "Off: A Tab-character will be inserted.") + ); + ++line; + + OptionIntEdit* pTabSize = new OptionIntEdit( 8, "TabSize", &m_tabSize, 1, 100, page, this ); + label = new QLabel( i18n("Tab size:"), page ); + label->setBuddy( pTabSize ); + gbox->addWidget( label, line, 0 ); + gbox->addWidget( pTabSize, line, 1 ); + ++line; + + OptionCheckBox* pAutoIndentation = new OptionCheckBox( i18n("Auto indentation"), true, "AutoIndentation", &m_bAutoIndentation, page, this ); + gbox->addWidget( pAutoIndentation, line, 0, 1, 2 ); + pAutoIndentation->setToolTip( i18n( + "On: The indentation of the previous line is used for a new line.\n" + )); + ++line; + + OptionCheckBox* pAutoCopySelection = new OptionCheckBox( i18n("Auto copy selection"), false, "AutoCopySelection", &m_bAutoCopySelection, page, this ); + gbox->addWidget( pAutoCopySelection, line, 0, 1, 2 ); + pAutoCopySelection->setToolTip( i18n( + "On: Any selection is immediately written to the clipboard.\n" + "Off: You must explicitely copy e.g. via Ctrl-C." + )); + ++line; + + label = new QLabel( i18n("Line end style:"), page ); + gbox->addWidget( label, line, 0 ); + #ifdef _WIN32 + int defaultLineEndStyle = eLineEndDos; + #else + int defaultLineEndStyle = eLineEndUnix; + #endif + OptionComboBox* pLineEndStyle = new OptionComboBox( defaultLineEndStyle, "LineEndStyle", &m_lineEndStyle, page, this ); + gbox->addWidget( pLineEndStyle, line, 1 ); + pLineEndStyle->insertItem( eLineEndUnix, "Unix" ); + pLineEndStyle->insertItem( eLineEndDos, "Dos/Windows" ); + label->setToolTip( i18n( + "Sets the line endings for when an edited file is saved.\n" + "DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A") + ); + ++line; + + topLayout->addStretch(10); +} + + +void OptionDialog::setupDiffPage( void ) +{ + QFrame *page = addPage( i18n("Diff"), i18n("Diff Settings"), + BarIcon("misc", KIcon::SizeMedium ) ); + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + QGridLayout *gbox = new QGridLayout(); + gbox->setColumnStretch(1,5); + topLayout->addLayout( gbox ); + int line=0; + + QLabel* label=0; + + OptionCheckBox* pPreserveCarriageReturn = new OptionCheckBox( i18n("Preserve carriage return"), false, "PreserveCarriageReturn", &m_bPreserveCarriageReturn, page, this ); + gbox->addWidget( pPreserveCarriageReturn, line, 0, 1, 2 ); + pPreserveCarriageReturn->setToolTip( i18n( + "Show carriage return characters '\\r' if they exist.\n" + "Helps to compare files that were modified under different operating systems.") + ); + ++line; + + OptionCheckBox* pIgnoreNumbers = new OptionCheckBox( i18n("Ignore numbers"), false, "IgnoreNumbers", &m_bIgnoreNumbers, page, this ); + gbox->addWidget( pIgnoreNumbers, line, 0, 1, 2 ); + pIgnoreNumbers->setToolTip( i18n( + "Ignore number characters during line matching phase. (Similar to Ignore white space.)\n" + "Might help to compare files with numeric data.") + ); + ++line; + + OptionCheckBox* pIgnoreComments = new OptionCheckBox( i18n("Ignore C/C++ comments"), false, "IgnoreComments", &m_bIgnoreComments, page, this ); + gbox->addWidget( pIgnoreComments, line, 0, 1, 2 ); + pIgnoreComments->setToolTip( i18n( "Treat C/C++ comments like white space.") + ); + ++line; + + OptionCheckBox* pIgnoreCase = new OptionCheckBox( i18n("Ignore case"), false, "IgnoreCase", &m_bIgnoreCase, page, this ); + gbox->addWidget( pIgnoreCase, line, 0, 1, 2 ); + pIgnoreCase->setToolTip( i18n( + "Treat case differences like white space changes. ('a'<=>'A')") + ); + ++line; + + label = new QLabel( i18n("Preprocessor command:"), page ); + gbox->addWidget( label, line, 0 ); + OptionLineEdit* pLE = new OptionLineEdit( "", "PreProcessorCmd", &m_PreProcessorCmd, page, this ); + gbox->addWidget( pLE, line, 1 ); + label->setToolTip( i18n("User defined pre-processing. (See the docs for details.)") ); + ++line; + + label = new QLabel( i18n("Line-matching preprocessor command:"), page ); + gbox->addWidget( label, line, 0 ); + pLE = new OptionLineEdit( "", "LineMatchingPreProcessorCmd", &m_LineMatchingPreProcessorCmd, page, this ); + gbox->addWidget( pLE, line, 1 ); + label->setToolTip( i18n("This pre-processor is only used during line matching.\n(See the docs for details.)") ); + ++line; + + OptionCheckBox* pTryHard = new OptionCheckBox( i18n("Try hard (slower)"), true, "TryHard", &m_bTryHard, page, this ); + gbox->addWidget( pTryHard, line, 0, 1, 2 ); + pTryHard->setToolTip( i18n( + "Enables the --minimal option for the external diff.\n" + "The analysis of big files will be much slower.") + ); + ++line; + + label = new QLabel( i18n("Auto advance delay (ms):"), page ); + gbox->addWidget( label, line, 0 ); + OptionIntEdit* pAutoAdvanceDelay = new OptionIntEdit( 500, "AutoAdvanceDelay", &m_autoAdvanceDelay, 0, 2000, page, this ); + gbox->addWidget( pAutoAdvanceDelay, line, 1 ); + label->setToolTip(i18n( + "When in Auto-Advance mode the result of the current selection is shown \n" + "for the specified time, before jumping to the next conflict. Range: 0-2000 ms") + ); + ++line; + + topLayout->addStretch(10); +} + +void OptionDialog::setupMergePage( void ) +{ + QFrame *page = addPage( i18n("Merge"), i18n("Merge Settings"), + BarIcon("misc", KIcon::SizeMedium ) ); + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + QGridLayout *gbox = new QGridLayout(); + gbox->setColumnStretch(1,5); + topLayout->addLayout( gbox ); + int line=0; + + QLabel* label=0; + + label = new QLabel( i18n("White space 2-file merge default:"), page ); + gbox->addWidget( label, line, 0 ); + OptionComboBox* pWhiteSpace2FileMergeDefault = new OptionComboBox( 0, "WhiteSpace2FileMergeDefault", &m_whiteSpace2FileMergeDefault, page, this ); + gbox->addWidget( pWhiteSpace2FileMergeDefault, line, 1 ); + pWhiteSpace2FileMergeDefault->insertItem( 0, i18n("Manual Choice") ); + pWhiteSpace2FileMergeDefault->insertItem( 1, "A" ); + pWhiteSpace2FileMergeDefault->insertItem( 2, "B" ); + label->setToolTip( i18n( + "Allow the merge algorithm to automatically select an input for " + "white-space-only changes." ) + ); + ++line; + + label = new QLabel( i18n("White space 3-file merge default:"), page ); + gbox->addWidget( label, line, 0 ); + OptionComboBox* pWhiteSpace3FileMergeDefault = new OptionComboBox( 0, "WhiteSpace3FileMergeDefault", &m_whiteSpace3FileMergeDefault, page, this ); + gbox->addWidget( pWhiteSpace3FileMergeDefault, line, 1 ); + pWhiteSpace3FileMergeDefault->insertItem( 0, i18n("Manual Choice") ); + pWhiteSpace3FileMergeDefault->insertItem( 1, "A" ); + pWhiteSpace3FileMergeDefault->insertItem( 2, "B" ); + pWhiteSpace3FileMergeDefault->insertItem( 3, "C" ); + label->setToolTip( i18n( + "Allow the merge algorithm to automatically select an input for " + "white-space-only changes." ) + ); + ++line; + + QGroupBox* pGroupBox = new QGroupBox( i18n("Automatic Merge Regular Expression") ); + gbox->addWidget( pGroupBox, line, 0, 1, 2 ); + ++line; + { + QGridLayout* gbox = new QGridLayout( pGroupBox ); + gbox->setMargin(spacingHint()); + gbox->setColumnStretch(1,10); + int line = 0; + + label = new QLabel( i18n("Auto merge regular expression:"), page ); + gbox->addWidget( label, line, 0 ); + m_pAutoMergeRegExpLineEdit = new OptionLineEdit( ".*\\$(Version|Header|Date|Author).*\\$.*", "AutoMergeRegExp", &m_autoMergeRegExp, page, this ); + gbox->addWidget( m_pAutoMergeRegExpLineEdit, line, 1 ); + s_autoMergeRegExpToolTip = i18n("Regular expression for lines where KDiff3 should automatically choose one source.\n" + "When a line with a conflict matches the regular expression then\n" + "- if available - C, otherwise B will be chosen."); + label->setToolTip( s_autoMergeRegExpToolTip ); + ++line; + + OptionCheckBox* pAutoMergeRegExp = new OptionCheckBox( i18n("Run regular expression auto merge on merge start"), false, "RunRegExpAutoMergeOnMergeStart", &m_bRunRegExpAutoMergeOnMergeStart, page, this ); + gbox->addWidget( pAutoMergeRegExp, line, 0, 1, 2 ); + pAutoMergeRegExp->setToolTip( i18n( "Run the merge for auto merge regular expressions\n" + "immediately when a merge starts.\n")); + ++line; + } + + pGroupBox = new QGroupBox( i18n("Version Control History Merging") ); + gbox->addWidget( pGroupBox, line, 0, 1, 2 ); + ++line; + { + QGridLayout* gbox = new QGridLayout( pGroupBox ); + gbox->setMargin( spacingHint() ); + gbox->setColumnStretch(1,10); + int line = 0; + + label = new QLabel( i18n("History start regular expression:"), page ); + gbox->addWidget( label, line, 0 ); + 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$\"-keyword.\n" + "Default value: \".*\\$Log.*\\$.*\""); + label->setToolTip( s_historyStartRegExpToolTip ); + ++line; + + label = new QLabel( i18n("History entry start regular expression:"), page ); + gbox->addWidget( label, line, 0 ); + // Example line: "** \main\rolle_fsp_dev_008\1 17 Aug 2001 10:45:44 rolle" + QString historyEntryStartDefault = + "\\s*\\\\main\\\\(\\S+)\\s+" // Start with "\main\" + "([0-9]+) " // day + "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) " //month + "([0-9][0-9][0-9][0-9]) " // year + "([0-9][0-9]:[0-9][0-9]:[0-9][0-9])\\s+(.*)"; // time, name + + m_pHistoryEntryStartRegExpLineEdit = new OptionLineEdit( historyEntryStartDefault, "HistoryEntryStartRegExp", &m_historyEntryStartRegExp, page, this ); + gbox->addWidget( m_pHistoryEntryStartRegExpLineEdit, line, 1 ); + s_historyEntryStartRegExpToolTip = i18n("A version control history entry consists of several lines.\n" + "Specify the regular expression to detect the first line (without the leading comment).\n" + "Use parentheses to group the keys you want to use for sorting.\n" + "If left empty, then KDiff3 assumes that empty lines separate history entries.\n" + "See the documentation for details."); + label->setToolTip( s_historyEntryStartRegExpToolTip ); + ++line; + + m_pHistoryMergeSorting = new OptionCheckBox( i18n("History merge sorting"), false, "HistoryMergeSorting", &m_bHistoryMergeSorting, page, this ); + gbox->addWidget( m_pHistoryMergeSorting, line, 0, 1, 2 ); + m_pHistoryMergeSorting->setToolTip( i18n("Sort version control history by a key.") ); + ++line; + //QString branch = newHistoryEntry.cap(1); + //int day = newHistoryEntry.cap(2).toInt(); + //int month = QString("Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec").find(newHistoryEntry.cap(3))/4 + 1; + //int year = newHistoryEntry.cap(4).toInt(); + //QString time = newHistoryEntry.cap(5); + //QString name = newHistoryEntry.cap(6); + QString defaultSortKeyOrder = "4,3,2,5,1,6"; //QDate(year,month,day).toString(Qt::ISODate) +" "+ time + " " + branch + " " + name; + + label = new QLabel( i18n("History entry start sort key order:"), page ); + gbox->addWidget( label, line, 0 ); + m_pHistorySortKeyOrderLineEdit = new OptionLineEdit( defaultSortKeyOrder, "HistoryEntryStartSortKeyOrder", &m_historyEntryStartSortKeyOrder, page, this ); + gbox->addWidget( m_pHistorySortKeyOrderLineEdit, line, 1 ); + s_historyEntryStartSortKeyOrderToolTip = i18n("Each parentheses used in the regular expression for the history start entry\n" + "groups a key that can be used for sorting.\n" + "Specify the list of keys (that are numbered in order of occurrence\n" + "starting with 1) using ',' as separator (e.g. \"4,5,6,1,2,3,7\").\n" + "If left empty, then no sorting will be done.\n" + "See the documentation for details."); + label->setToolTip( s_historyEntryStartSortKeyOrderToolTip ); + m_pHistorySortKeyOrderLineEdit->setEnabled(false); + connect( m_pHistoryMergeSorting, SIGNAL(toggled(bool)), m_pHistorySortKeyOrderLineEdit, SLOT(setEnabled(bool))); + ++line; + + m_pHistoryAutoMerge = new OptionCheckBox( i18n("Merge version control history on merge start"), false, "RunHistoryAutoMergeOnMergeStart", &m_bRunHistoryAutoMergeOnMergeStart, page, this ); + gbox->addWidget( m_pHistoryAutoMerge, line, 0, 1, 2 ); + m_pHistoryAutoMerge->setToolTip( i18n("Run version control history automerge on merge start.") ); + ++line; + } + + QPushButton* pButton = new QPushButton( i18n("Test your regular expressions"), page ); + gbox->addWidget( pButton, line, 0 ); + connect( pButton, SIGNAL(clicked()), this, SLOT(slotHistoryMergeRegExpTester())); + ++line; + + label = new QLabel( i18n("Irrelevant merge command:"), page ); + gbox->addWidget( label, line, 0 ); + OptionLineEdit* pLE = new OptionLineEdit( "", "IrrelevantMergeCmd", &m_IrrelevantMergeCmd, page, this ); + gbox->addWidget( pLE, line, 1 ); + label->setToolTip( i18n("If specified this script is run after automerge\n" + "when no other relevant changes were detected.\n" + "Called with the parameters: filename1 filename2 filename3") ); + ++line; + + topLayout->addStretch(10); +} + +void OptionDialog::setupDirectoryMergePage( void ) +{ + QFrame *page = addPage( i18n("Directory Merge"), i18n("Directory Merge"), + BarIcon("folder", KIcon::SizeMedium ) ); + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + QGridLayout *gbox = new QGridLayout(); + gbox->setColumnStretch(1,5); + topLayout->addLayout( gbox ); + int line=0; + + OptionCheckBox* pRecursiveDirs = new OptionCheckBox( i18n("Recursive directories"), true, "RecursiveDirs", &m_bDmRecursiveDirs, page, this ); + gbox->addWidget( pRecursiveDirs, line, 0, 1, 2 ); + pRecursiveDirs->setToolTip( i18n("Whether to analyze subdirectories or not.") ); + ++line; + QLabel* label = new QLabel( i18n("File pattern(s):"), page ); + gbox->addWidget( label, line, 0 ); + OptionLineEdit* pFilePattern = new OptionLineEdit( "*", "FilePattern", &m_DmFilePattern, page, this ); + gbox->addWidget( pFilePattern, line, 1 ); + label->setToolTip( i18n( + "Pattern(s) of files to be analyzed. \n" + "Wildcards: '*' and '?'\n" + "Several Patterns can be specified by using the separator: ';'" + )); + ++line; + + label = new QLabel( i18n("File-anti-pattern(s):"), page ); + gbox->addWidget( label, line, 0 ); + OptionLineEdit* pFileAntiPattern = new OptionLineEdit( "*.orig;*.o;*.obj", "FileAntiPattern", &m_DmFileAntiPattern, page, this ); + gbox->addWidget( pFileAntiPattern, line, 1 ); + label->setToolTip( i18n( + "Pattern(s) of files to be excluded from analysis. \n" + "Wildcards: '*' and '?'\n" + "Several Patterns can be specified by using the separator: ';'" + )); + ++line; + + label = new QLabel( i18n("Dir-anti-pattern(s):"), page ); + gbox->addWidget( label, line, 0 ); + OptionLineEdit* pDirAntiPattern = new OptionLineEdit( "CVS;.deps;.svn", "DirAntiPattern", &m_DmDirAntiPattern, page, this ); + gbox->addWidget( pDirAntiPattern, line, 1 ); + label->setToolTip( i18n( + "Pattern(s) of directories to be excluded from analysis. \n" + "Wildcards: '*' and '?'\n" + "Several Patterns can be specified by using the separator: ';'" + )); + ++line; + + OptionCheckBox* pUseCvsIgnore = new OptionCheckBox( i18n("Use .cvsignore"), false, "UseCvsIgnore", &m_bDmUseCvsIgnore, page, this ); + gbox->addWidget( pUseCvsIgnore, line, 0, 1, 2 ); + pUseCvsIgnore->setToolTip( i18n( + "Extends the antipattern to anything that would be ignored by CVS.\n" + "Via local \".cvsignore\"-files this can be directory specific." + )); + ++line; + + OptionCheckBox* pFindHidden = new OptionCheckBox( i18n("Find hidden files and directories"), true, "FindHidden", &m_bDmFindHidden, page, this ); + gbox->addWidget( pFindHidden, line, 0, 1, 2 ); +#ifdef _WIN32 + pFindHidden->setToolTip( i18n("Finds files and directories with the hidden attribute.") ); +#else + pFindHidden->setToolTip( i18n("Finds files and directories starting with '.'.") ); +#endif + ++line; + + OptionCheckBox* pFollowFileLinks = new OptionCheckBox( i18n("Follow file links"), false, "FollowFileLinks", &m_bDmFollowFileLinks, page, this ); + gbox->addWidget( pFollowFileLinks, line, 0, 1, 2 ); + pFollowFileLinks->setToolTip( i18n( + "On: Compare the file the link points to.\n" + "Off: Compare the links." + )); + ++line; + + OptionCheckBox* pFollowDirLinks = new OptionCheckBox( i18n("Follow directory links"), false, "FollowDirLinks", &m_bDmFollowDirLinks, page, this ); + gbox->addWidget( pFollowDirLinks, line, 0, 1, 2 ); + pFollowDirLinks->setToolTip( i18n( + "On: Compare the directory the link points to.\n" + "Off: Compare the links." + )); + ++line; + + //OptionCheckBox* pShowOnlyDeltas = new OptionCheckBox( i18n("List only deltas"),false,"ListOnlyDeltas", &m_bDmShowOnlyDeltas, page, this ); + //gbox->addWidget( pShowOnlyDeltas, line, 0, 1, 2 ); + //pShowOnlyDeltas->setToolTip( i18n( + // "Files and directories without change will not appear in the list.")); + //++line; + +#ifdef _WIN32 + bool bCaseSensitiveFilenameComparison = false; +#else + bool bCaseSensitiveFilenameComparison = true; +#endif + OptionCheckBox* pCaseSensitiveFileNames = new OptionCheckBox( i18n("Case sensitive filename comparison"),bCaseSensitiveFilenameComparison,"CaseSensitiveFilenameComparison", &m_bDmCaseSensitiveFilenameComparison, page, this ); + gbox->addWidget( pCaseSensitiveFileNames, line, 0, 1, 2 ); + pCaseSensitiveFileNames->setToolTip( i18n( + "The directory comparison will compare files or directories when their names match.\n" + "Set this option if the case of the names must match. (Default for Windows is off, otherwise on.)")); + ++line; + + QGroupBox* pBG = new QGroupBox( i18n("File Comparison Mode") ); + gbox->addWidget( pBG, line, 0, 1, 2 ); + + QVBoxLayout* pBGLayout = new QVBoxLayout( pBG ); + pBGLayout->setMargin(spacingHint()); + + OptionRadioButton* pBinaryComparison = new OptionRadioButton( i18n("Binary comparison"), true, "BinaryComparison", &m_bDmBinaryComparison, pBG, this ); + pBinaryComparison->setToolTip( i18n("Binary comparison of each file. (Default)") ); + pBGLayout->addWidget( pBinaryComparison ); + + OptionRadioButton* pFullAnalysis = new OptionRadioButton( i18n("Full analysis"), false, "FullAnalysis", &m_bDmFullAnalysis, pBG, this ); + pFullAnalysis->setToolTip( i18n("Do a full analysis and show statistics information in extra columns.\n" + "(Slower than a binary comparison, much slower for binary files.)") ); + pBGLayout->addWidget( pFullAnalysis ); + + OptionRadioButton* pTrustDate = new OptionRadioButton( i18n("Trust the modification date (unsafe)"), false, "TrustDate", &m_bDmTrustDate, pBG, this ); + pTrustDate->setToolTip( i18n("Assume that files are equal if the modification date and file length are equal.\n" + "Useful for big directories or slow networks.") ); + pBGLayout->addWidget( pTrustDate ); + + OptionRadioButton* pTrustSize = new OptionRadioButton( i18n("Trust the size (unsafe)"), false, "TrustSize", &m_bDmTrustSize, pBG, this ); + pTrustSize->setToolTip( i18n("Assume that files are equal if their file lengths are equal.\n" + "Useful for big directories or slow networks when the date is modified during download.") ); + pBGLayout->addWidget( pTrustSize ); + + ++line; + + + // Some two Dir-options: Affects only the default actions. + OptionCheckBox* pSyncMode = new OptionCheckBox( i18n("Synchronize directories"), false,"SyncMode", &m_bDmSyncMode, page, this ); + gbox->addWidget( pSyncMode, line, 0, 1, 2 ); + pSyncMode->setToolTip( i18n( + "Offers to store files in both directories so that\n" + "both directories are the same afterwards.\n" + "Works only when comparing two directories without specifying a destination." ) ); + ++line; + + // Allow white-space only differences to be considered equal + OptionCheckBox* pWhiteSpaceDiffsEqual = new OptionCheckBox( i18n("White space differences considered equal"), false,"WhiteSpaceEqual", &m_bDmWhiteSpaceEqual, page, this ); + gbox->addWidget( pWhiteSpaceDiffsEqual, line, 0, 1, 2 ); + pWhiteSpaceDiffsEqual->setToolTip( i18n( + "If files differ only by white space consider them equal.\n" + "This is only active when full analysis is chosen." ) ); + connect(pFullAnalysis, SIGNAL(toggled(bool)), pWhiteSpaceDiffsEqual, SLOT(setEnabled(bool))); + pWhiteSpaceDiffsEqual->setEnabled(false); + ++line; + + OptionCheckBox* pCopyNewer = new OptionCheckBox( i18n("Copy newer instead of merging (unsafe)"), false, "CopyNewer", &m_bDmCopyNewer, page, this ); + gbox->addWidget( pCopyNewer, line, 0, 1, 2 ); + pCopyNewer->setToolTip( i18n( + "Don't look inside, just take the newer file.\n" + "(Use this only if you know what you are doing!)\n" + "Only effective when comparing two directories." ) ); + ++line; + + OptionCheckBox* pCreateBakFiles = new OptionCheckBox( i18n("Backup files (.orig)"), true, "CreateBakFiles", &m_bDmCreateBakFiles, page, this ); + gbox->addWidget( pCreateBakFiles, line, 0, 1, 2 ); + pCreateBakFiles->setToolTip( i18n( + "When a file would be saved over an old file, then the old file\n" + "will be renamed with a '.orig'-extension instead of being deleted.")); + ++line; + + topLayout->addStretch(10); +} +/* +static void insertCodecs(OptionComboBox* p) +{ + std::multimap m; // Using the multimap for case-insensitive sorting. + int i; + for(i=0;;++i) + { + QTextCodec* pCodec = QTextCodec::codecForIndex ( i ); + if ( pCodec != 0 ) m.insert( std::make_pair( QString(pCodec->mimeName()).upper(), pCodec->mimeName()) ); + else break; + } + + p->insertItem( i18n("Auto"), 0 ); + std::multimap::iterator mi; + for(mi=m.begin(), i=0; mi!=m.end(); ++mi, ++i) + p->insertItem(mi->second, i+1); +} +*/ + +// UTF8-Codec that saves a BOM +class Utf8BOMCodec : public QTextCodec +{ + public: + QByteArray name () const { return "UTF-8-BOM"; } + int mibEnum () const { return 2123; } // Some random number above 2000 and below 3000 + QByteArray convertFromUnicode ( const QChar * input, int number, ConverterState * pState ) const + { + QByteArray r; + if ( pState && pState->state_data[0]==0) + { + r += "\xEF\xBB\xBF"; + pState->state_data[0]=1; + } + + r += QString::fromRawData( input, number ).toUtf8(); + return r; + } + QString convertToUnicode ( const char * p, int len, ConverterState* ) const + { + return QString::fromUtf8 ( p, len ); + } +}; + +void OptionDialog::setupRegionalPage( void ) +{ + new Utf8BOMCodec(); + + QFrame *page = addPage( i18n("Regional Settings"), i18n("Regional Settings"), + BarIcon("locale"/*"charset"*/, KIcon::SizeMedium ) ); + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + QGridLayout *gbox = new QGridLayout(); + gbox->setColumnStretch(1,5); + topLayout->addLayout( gbox ); + int line=0; + + QLabel* label; + +#ifdef KREPLACEMENTS_H + +static char* countryMap[]={ +"af Afrikaans", +"ar Arabic", +"az Azerbaijani", +"be Belarusian", +"bg Bulgarian", +"bn Bengali", +"bo Tibetan", +"br Breton", +"bs Bosnian", +"ca Catalan", +"cs Czech", +"cy Welsh", +"da Danish", +"de German", +"el Greek", +"en_GB British English", +"eo Esperanto", +"es Spanish", +"et Estonian", +"eu Basque", +"fa Farsi (Persian)", +"fi Finnish", +"fo Faroese", +"fr French", +"ga Irish Gaelic", +"gl Galician", +"gu Gujarati", +"he Hebrew", +"hi Hindi", +"hr Croatian", +"hsb Upper Sorbian", +"hu Hungarian", +"id Indonesian", +"is Icelandic", +"it Italian", +"ja Japanese", +"ka Georgian", +"ko Korean", +"ku Kurdish", +"lo Lao", +"lt Lithuanian", +"lv Latvian", +"mi Maori", +"mk Macedonian", +"mn Mongolian", +"ms Malay", +"mt Maltese", +"nb Norwegian Bookmal", +"nds Low Saxon", +"nl Dutch", +"nn Norwegian Nynorsk", +"nso Northern Sotho", +"oc Occitan", +"pl Polish", +"pt Portuguese", +"pt_BR Brazilian Portuguese", +"ro Romanian", +"ru Russian", +"rw Kinyarwanda", +"se Northern Sami", +"sk Slovak", +"sl Slovenian", +"sq Albanian", +"sr Serbian", +"sr@Latn Serbian", +"ss Swati", +"sv Swedish", +"ta Tamil", +"tg Tajik", +"th Thai", +"tr Turkish", +"uk Ukrainian", +"uz Uzbek", +"ven Venda", +"vi Vietnamese", +"wa Walloon", +"xh Xhosa", +"zh_CN Chinese Simplified", +"zh_TW Chinese Traditional", +"zu Zulu" +}; + + label = new QLabel( i18n("Language (restart required)"), page ); + gbox->addWidget( label, line, 0 ); + OptionComboBox* pLanguage = new OptionComboBox( 0, "Language", &m_language, page, this ); + gbox->addWidget( pLanguage, line, 1 ); + pLanguage->addItem( "Auto" ); // Must not translate, won't work otherwise! + pLanguage->addItem( "en_orig" ); + + // Read directory: Find all kdiff3_*.qm-files and insert the found files here selection + FileAccess fa( getTranslationDir() ); + t_DirectoryList dirList; + fa.listDir( &dirList, false, false, "kdiff3_*.qm", "", "*", false, false ); + t_DirectoryList::iterator i; + for( i=dirList.begin(); i!=dirList.end(); ++i) + { + QString fileName = i->fileName(); + // Skip the "kdiff3_" and omit the .qm + QString languageId = fileName.mid(7, fileName.length()-10 ); + + unsigned int countryIdx=0; + for(countryIdx=0; countryIdx< sizeof(countryMap)/sizeof(countryMap[0]); ++countryIdx ) + { + QString fullName = countryMap[countryIdx]; + if ( languageId+" " == fullName.left(languageId.length()+1) ) + { + languageId += " (" + fullName.mid(languageId.length()+1) + ")"; + } + } + + pLanguage->addItem( languageId ); + } + + label->setToolTip( i18n( + "Choose the language of the GUI-strings or \"Auto\".\n" + "For a change of language to take place, quit and restart KDiff3.") + ); + ++line; +/* + label = new QLabel( i18n("Codec for file contents"), page ); + gbox->addWidget( label, line, 0 ); + OptionComboBox* pFileCodec = new OptionComboBox( 0, "FileCodec", &m_fileCodec, page, this ); + gbox->addWidget( pFileCodec, line, 1 ); + insertCodecs( pFileCodec ); + label->setToolTip( i18n( + "Choose the codec that should be used for your input files\n" + "or \"Auto\" if unsure." ) + ); + ++line; +*/ +#endif + + m_pSameEncoding = new OptionCheckBox( i18n("Use the same encoding for everything:"), true, "SameEncoding", &m_bSameEncoding, page, this ); + gbox->addWidget( m_pSameEncoding, line, 0, 1, 2 ); + m_pSameEncoding->setToolTip( i18n( + "Enable this allows to change all encodings by changing the first only.\n" + "Disable this if different individual settings are needed." + ) ); + ++line; + + label = new QLabel( i18n("Note: Local Encoding is ") + "\"" + QTextCodec::codecForLocale()->name() + "\"", page ); + gbox->addWidget( label, line, 0 ); + ++line; + + label = new QLabel( i18n("File Encoding for A:"), page ); + gbox->addWidget( label, line, 0 ); + m_pEncodingAComboBox = new OptionEncodingComboBox( "EncodingForA", &m_pEncodingA, page, this ); + gbox->addWidget( m_pEncodingAComboBox, line, 1 ); + + QString autoDetectToolTip = i18n( + "If enabled then Unicode (UTF-16 or UTF-8) encoding will be detected.\n" + "If the file is not Unicode then the selected encoding will be used as fallback.\n" + "(Unicode detection depends on the first bytes of a file.)" + ); + m_pAutoDetectUnicodeA = new OptionCheckBox( i18n("Auto Detect Unicode"), true, "AutoDetectUnicodeA", &m_bAutoDetectUnicodeA, page, this ); + gbox->addWidget( m_pAutoDetectUnicodeA, line, 2 ); + m_pAutoDetectUnicodeA->setToolTip( autoDetectToolTip ); + ++line; + + label = new QLabel( i18n("File Encoding for B:"), page ); + gbox->addWidget( label, line, 0 ); + m_pEncodingBComboBox = new OptionEncodingComboBox( "EncodingForB", &m_pEncodingB, page, this ); + gbox->addWidget( m_pEncodingBComboBox, line, 1 ); + m_pAutoDetectUnicodeB = new OptionCheckBox( i18n("Auto Detect Unicode"), true, "AutoDetectUnicodeB", &m_bAutoDetectUnicodeB, page, this ); + gbox->addWidget( m_pAutoDetectUnicodeB, line, 2 ); + m_pAutoDetectUnicodeB->setToolTip( autoDetectToolTip ); + ++line; + + label = new QLabel( i18n("File Encoding for C:"), page ); + gbox->addWidget( label, line, 0 ); + m_pEncodingCComboBox = new OptionEncodingComboBox( "EncodingForC", &m_pEncodingC, page, this ); + gbox->addWidget( m_pEncodingCComboBox, line, 1 ); + m_pAutoDetectUnicodeC = new OptionCheckBox( i18n("Auto Detect Unicode"), true, "AutoDetectUnicodeC", &m_bAutoDetectUnicodeC, page, this ); + gbox->addWidget( m_pAutoDetectUnicodeC, line, 2 ); + m_pAutoDetectUnicodeC->setToolTip( autoDetectToolTip ); + ++line; + + label = new QLabel( i18n("File Encoding for Merge Output and Saving:"), page ); + gbox->addWidget( label, line, 0 ); + m_pEncodingOutComboBox = new OptionEncodingComboBox( "EncodingForOutput", &m_pEncodingOut, page, this ); + gbox->addWidget( m_pEncodingOutComboBox, line, 1 ); + m_pAutoSelectOutEncoding = new OptionCheckBox( i18n("Auto Select"), true, "AutoSelectOutEncoding", &m_bAutoSelectOutEncoding, page, this ); + gbox->addWidget( m_pAutoSelectOutEncoding, line, 2 ); + m_pAutoSelectOutEncoding->setToolTip( i18n( + "If enabled then the encoding from the input files is used.\n" + "In ambiguous cases a dialog will ask the user to choose the encoding for saving." + ) ); + ++line; + label = new QLabel( i18n("File Encoding for Preprocessor Files:"), page ); + gbox->addWidget( label, line, 0 ); + m_pEncodingPPComboBox = new OptionEncodingComboBox( "EncodingForPP", &m_pEncodingPP, page, this ); + gbox->addWidget( m_pEncodingPPComboBox, line, 1 ); + ++line; + + connect(m_pSameEncoding, SIGNAL(toggled(bool)), this, SLOT(slotEncodingChanged())); + connect(m_pEncodingAComboBox, SIGNAL(activated(int)), this, SLOT(slotEncodingChanged())); + connect(m_pAutoDetectUnicodeA, SIGNAL(toggled(bool)), this, SLOT(slotEncodingChanged())); + connect(m_pAutoSelectOutEncoding, SIGNAL(toggled(bool)), this, SLOT(slotEncodingChanged())); + + OptionCheckBox* pRightToLeftLanguage = new OptionCheckBox( i18n("Right To Left Language"), false, "RightToLeftLanguage", &m_bRightToLeftLanguage, page, this ); + gbox->addWidget( pRightToLeftLanguage, line, 0, 1, 2 ); + pRightToLeftLanguage->setToolTip( i18n( + "Some languages are read from right to left.\n" + "This setting will change the viewer and editor accordingly.")); + ++line; + + + topLayout->addStretch(10); +} + +void OptionDialog::setupIntegrationPage( void ) +{ + QFrame *page = addPage( i18n("Integration"), i18n("Integration Settings"), + BarIcon("launch"/*"charset"*/, KIcon::SizeMedium ) ); + QVBoxLayout *topLayout = new QVBoxLayout( page ); + topLayout->setMargin( 5 ); + topLayout->setSpacing( spacingHint() ); + + QGridLayout *gbox = new QGridLayout(); + gbox->setColumnStretch(1,5); + topLayout->addLayout( gbox ); + int line=0; + + QLabel* label; + label = new QLabel( i18n("Command line options to ignore:"), page ); + gbox->addWidget( label, line, 0 ); + OptionLineEdit* pIgnorableCmdLineOptions = new OptionLineEdit( "-u;-query;-html;-abort", "IgnorableCmdLineOptions", &m_ignorableCmdLineOptions, page, this ); + gbox->addWidget( pIgnorableCmdLineOptions, line, 1 ); + label->setToolTip( i18n( + "List of command line options that should be ignored when KDiff3 is used by other tools.\n" + "Several values can be specified if separated via ';'\n" + "This will suppress the \"Unknown option\"-error." + )); + ++line; + + topLayout->addStretch(10); +} + + +void OptionDialog::slotEncodingChanged() +{ + if ( m_pSameEncoding->isChecked() ) + { + m_pEncodingBComboBox->setEnabled( false ); + m_pEncodingBComboBox->setCurrentIndex( m_pEncodingAComboBox->currentIndex() ); + m_pEncodingCComboBox->setEnabled( false ); + m_pEncodingCComboBox->setCurrentIndex( m_pEncodingAComboBox->currentIndex() ); + m_pEncodingOutComboBox->setEnabled( false ); + m_pEncodingOutComboBox->setCurrentIndex( m_pEncodingAComboBox->currentIndex() ); + m_pEncodingPPComboBox->setEnabled( false ); + m_pEncodingPPComboBox->setCurrentIndex( m_pEncodingAComboBox->currentIndex() ); + m_pAutoDetectUnicodeB->setEnabled( false ); + m_pAutoDetectUnicodeB->setCheckState( m_pAutoDetectUnicodeA->checkState() ); + m_pAutoDetectUnicodeC->setEnabled( false ); + m_pAutoDetectUnicodeC->setCheckState( m_pAutoDetectUnicodeA->checkState() ); + m_pAutoSelectOutEncoding->setEnabled( false ); + m_pAutoSelectOutEncoding->setCheckState( m_pAutoDetectUnicodeA->checkState() ); + } + else + { + m_pEncodingBComboBox->setEnabled( true ); + m_pEncodingCComboBox->setEnabled( true ); + m_pEncodingOutComboBox->setEnabled( true ); + m_pEncodingPPComboBox->setEnabled( true ); + m_pAutoDetectUnicodeB->setEnabled( true ); + m_pAutoDetectUnicodeC->setEnabled( true ); + m_pAutoSelectOutEncoding->setEnabled( true ); + m_pEncodingOutComboBox->setEnabled( m_pAutoSelectOutEncoding->checkState()==Qt::Unchecked ); + } +} + +void OptionDialog::setupKeysPage( void ) +{ + //QVBox *page = addVBoxPage( i18n("Keys"), i18n("KeyDialog" ), + // BarIcon("fonts", KIcon::SizeMedium ) ); + + //QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); + // new KFontChooser( page,"font",false/*onlyFixed*/,QStringList(),false,6 ); + //m_pKeyDialog=new KKeyDialog( false, 0 ); + //topLayout->addWidget( m_pKeyDialog ); +} + +void OptionDialog::slotOk( void ) +{ + slotApply(); + + // My system returns variable width fonts even though I + // disabled this. Even QFont::fixedPitch() doesn't work. + QFontMetrics fm(m_font); + if ( fm.width('W')!=fm.width('i') ) + { + int result = KMessageBox::warningYesNo(this, i18n( + "You selected a variable width font.\n\n" + "Because this program doesn't handle variable width fonts\n" + "correctly, you might experience problems while editing.\n\n" + "Do you want to continue or do you want to select another font."), + i18n("Incompatible Font"), + i18n("Continue at Own Risk"), i18n("Select Another Font")); + if (result==KMessageBox::No) + return; + } + + accept(); +} + + +/** Copy the values from the widgets to the public variables.*/ +void OptionDialog::slotApply( void ) +{ + std::list::iterator i; + for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) + { + (*i)->apply(); + } + + emit applyClicked(); + +#ifdef _WIN32 + QString locale = m_language; + if ( locale == "Auto" || locale.isEmpty() ) + locale = QLocale::system().name().left(2); + int spacePos = locale.indexOf(' '); + if (spacePos>0) locale = locale.left(spacePos); + QSettings settings("HKEY_CURRENT_USER\\Software\\KDiff3\\diff-ext", QSettings::NativeFormat); + settings.setValue( "Language", locale ); +#endif +} + +/** Set the default values in the widgets only, while the + public variables remain unchanged. */ +void OptionDialog::slotDefault() +{ + int result = KMessageBox::warningContinueCancel(this, i18n("This resets all options. Not only those of the current topic.") ); + if ( result==KMessageBox::Cancel ) return; + else resetToDefaults(); +} + +void OptionDialog::resetToDefaults() +{ + std::list::iterator i; + for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) + { + (*i)->setToDefault(); + } + + slotEncodingChanged(); +} + +/** Initialise the widgets using the values in the public varibles. */ +void OptionDialog::setState() +{ + std::list::iterator i; + for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) + { + (*i)->setToCurrent(); + } + + slotEncodingChanged(); +} + +class ConfigValueMap : public ValueMap +{ +private: + KConfig* m_pConfig; +public: + ConfigValueMap( KConfig* pConfig ) { m_pConfig = pConfig; } + + void writeEntry(const QString& s, const QFont& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const QString& s, const QColor& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const QString& s, const QSize& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const QString& s, const QPoint& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const QString& s, int v ) { m_pConfig->writeEntry(s,v); } + void writeEntry(const QString& s, bool v ) { m_pConfig->writeEntry(s,v); } + void writeEntry(const QString& s, const QStringList& v, char separator ){ m_pConfig->writeEntry(s,v,separator); } + void writeEntry(const QString& s, const QString& v ){ m_pConfig->writeEntry(s,v); } + void writeEntry(const QString& s, const char* v ) { m_pConfig->writeEntry(s,v); } + + QFont readFontEntry (const QString& s, QFont* defaultVal ) { return m_pConfig->readFontEntry(s,defaultVal); } + QColor readColorEntry(const QString& s, QColor* defaultVal ){ return m_pConfig->readColorEntry(s,defaultVal); } + QSize readSizeEntry (const QString& s, QSize* defaultVal ) { return m_pConfig->readSizeEntry(s,defaultVal); } + QPoint readPointEntry(const QString& s, QPoint* defaultVal) { return m_pConfig->readPointEntry(s,defaultVal); } + bool readBoolEntry (const QString& s, bool defaultVal ) { return m_pConfig->readBoolEntry(s,defaultVal); } + int readNumEntry (const QString& s, int defaultVal ) { return m_pConfig->readNumEntry(s,defaultVal); } + QStringList readListEntry (const QString& s, const QStringList& def, char separator ) { return m_pConfig->readListEntry(s.toLatin1(),def,separator); } + QString readEntry (const QString& s, const QString& defaultVal){ return m_pConfig->readEntry(s,defaultVal); } +}; + +void OptionDialog::saveOptions( KConfig* config ) +{ + // No i18n()-Translations here! + + config->setGroup("KDiff3 Options"); + + ConfigValueMap cvm(config); + std::list::iterator i; + for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) + { + (*i)->write(&cvm); + } +} + +void OptionDialog::readOptions( KConfig* config ) +{ + // No i18n()-Translations here! + + config->setGroup("KDiff3 Options"); + + ConfigValueMap cvm(config); + std::list::iterator i; + for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) + { + (*i)->read(&cvm); + } + + setState(); +} + +void OptionDialog::slotHelp( void ) +{ + KDialogBase::slotHelp(); +} + +QString OptionDialog::parseOptions( const QCStringList& optionList ) +{ + QString result; + QCStringList::const_iterator i; + for ( i=optionList.begin(); i!=optionList.end(); ++i ) + { + QString s = *i; + + int pos = s.indexOf('='); + if( pos > 0 ) // seems not to have a tag + { + QString key = s.left(pos); + QString val = s.mid(pos+1); + std::list::iterator j; + bool bFound = false; + for(j=m_optionItemList.begin(); j!=m_optionItemList.end(); ++j) + { + if ( (*j)->getSaveName()==key ) + { + ValueMap config; + config.writeEntry( key, val ); // Write the value as a string and + (*j)->read(&config); // use the internal conversion from string to the needed value. + bFound = true; + break; + } + } + if ( ! bFound ) + { + result += "No config item named \"" + key + "\"\n"; + } + } + else + { + result += "No '=' found in \"" + s + "\"\n"; + } + } + return result; +} + +QString OptionDialog::calcOptionHelp() +{ + ValueMap config; + std::list::iterator j; + for(j=m_optionItemList.begin(); j!=m_optionItemList.end(); ++j) + { + (*j)->write( &config ); + } + return config.getAsString(); +} + +void OptionDialog::slotHistoryMergeRegExpTester() +{ + RegExpTester dlg(this, s_autoMergeRegExpToolTip, s_historyStartRegExpToolTip, + s_historyEntryStartRegExpToolTip, s_historyEntryStartSortKeyOrderToolTip ); + dlg.init(m_pAutoMergeRegExpLineEdit->currentText(), m_pHistoryStartRegExpLineEdit->currentText(), + m_pHistoryEntryStartRegExpLineEdit->currentText(), m_pHistorySortKeyOrderLineEdit->currentText()); + if ( dlg.exec() ) + { + m_pAutoMergeRegExpLineEdit->setEditText( dlg.autoMergeRegExp() ); + m_pHistoryStartRegExpLineEdit->setEditText( dlg.historyStartRegExp() ); + m_pHistoryEntryStartRegExpLineEdit->setEditText( dlg.historyEntryStartRegExp() ); + m_pHistorySortKeyOrderLineEdit->setEditText( dlg.historySortKeyOrder() ); + } +} + + +//#include "optiondialog.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/optiondialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/optiondialog.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,222 @@ +/* + * kdiff3 - Text Diff And Merge Tool + * Copyright (C) 2002-2006 Joachim Eibl, joachim.eibl at gmx.de + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef OPTION_DIALOG_H +#define OPTION_DIALOG_H + +class QCheckBox; +class QLabel; +class QLineEdit; +class KColorButton; +class KFontChooser; +class KConfig; + +#include +#include +#include +#include + +class OptionItem; +class OptionCheckBox; +class OptionEncodingComboBox; +class OptionLineEdit; +class KKeyDialog; + +enum e_LineEndStyle +{ + eLineEndUnix=0, + eLineEndDos +}; + +class OptionDialog : public KDialogBase +{ + Q_OBJECT + +public: + + OptionDialog( bool bShowDirMergeSettings, QWidget *parent = 0, char *name = 0 ); + ~OptionDialog( void ); + QString parseOptions( const QCStringList& optionList ); + QString calcOptionHelp(); + + // Some settings are not available in the option dialog: + QSize m_geometry; + QPoint m_position; + bool m_bMaximised; + bool m_bShowToolBar; + bool m_bShowStatusBar; + int m_toolBarPos; + + // These are the results of the option dialog. + QFont m_font; + bool m_bItalicForDeltas; + + QColor m_fgColor; + QColor m_bgColor; + QColor m_diffBgColor; + QColor m_colorA; + QColor m_colorB; + QColor m_colorC; + QColor m_colorForConflict; + QColor m_currentRangeBgColor; + QColor m_currentRangeDiffBgColor; + QColor m_oldestFileColor; + QColor m_midAgeFileColor; + QColor m_newestFileColor; + QColor m_missingFileColor; + QColor m_manualHelpRangeColor; + + bool m_bWordWrap; + + bool m_bReplaceTabs; + bool m_bAutoIndentation; + int m_tabSize; + bool m_bAutoCopySelection; + bool m_bSameEncoding; + QTextCodec* m_pEncodingA; + bool m_bAutoDetectUnicodeA; + QTextCodec* m_pEncodingB; + bool m_bAutoDetectUnicodeB; + QTextCodec* m_pEncodingC; + bool m_bAutoDetectUnicodeC; + QTextCodec* m_pEncodingOut; + bool m_bAutoSelectOutEncoding; + QTextCodec* m_pEncodingPP; + int m_lineEndStyle; + + bool m_bPreserveCarriageReturn; + bool m_bTryHard; + bool m_bShowWhiteSpaceCharacters; + bool m_bShowWhiteSpace; + bool m_bShowLineNumbers; + bool m_bHorizDiffWindowSplitting; + + int m_whiteSpace2FileMergeDefault; + int m_whiteSpace3FileMergeDefault; + bool m_bIgnoreCase; + bool m_bIgnoreNumbers; + bool m_bIgnoreComments; + QString m_PreProcessorCmd; + QString m_LineMatchingPreProcessorCmd; + bool m_bRunRegExpAutoMergeOnMergeStart; + QString m_autoMergeRegExp; + bool m_bRunHistoryAutoMergeOnMergeStart; + QString m_historyStartRegExp; + QString m_historyEntryStartRegExp; + bool m_bHistoryMergeSorting; + QString m_historyEntryStartSortKeyOrder; + QString m_IrrelevantMergeCmd; + + bool m_bAutoAdvance; + int m_autoAdvanceDelay; + + QStringList m_recentAFiles; + QStringList m_recentBFiles; + QStringList m_recentCFiles; + + QStringList m_recentOutputFiles; + + // Directory Merge options + bool m_bDmSyncMode; + bool m_bDmRecursiveDirs; + bool m_bDmFollowFileLinks; + bool m_bDmFollowDirLinks; + bool m_bDmFindHidden; + bool m_bDmCreateBakFiles; + bool m_bDmBinaryComparison; + bool m_bDmFullAnalysis; + bool m_bDmTrustDate; + bool m_bDmTrustSize; + bool m_bDmCopyNewer; + //bool m_bDmShowOnlyDeltas; + bool m_bDmShowIdenticalFiles; + bool m_bDmUseCvsIgnore; + bool m_bDmWhiteSpaceEqual; + bool m_bDmCaseSensitiveFilenameComparison; + QString m_DmFilePattern; + QString m_DmFileAntiPattern; + QString m_DmDirAntiPattern; + + QString m_language; + bool m_bRightToLeftLanguage; + + QString m_ignorableCmdLineOptions; + + void saveOptions(KConfig* config); + void readOptions(KConfig* config); + + void setState(); // Must be called before calling exec(); + + void addOptionItem(OptionItem*); + KKeyDialog* m_pKeyDialog; +protected slots: + virtual void slotDefault( void ); + virtual void slotOk( void ); + virtual void slotApply( void ); + virtual void slotHelp( void ); + + void slotEncodingChanged(); + void slotHistoryMergeRegExpTester(); +private: + void resetToDefaults(); + + std::list m_optionItemList; + + OptionCheckBox* m_pSameEncoding; + OptionEncodingComboBox* m_pEncodingAComboBox; + OptionCheckBox* m_pAutoDetectUnicodeA; + OptionEncodingComboBox* m_pEncodingBComboBox; + OptionCheckBox* m_pAutoDetectUnicodeB; + OptionEncodingComboBox* m_pEncodingCComboBox; + OptionCheckBox* m_pAutoDetectUnicodeC; + OptionEncodingComboBox* m_pEncodingOutComboBox; + OptionCheckBox* m_pAutoSelectOutEncoding; + OptionEncodingComboBox* m_pEncodingPPComboBox; + OptionCheckBox* m_pHistoryAutoMerge; + OptionLineEdit* m_pAutoMergeRegExpLineEdit; + OptionLineEdit* m_pHistoryStartRegExpLineEdit; + OptionLineEdit* m_pHistoryEntryStartRegExpLineEdit; + OptionCheckBox* m_pHistoryMergeSorting; + OptionLineEdit* m_pHistorySortKeyOrderLineEdit; + +private: + void setupFontPage(); + void setupColorPage(); + void setupEditPage(); + void setupDiffPage(); + void setupMergePage(); + void setupDirectoryMergePage(); + void setupKeysPage(); + void setupRegionalPage(); + void setupIntegrationPage(); + void setupOtherOptions(); +}; + + + + +#endif + + + + + + + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/pdiff.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/pdiff.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2262 @@ +/*************************************************************************** + pdiff.cpp - Implementation for class KDiff3App + --------------- + begin : Mon March 18 20:04:50 CET 2002 + copyright : (C) 2002-2005 by Joachim Eibl + email : joachim.eibl at gmx.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "difftextwindow.h" +#include "mergeresultwindow.h" +#include "directorymergewindow.h" +#include "smalldialogs.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +#include + +#include "kdiff3.h" +#include "optiondialog.h" +#include "fileaccess.h" +#ifdef _WIN32 +#include +#else +#include +#endif + +#include "gnudiff_diff.h" + +bool g_bIgnoreWhiteSpace = true; +bool g_bIgnoreTrivialMatches = true; + + +bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList ) +{ + ProgressProxy pp; + static GnuDiff gnuDiff; // All values are initialized with zeros. + + pp.setCurrent(0); + + diffList.clear(); + if ( p1[0].pLine==0 || p2[0].pLine==0 || size1==0 || size2==0 ) + { + Diff d( 0,0,0); + if ( p1[0].pLine==0 && p2[0].pLine==0 && size1 == size2 ) + d.nofEquals = size1; + else + { + d.diff1=size1; + d.diff2=size2; + } + + diffList.push_back(d); + } + else + { + GnuDiff::comparison comparisonInput; + memset( &comparisonInput, 0, sizeof(comparisonInput) ); + comparisonInput.parent = 0; + comparisonInput.file[0].buffer = p1[0].pLine;//ptr to buffer + comparisonInput.file[0].buffered = (p1[size1-1].pLine-p1[0].pLine+p1[size1-1].size); // size of buffer + comparisonInput.file[1].buffer = p2[0].pLine;//ptr to buffer + comparisonInput.file[1].buffered = (p2[size2-1].pLine-p2[0].pLine+p2[size2-1].size); // size of buffer + + gnuDiff.ignore_white_space = GnuDiff::IGNORE_ALL_SPACE; // I think nobody needs anything else ... + gnuDiff.bIgnoreWhiteSpace = true; + gnuDiff.bIgnoreNumbers = m_pOptionDialog->m_bIgnoreNumbers; + gnuDiff.minimal = m_pOptionDialog->m_bTryHard; + gnuDiff.ignore_case = false; + GnuDiff::change* script = gnuDiff.diff_2_files( &comparisonInput ); + + int equalLinesAtStart = comparisonInput.file[0].prefix_lines; + int currentLine1 = 0; + int currentLine2 = 0; + GnuDiff::change* p=0; + for (GnuDiff::change* e = script; e; e = p) + { + Diff d(0,0,0); + d.nofEquals = e->line0 - currentLine1; + assert( d.nofEquals == e->line1 - currentLine2 ); + d.diff1 = e->deleted; + d.diff2 = e->inserted; + currentLine1 += d.nofEquals + d.diff1; + currentLine2 += d.nofEquals + d.diff2; + diffList.push_back(d); + + p = e->link; + free (e); + } + + if ( diffList.empty() ) + { + Diff d(0,0,0); + d.nofEquals = min2(size1,size2); + d.diff1 = size1 - d.nofEquals; + d.diff2 = size2 - d.nofEquals; + diffList.push_back(d); +/* Diff d(0,0,0); + d.nofEquals = equalLinesAtStart; + if ( gnuDiff.files[0].missing_newline != gnuDiff.files[1].missing_newline ) + { + d.diff1 = gnuDiff.files[0].missing_newline ? 0 : 1; + d.diff2 = gnuDiff.files[1].missing_newline ? 0 : 1; + ++d.nofEquals; + } + else if ( !gnuDiff.files[0].missing_newline ) + { + ++d.nofEquals; + } + diffList.push_back(d); +*/ + } + else + { + diffList.front().nofEquals += equalLinesAtStart; + currentLine1 += equalLinesAtStart; + currentLine2 += equalLinesAtStart; + + int nofEquals = min2(size1-currentLine1,size2-currentLine2); + if ( nofEquals==0 ) + { + diffList.back().diff1 += size1-currentLine1; + diffList.back().diff2 += size2-currentLine2; + } + else + { + Diff d( nofEquals,size1-currentLine1-nofEquals,size2-currentLine2-nofEquals); + diffList.push_back(d); + } + + /* + if ( gnuDiff.files[0].missing_newline != gnuDiff.files[1].missing_newline ) + { + diffList.back().diff1 += gnuDiff.files[0].missing_newline ? 0 : 1; + diffList.back().diff2 += gnuDiff.files[1].missing_newline ? 0 : 1; + } + else if ( !gnuDiff.files[0].missing_newline ) + { + ++ diffList.back().nofEquals; + } + */ + } + } + +#ifndef NDEBUG + // Verify difflist + { + int l1=0; + int l2=0; + DiffList::iterator i; + for( i = diffList.begin(); i!=diffList.end(); ++i ) + { + l1+= i->nofEquals + i->diff1; + l2+= i->nofEquals + i->diff2; + } + + //if( l1!=p1-p1start || l2!=p2-p2start ) + if( l1!=size1 || l2!=size2 ) + assert( false ); + } +#endif + + pp.setCurrent(1.0); + + return true; +} + +bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList, + int winIdx1, int winIdx2 ) +{ + diffList.clear(); + DiffList diffList2; + + int l1begin = 0; + int l2begin = 0; + ManualDiffHelpList::const_iterator i; + for( i = m_manualDiffHelpList.begin(); i!=m_manualDiffHelpList.end(); ++i ) + { + const ManualDiffHelpEntry& mdhe = *i; + + int l1end = winIdx1 == 1 ? mdhe.lineA1 : winIdx1==2 ? mdhe.lineB1 : mdhe.lineC1 ; + int l2end = winIdx2 == 1 ? mdhe.lineA1 : winIdx2==2 ? mdhe.lineB1 : mdhe.lineC1 ; + + if ( l1end>=0 && l2end>=0 ) + { + runDiff( p1+l1begin, l1end-l1begin, p2+l2begin, l2end-l2begin, diffList2 ); + diffList.splice( diffList.end(), diffList2 ); + l1begin = l1end; + l2begin = l2end; + + l1end = winIdx1 == 1 ? mdhe.lineA2 : winIdx1==2 ? mdhe.lineB2 : mdhe.lineC2 ; + l2end = winIdx2 == 1 ? mdhe.lineA2 : winIdx2==2 ? mdhe.lineB2 : mdhe.lineC2 ; + + if ( l1end>=0 && l2end>=0 ) + { + ++l1end; // point to line after last selected line + ++l2end; + runDiff( p1+l1begin, l1end-l1begin, p2+l2begin, l2end-l2begin, diffList2 ); + diffList.splice( diffList.end(), diffList2 ); + l1begin = l1end; + l2begin = l2end; + } + } + } + runDiff( p1+l1begin, size1-l1begin, p2+l2begin, size2-l2begin, diffList2 ); + diffList.splice( diffList.end(), diffList2 ); + return true; +} + +void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles ) +{ + ProgressProxy pp; + // When doing a full analysis in the directory-comparison, then the statistics-results + // will be stored in the given TotalDiffStatus. Otherwise it will be 0. + bool bGUI = pTotalDiffStatus == 0; + if (pTotalDiffStatus==0) + pTotalDiffStatus = &m_totalDiffStatus; + + bool bPreserveCarriageReturn = m_pOptionDialog->m_bPreserveCarriageReturn; + + bool bVisibleMergeResultWindow = ! m_outputFilename.isEmpty(); + if ( bVisibleMergeResultWindow && bGUI ) + { + bPreserveCarriageReturn = false; + + QString msg; + + if ( !m_pOptionDialog->m_PreProcessorCmd.isEmpty() ) + { + msg += "- " + i18n("PreprocessorCmd: ") + m_pOptionDialog->m_PreProcessorCmd + "\n"; + } + if ( !msg.isEmpty() ) + { + int result = KMessageBox::warningYesNo( this, + i18n("The following option(s) you selected might change data:\n") + msg + + i18n("\nMost likely this is not wanted during a merge.\n" + "Do you want to disable these settings or continue with these settings active?"), + i18n("Option Unsafe for Merging"), + i18n("Use These Options During Merge"), i18n("Disable Unsafe Options") + ); + + if (result == KMessageBox::No ) + { + m_pOptionDialog->m_PreProcessorCmd = ""; + } + } + } + + // Because of the progressdialog paintevents can occur, but data is invalid, + // so painting must be suppressed. + if (m_pDiffTextWindow1) m_pDiffTextWindow1->setPaintingAllowed( false ); + if (m_pDiffTextWindow2) m_pDiffTextWindow2->setPaintingAllowed( false ); + if (m_pDiffTextWindow3) m_pDiffTextWindow3->setPaintingAllowed( false ); + if (m_pOverview) m_pOverview->setPaintingAllowed( false ); + if (m_pMergeResultWindow) m_pMergeResultWindow->setPaintingAllowed( false ); + + m_diff3LineList.clear(); + + if ( bLoadFiles ) + { + m_manualDiffHelpList.clear(); + + if( m_sd3.isEmpty() ) + pp.setMaxNofSteps( 4 ); // Read 2 files, 1 comparison, 1 finediff + else + pp.setMaxNofSteps( 9 ); // Read 3 files, 3 comparisons, 3 finediffs + + // First get all input data. + pp.setInformation(i18n("Loading A")); + m_sd1.readAndPreprocess(m_pOptionDialog->m_pEncodingA, m_pOptionDialog->m_bAutoDetectUnicodeA ); + pp.step(); + + pp.setInformation(i18n("Loading B")); + m_sd2.readAndPreprocess(m_pOptionDialog->m_pEncodingB, m_pOptionDialog->m_bAutoDetectUnicodeB ); + pp.step(); + } + else + { + if( m_sd3.isEmpty() ) + pp.setMaxNofSteps( 2 ); // 1 comparison, 1 finediff + else + pp.setMaxNofSteps( 6 ); // 3 comparisons, 3 finediffs + } + + pTotalDiffStatus->reset(); + // Run the diff. + if ( m_sd3.isEmpty() ) + { + pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); + pp.setInformation(i18n("Diff: A <-> B")); + + runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); + + pp.step(); + + pp.setInformation(i18n("Linediff: A <-> B")); + calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList ); + fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB ); + if ( m_sd1.getSizeBytes()==0 ) pTotalDiffStatus->bTextAEqB=false; + + pp.step(); + } + else + { + if (bLoadFiles) + { + pp.setInformation(i18n("Loading C")); + m_sd3.readAndPreprocess(m_pOptionDialog->m_pEncodingC, m_pOptionDialog->m_bAutoDetectUnicodeC ); + pp.step(); + } + + pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); + pTotalDiffStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 ); + pTotalDiffStatus->bBinaryBEqC = m_sd3.isBinaryEqualWith( m_sd2 ); + + pp.setInformation(i18n("Diff: A <-> B")); + runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); + pp.step(); + pp.setInformation(i18n("Diff: B <-> C")); + runDiff( m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList23,2,3 ); + pp.step(); + pp.setInformation(i18n("Diff: A <-> C")); + runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList13,1,3 ); + pp.step(); + + calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList ); + calcDiff3LineListUsingAC( &m_diffList13, m_diff3LineList ); + correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList ); + calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList ); + + calcDiff3LineListUsingBC( &m_diffList23, m_diff3LineList ); + correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList ); + calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList ); + debugLineCheck( m_diff3LineList, m_sd1.getSizeLines(), 1 ); + debugLineCheck( m_diff3LineList, m_sd2.getSizeLines(), 2 ); + debugLineCheck( m_diff3LineList, m_sd3.getSizeLines(), 3 ); + + pp.setInformation(i18n("Linediff: A <-> B")); + fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB ); + pp.step(); + pp.setInformation(i18n("Linediff: B <-> C")); + fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay(), pTotalDiffStatus->bTextBEqC ); + pp.step(); + pp.setInformation(i18n("Linediff: A <-> C")); + fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqC ); + pp.step(); + if ( m_sd1.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextAEqC=false; } + if ( m_sd2.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextBEqC=false; } + } + m_diffBufferInfo.init( &m_diff3LineList, &m_diff3LineVector, + m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), + m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), + m_sd3.getLineDataForDiff(), m_sd3.getSizeLines() ); + calcWhiteDiff3Lines( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff() ); + calcDiff3LineVector( m_diff3LineList, m_diff3LineVector ); + + // Calc needed lines for display + m_neededLines = m_diff3LineList.size(); + + m_pDirectoryMergeWindow->allowResizeEvents(false); + + QList oldHeights; + if ( m_pDirectoryMergeSplitter->isVisible() ) + oldHeights = m_pMainSplitter->sizes(); + + initView(); + + if ( m_pDirectoryMergeSplitter->isVisible() ) + { + if (oldHeights.count() < 2) + oldHeights.append(0); + if (oldHeights[1]==0) // Distribute the available space evenly between the two widgets. + { + oldHeights[1] = oldHeights[0]/2; + oldHeights[0] -= oldHeights[1]; + } + m_pMainSplitter->setSizes( oldHeights ); + } + + m_pMainWidget->setVisible( bGUI ); + m_pDirectoryMergeWindow->allowResizeEvents(true); + + m_bTripleDiff = ! m_sd3.isEmpty(); + + m_pMergeResultWindowTitle->setEncodings( m_sd1.getEncoding(), m_sd2.getEncoding(), m_sd3.getEncoding() ); + if ( ! m_pOptionDialog->m_bAutoSelectOutEncoding ) + m_pMergeResultWindowTitle->setEncoding( m_pOptionDialog->m_pEncodingOut ); + + if ( bGUI ) + { + const ManualDiffHelpList* pMDHL = &m_manualDiffHelpList; + m_pDiffTextWindow1->init( m_sd1.getAliasName(), + m_sd1.getLineDataForDisplay(), m_sd1.getSizeLines(), &m_diff3LineVector, pMDHL, m_bTripleDiff ); + m_pDiffTextWindow2->init( m_sd2.getAliasName(), + m_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(), &m_diff3LineVector, pMDHL, m_bTripleDiff ); + m_pDiffTextWindow3->init( m_sd3.getAliasName(), + m_sd3.getLineDataForDisplay(), m_sd3.getSizeLines(), &m_diff3LineVector, pMDHL, m_bTripleDiff ); + + m_pDiffTextWindowFrame3->setVisible(m_bTripleDiff); + } + + m_bOutputModified = bVisibleMergeResultWindow; + + m_pMergeResultWindow->init( + m_sd1.getLineDataForDisplay(), m_sd1.getSizeLines(), + m_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(), + m_bTripleDiff ? m_sd3.getLineDataForDisplay() : 0, m_sd3.getSizeLines(), + &m_diff3LineList, + pTotalDiffStatus + ); + m_pMergeResultWindowTitle->setFileName( m_outputFilename.isEmpty() ? QString("unnamed.txt") : m_outputFilename ); + + if ( !bGUI ) + { + // We now have all needed information. The rest below is only for GUI-activation. + m_sd1.reset(); + m_sd2.reset(); + m_sd3.reset(); + return; + } + + m_pOverview->init(&m_diff3LineList, m_bTripleDiff ); + m_pDiffVScrollBar->setValue( 0 ); + m_pHScrollBar->setValue( 0 ); + m_pMergeVScrollBar->setValue( 0 ); + + m_pDiffTextWindow1->setPaintingAllowed( true ); + m_pDiffTextWindow2->setPaintingAllowed( true ); + m_pDiffTextWindow3->setPaintingAllowed( true ); + m_pOverview->setPaintingAllowed( true ); + m_pMergeResultWindow->setPaintingAllowed( true ); + + + if ( !bVisibleMergeResultWindow ) + m_pMergeWindowFrame->hide(); + else + m_pMergeWindowFrame->show(); + + // Calc max width for display + m_maxWidth = max2( m_pDiffTextWindow1->getNofColumns(), m_pDiffTextWindow2->getNofColumns() ); + m_maxWidth = max2( m_maxWidth, m_pDiffTextWindow3->getNofColumns() ); + m_maxWidth += 5; + + // Try to create a meaningful but not too long caption + if ( !isPart() ) + { + // 1. If the filenames are equal then show only one filename + QString caption; + QString a1 = m_sd1.getAliasName(); + QString a2 = m_sd2.getAliasName(); + QString a3 = m_sd3.getAliasName(); + QString f1, f2, f3; + int p1,p2,p3; + if ( !a1.isEmpty() && (p1=a1.lastIndexOf('/'))>=0 ) + f1 = a1.mid( p1+1 ); + if ( !a2.isEmpty() && (p2=a2.lastIndexOf('/'))>=0 ) + f2 = a2.mid( p2+1 ); + if ( !a3.isEmpty() && (p3=a3.lastIndexOf('/'))>=0 ) + f3 = a3.mid( p3+1 ); + if ( !f1.isEmpty() ) + { + if ( ( f2.isEmpty() && f3.isEmpty() ) || + (f2.isEmpty() && f1==f3) || ( f3.isEmpty() && f1==f2 ) || (f1==f2 && f1==f3)) + caption = ".../"+f1; + } + else if ( ! f2.isEmpty() ) + { + if ( f3.isEmpty() || f2==f3 ) + caption = ".../"+f2; + } + else if ( ! f3.isEmpty() ) + caption = ".../"+f3; + + // 2. If the files don't have the same name then show all names + if ( caption.isEmpty() && (!f1.isEmpty() || !f2.isEmpty() || !f3.isEmpty()) ) + { + caption = ( f1.isEmpty()? QString("") : QString(".../")+f1 ); + caption += QString(caption.isEmpty() || f2.isEmpty() ? "" : " <-> ") + ( f2.isEmpty()? QString("") : QString(".../")+f2 ); + caption += QString(caption.isEmpty() || f3.isEmpty() ? "" : " <-> ") + ( f3.isEmpty()? QString("") : QString(".../")+f3 ) ; + } + + m_pKDiff3Shell->setWindowTitle( caption.isEmpty() ? QString("KDiff3") : caption+QString(" - KDiff3")); + } + + if ( bLoadFiles ) + { + if ( bVisibleMergeResultWindow && !bAuto ) + m_pMergeResultWindow->showNrOfConflicts(); + else if ( !bAuto && + // Avoid showing this message during startup without parameters. + !( m_sd1.getAliasName().isEmpty() && m_sd2.getAliasName().isEmpty() && m_sd3.getAliasName().isEmpty() ) && + ( m_sd1.isValid() && m_sd2.isValid() && m_sd3.isValid() ) + ) + { + QString totalInfo; + if ( pTotalDiffStatus->bBinaryAEqB && pTotalDiffStatus->bBinaryAEqC ) + totalInfo += i18n("All input files are binary equal."); + else if ( pTotalDiffStatus->bTextAEqB && pTotalDiffStatus->bTextAEqC ) + totalInfo += i18n("All input files contain the same text, but are not binary equal."); + else { + if ( pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("B"); + else if ( pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("B"); + if ( pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("C"); + else if ( pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("C"); + if ( pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("B").arg("C"); + else if ( pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("B").arg("C"); + } + + if ( !totalInfo.isEmpty() ) + KMessageBox::information( this, totalInfo ); + } + + if ( bVisibleMergeResultWindow && (!m_sd1.isText() || !m_sd2.isText() || !m_sd3.isText()) ) + { + KMessageBox::information( this, i18n( + "Some inputfiles don't seem to be pure textfiles.\n" + "Note that the KDiff3-merge was not meant for binary data.\n" + "Continue at your own risk.") ); + } + } + + QTimer::singleShot( 10, this, SLOT(slotAfterFirstPaint()) ); + + if ( bVisibleMergeResultWindow && m_pMergeResultWindow ) + { + m_pMergeResultWindow->setFocus(); + } + else if(m_pDiffTextWindow1) + { + m_pDiffTextWindow1->setFocus(); + } +} + + +void KDiff3App::resizeDiffTextWindow(int newWidth, int newHeight) +{ + m_DTWHeight = newHeight; + + recalcWordWrap(); + + m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - newHeight) ); + m_pDiffVScrollBar->setPageStep( newHeight ); + m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); + + // The second window has a somewhat inverse width + + m_pHScrollBar->setRange(0, max2(0, m_maxWidth - newWidth) ); + m_pHScrollBar->setPageStep( newWidth ); +} + +void KDiff3App::resizeMergeResultWindow() +{ + MergeResultWindow* p = m_pMergeResultWindow; + m_pMergeVScrollBar->setRange(0, max2(0, p->getNofLines() - p->getNofVisibleLines()) ); + m_pMergeVScrollBar->setPageStep( p->getNofVisibleLines() ); + + // The second window has a somewhat inverse width +// m_pHScrollBar->setRange(0, max2(0, m_maxWidth - newWidth) ); +// m_pHScrollBar->setPageStep( newWidth ); +} + +void KDiff3App::scrollDiffTextWindow( int deltaX, int deltaY ) +{ + if ( deltaY!= 0 ) + { + m_pDiffVScrollBar->setValue( m_pDiffVScrollBar->value() + deltaY ); + m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); + } + if ( deltaX!= 0) + m_pHScrollBar->QScrollBar::setValue( m_pHScrollBar->value() + deltaX ); +} + +void KDiff3App::scrollMergeResultWindow( int deltaX, int deltaY ) +{ + if ( deltaY!= 0 ) + m_pMergeVScrollBar->setValue( m_pMergeVScrollBar->value() + deltaY ); + if ( deltaX!= 0) + m_pHScrollBar->setValue( m_pHScrollBar->value() + deltaX ); +} + +void KDiff3App::setDiff3Line( int line ) +{ + m_pDiffVScrollBar->setValue( line ); +} + +void KDiff3App::sourceMask( int srcMask, int enabledMask ) +{ + chooseA->setChecked( (srcMask & 1) != 0 ); + chooseB->setChecked( (srcMask & 2) != 0 ); + chooseC->setChecked( (srcMask & 4) != 0 ); + chooseA->setEnabled( (enabledMask & 1) != 0 ); + chooseB->setEnabled( (enabledMask & 2) != 0 ); + chooseC->setEnabled( (enabledMask & 4) != 0 ); +} + + + +// Function uses setMinSize( sizeHint ) before adding the widget. +// void addWidget(QBoxLayout* layout, QWidget* widget); +template +void addWidget( L* layout, W* widget) +{ + QSize s = widget->sizeHint(); + widget->setMinimumSize( QSize(max2(s.width(),0),max2(s.height(),0) ) ); + layout->addWidget( widget ); +} + +void KDiff3App::initView() +{ + // set the main widget here + if ( m_pMainWidget != 0 ) + { + return; + //delete m_pMainWidget; + } + m_pMainWidget = new QWidget(m_pMainSplitter); // Contains vertical splitter and horiz scrollbar + QVBoxLayout* pVLayout = new QVBoxLayout(m_pMainWidget); + pVLayout->setMargin(0); + pVLayout->setSpacing(0); + + QSplitter* pVSplitter = new QSplitter(); + pVSplitter->setOpaqueResize(false); + pVSplitter->setOrientation( Qt::Vertical ); + pVLayout->addWidget( pVSplitter ); + pVSplitter->show(); + + QWidget* pDiffWindowFrame = new QWidget( pVSplitter ); // Contains diff windows, overview and vert scrollbar + QHBoxLayout* pDiffHLayout = new QHBoxLayout( pDiffWindowFrame ); + pDiffHLayout->setMargin(0); + pDiffHLayout->setSpacing(0); + pDiffWindowFrame->show(); + m_pDiffWindowSplitter = new QSplitter(); + m_pDiffWindowSplitter->setOpaqueResize(false); + + m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? Qt::Horizontal : Qt::Vertical ); + pDiffHLayout->addWidget( m_pDiffWindowSplitter ); + m_pDiffWindowSplitter->show(); + + m_pOverview = new Overview( m_pOptionDialog ); + pDiffHLayout->addWidget(m_pOverview); + connect( m_pOverview, SIGNAL(setLine(int)), this, SLOT(setDiff3Line(int)) ); + //connect( m_pOverview, SIGNAL(afterFirstPaint()), this, SLOT(slotAfterFirstPaint())); + + m_pDiffVScrollBar = new QScrollBar( Qt::Vertical, pDiffWindowFrame ); + pDiffHLayout->addWidget( m_pDiffVScrollBar ); + + m_pDiffTextWindowFrame1 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 1 ); + m_pDiffTextWindowFrame1->show(); + m_pDiffTextWindowFrame2 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 2 ); + m_pDiffTextWindowFrame2->show(); + m_pDiffTextWindowFrame3 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 3 ); + m_pDiffTextWindow1 = m_pDiffTextWindowFrame1->getDiffTextWindow(); + m_pDiffTextWindow2 = m_pDiffTextWindowFrame2->getDiffTextWindow(); + m_pDiffTextWindow3 = m_pDiffTextWindowFrame3->getDiffTextWindow(); + connect(m_pDiffTextWindowFrame1, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); + connect(m_pDiffTextWindowFrame2, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); + connect(m_pDiffTextWindowFrame3, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); + + // Merge window + m_pMergeWindowFrame = new QWidget( pVSplitter ); + QHBoxLayout* pMergeHLayout = new QHBoxLayout( m_pMergeWindowFrame ); + pMergeHLayout->setMargin(0); + pMergeHLayout->setSpacing(0); + QVBoxLayout* pMergeVLayout = new QVBoxLayout(); + pMergeHLayout->addLayout( pMergeVLayout, 1 ); + + m_pMergeResultWindowTitle = new WindowTitleWidget(m_pOptionDialog); + pMergeVLayout->addWidget( m_pMergeResultWindowTitle ); + + m_pMergeResultWindow = new MergeResultWindow( m_pMergeWindowFrame, m_pOptionDialog, statusBar() ); + pMergeVLayout->addWidget( m_pMergeResultWindow, 1 ); + + m_pMergeVScrollBar = new QScrollBar( Qt::Vertical, m_pMergeWindowFrame ); + pMergeHLayout->addWidget( m_pMergeVScrollBar ); + + autoAdvance->setEnabled(true); + + QList 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 + m_pMergeResultWindow->installEventFilter( m_pMergeResultWindowTitle ); // for focus tracking + + QHBoxLayout* pHScrollBarLayout = new QHBoxLayout(); + pVLayout->addLayout( pHScrollBarLayout ); + m_pHScrollBar = new ReversibleScrollBar( Qt::Horizontal, &m_pOptionDialog->m_bRightToLeftLanguage ); + pHScrollBarLayout->addWidget( m_pHScrollBar ); + m_pCornerWidget = new QWidget( m_pMainWidget ); + pHScrollBarLayout->addWidget( m_pCornerWidget ); + + + connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pOverview, SLOT(setFirstLine(int))); + connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow1, SLOT(setFirstLine(int))); + connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow1, SLOT(setFirstColumn(int))); + connect( m_pDiffTextWindow1, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); + connect( m_pDiffTextWindow1, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); + connect( m_pDiffTextWindow1, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); + m_pDiffTextWindow1->installEventFilter( this ); + + connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow2, SLOT(setFirstLine(int))); + connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow2, SLOT(setFirstColumn(int))); + connect( m_pDiffTextWindow2, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); + connect( m_pDiffTextWindow2, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); + connect( m_pDiffTextWindow2, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); + m_pDiffTextWindow2->installEventFilter( this ); + + connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow3, SLOT(setFirstLine(int))); + connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow3, SLOT(setFirstColumn(int))); + connect( m_pDiffTextWindow3, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); + connect( m_pDiffTextWindow3, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); + connect( m_pDiffTextWindow3, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); + m_pDiffTextWindow3->installEventFilter( this ); + + + MergeResultWindow* p = m_pMergeResultWindow; + connect( m_pMergeVScrollBar, SIGNAL(valueChanged(int)), p, SLOT(setFirstLine(int))); + + connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), p, SLOT(setFirstColumn(int))); + connect( p, SIGNAL(scroll(int,int)), this, SLOT(scrollMergeResultWindow(int,int))); + connect( p, SIGNAL(sourceMask(int,int)), this, SLOT(sourceMask(int,int))); + connect( p, SIGNAL( resizeSignal() ),this, SLOT(resizeMergeResultWindow())); + connect( p, SIGNAL( selectionEnd() ), this, SLOT( slotSelectionEnd() ) ); + connect( p, SIGNAL( newSelection() ), this, SLOT( slotSelectionStart() ) ); + connect( p, SIGNAL( modifiedChanged(bool) ), this, SLOT( slotOutputModified(bool) ) ); + connect( p, SIGNAL( modifiedChanged(bool) ), m_pMergeResultWindowTitle, SLOT( slotSetModified(bool) ) ); + connect( p, SIGNAL( updateAvailabilities() ), this, SLOT( slotUpdateAvailabilities() ) ); + connect( p, SIGNAL( showPopupMenu(const QPoint&) ), this, SLOT(showPopupMenu(const QPoint&))); + connect( p, SIGNAL( noRelevantChangesDetected() ), this, SLOT(slotNoRelevantChangesDetected())); + sourceMask(0,0); + + + connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow1, SLOT(setFastSelectorRange(int,int))); + connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow2, SLOT(setFastSelectorRange(int,int))); + connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow3, SLOT(setFastSelectorRange(int,int))); + connect(m_pDiffTextWindow1, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); + connect(m_pDiffTextWindow2, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); + connect(m_pDiffTextWindow3, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); + connect(m_pDiffTextWindow1, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); + connect(m_pDiffTextWindow2, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); + connect(m_pDiffTextWindow3, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); + connect(m_pDirectoryMergeInfo, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); + + connect( m_pDiffTextWindow1, SIGNAL( resizeSignal(int,int) ),this, SLOT(resizeDiffTextWindow(int,int))); + // The following two connects cause the wordwrap to be recalced thrice, just to make sure. Better than forgetting one. + connect( m_pDiffTextWindow2, SIGNAL( resizeSignal(int,int) ),this, SLOT(slotRecalcWordWrap())); + connect( m_pDiffTextWindow3, SIGNAL( resizeSignal(int,int) ),this, SLOT(slotRecalcWordWrap())); + + m_pDiffTextWindow1->setFocus(); + m_pMainWidget->setMinimumSize(50,50); + m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); + showWindowA->setChecked( true ); + showWindowB->setChecked( true ); + showWindowC->setChecked( true ); +} + +static int calcManualDiffFirstDiff3LineIdx( const Diff3LineVector& d3lv, const ManualDiffHelpEntry& mdhe ) +{ + unsigned int i; + for( i = 0; i=0 && mdhe.lineA1==d3l.lineA || + mdhe.lineB1>=0 && mdhe.lineB1==d3l.lineB || + mdhe.lineC1>=0 && mdhe.lineC1==d3l.lineC ) + return i; + } + return -1; +} + +void KDiff3App::slotAfterFirstPaint() +{ + int newHeight = m_pDiffTextWindow1->getNofVisibleLines(); + int newWidth = m_pDiffTextWindow1->getNofVisibleColumns(); + m_DTWHeight = newHeight; + + recalcWordWrap(); + + m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - newHeight) ); + m_pDiffVScrollBar->setPageStep( newHeight ); + m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); + + // The second window has a somewhat inverse width + m_pHScrollBar->setRange(0, max2(0, m_maxWidth - newWidth) ); + m_pHScrollBar->setPageStep( newWidth ); + + int d3l=-1; + if ( ! m_manualDiffHelpList.empty() ) + d3l = calcManualDiffFirstDiff3LineIdx( m_diff3LineVector, m_manualDiffHelpList.front() ); + if ( d3l>=0 && m_pDiffTextWindow1 ) + { + int line = m_pDiffTextWindow1->convertDiff3LineIdxToLine( d3l ); + m_pDiffVScrollBar->setValue( max2(0,line-1) ); + } + else + { + m_pMergeResultWindow->slotGoTop(); + } + + if (m_pCornerWidget) + m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); + + slotUpdateAvailabilities(); +} + +void KDiff3App::resizeEvent(QResizeEvent* e) +{ + QSplitter::resizeEvent(e); + if (m_pCornerWidget) + m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); +} + + +bool KDiff3App::eventFilter( QObject* o, QEvent* e ) +{ + if( o == m_pMergeResultWindow ) + { + if ( e->type() == QEvent::KeyPress ) + { // key press + QKeyEvent *k = (QKeyEvent*)e; + if (k->key()==Qt::Key_Insert && (k->QInputEvent::modifiers() & Qt::ControlModifier)!=0 ) + { + slotEditCopy(); + return true; + } + if (k->key()==Qt::Key_Insert && (k->QInputEvent::modifiers() & Qt::ShiftModifier)!=0 ) + { + slotEditPaste(); + return true; + } + if (k->key()==Qt::Key_Delete && (k->QInputEvent::modifiers() & Qt::ShiftModifier)!=0 ) + { + slotEditCut(); + return true; + } + } + return QSplitter::eventFilter( o, e ); // standard event processing + } + + if ( e->type() == QEvent::KeyPress ) // key press + { + QKeyEvent *k = (QKeyEvent*)e; + + bool bCtrl = (k->QInputEvent::modifiers() & Qt::ControlModifier) != 0; + if (k->key()==Qt::Key_Insert && bCtrl ) + { + slotEditCopy(); + return true; + } + if (k->key()==Qt::Key_Insert && (k->QInputEvent::modifiers() & Qt::ShiftModifier)!=0 ) + { + slotEditPaste(); + return true; + } + int deltaX=0; + int deltaY=0; + int pageSize = m_DTWHeight; + switch( k->key() ) + { + case Qt::Key_Down: if (!bCtrl) ++deltaY; break; + case Qt::Key_Up: if (!bCtrl) --deltaY; break; + case Qt::Key_PageDown: if (!bCtrl) deltaY+=pageSize; break; + case Qt::Key_PageUp: if (!bCtrl) deltaY-=pageSize; break; + case Qt::Key_Left: if (!bCtrl) --deltaX; break; + case Qt::Key_Right: if (!bCtrl) ++deltaX; break; + case Qt::Key_Home: if ( bCtrl ) m_pDiffVScrollBar->setValue( 0 ); + else m_pHScrollBar->setValue( 0 ); + break; + case Qt::Key_End: if ( bCtrl ) m_pDiffVScrollBar->setValue( m_pDiffVScrollBar->maximum() ); + else m_pHScrollBar->setValue( m_pHScrollBar->maximum() ); + break; + default: break; + } + + scrollDiffTextWindow( deltaX, deltaY ); + + return true; // eat event + } + else if (e->type() == QEvent::Wheel ) // wheel event + { + QWheelEvent *w = (QWheelEvent*)e; + w->accept(); + + int deltaX=0; + + int d=w->delta(); + int deltaY = -d/120 * QApplication::wheelScrollLines(); + + scrollDiffTextWindow( deltaX, deltaY ); + return true; + } + else if (e->type() == QEvent::Drop ) + { + QDropEvent* pDropEvent = static_cast(e); + pDropEvent->accept(); + + if ( pDropEvent->mimeData()->hasUrls() ) + { +#ifdef KREPLACEMENTS_H + QList urlList = pDropEvent->mimeData()->urls(); + if ( canContinue() && !urlList.isEmpty() ) + { + raise(); + QString filename = urlList.first().toLocalFile(); + if ( o == m_pDiffTextWindow1 ) m_sd1.setFilename( filename ); + else if ( o == m_pDiffTextWindow2 ) m_sd2.setFilename( filename ); + else if ( o == m_pDiffTextWindow3 ) m_sd3.setFilename( filename ); + init(); + } +#else + KURL::List urlList; + KURLDrag::decode( pDropEvent, urlList ); + if ( canContinue() && !urlList.isEmpty() ) + { + raise(); + FileAccess fa( urlList.first().url() ); + if ( o == m_pDiffTextWindow1 ) m_sd1.setFileAccess( fa ); + else if ( o == m_pDiffTextWindow2 ) m_sd2.setFileAccess( fa ); + else if ( o == m_pDiffTextWindow3 ) m_sd3.setFileAccess( fa ); + init(); + } +#endif + } + else if ( pDropEvent->mimeData()->hasText() ) + { + QString text = pDropEvent->mimeData()->text(); + if ( canContinue() ) + { + raise(); + if ( o == m_pDiffTextWindow1 ) m_sd1.setData(text); + else if ( o == m_pDiffTextWindow2 ) m_sd2.setData(text); + else if ( o == m_pDiffTextWindow3 ) m_sd3.setData(text); + init(); + } + } + + return true; + } + return QSplitter::eventFilter( o, e ); // standard event processing +} + + + + +void KDiff3App::slotFileOpen() +{ + if ( !canContinue() ) return; + + if ( m_pDirectoryMergeWindow->isDirectoryMergeInProgress() ) + { + int result = KMessageBox::warningYesNo(this, + i18n("You are currently doing a directory merge. Are you sure, you want to abort?"), + i18n("Warning"), i18n("Abort"), i18n("Continue Merging") ); + if ( result!=KMessageBox::Yes ) + return; + } + + + slotStatusMsg(i18n("Opening files...")); + + for(;;) + { + OpenDialog d(this, + QDir::toNativeSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameA() : m_sd1.isFromBuffer() ? QString("") : m_sd1.getAliasName() ), + QDir::toNativeSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameB() : m_sd2.isFromBuffer() ? QString("") : m_sd2.getAliasName() ), + QDir::toNativeSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameC() : m_sd3.isFromBuffer() ? QString("") : m_sd3.getAliasName() ), + m_bDirCompare ? ! m_pDirectoryMergeWindow->getDirNameDest().isEmpty() : !m_outputFilename.isEmpty(), + QDir::toNativeSeparators( m_bDirCompare ? m_pDirectoryMergeWindow->getDirNameDest() : m_bDefaultFilename ? QString("") : m_outputFilename ), + SLOT(slotConfigure()), m_pOptionDialog ); + int status = d.exec(); + if ( status == QDialog::Accepted ) + { + m_sd1.setFilename( d.m_pLineA->currentText() ); + m_sd2.setFilename( d.m_pLineB->currentText() ); + m_sd3.setFilename( d.m_pLineC->currentText() ); + + if( d.m_pMerge->isChecked() ) + { + if ( d.m_pLineOut->currentText().isEmpty() ) + { + m_outputFilename = "unnamed.txt"; + m_bDefaultFilename = true; + } + else + { + m_outputFilename = d.m_pLineOut->currentText(); + m_bDefaultFilename = false; + } + } + else + m_outputFilename = ""; + + bool bSuccess = improveFilenames(false); + if ( !bSuccess ) + continue; + + if ( m_bDirCompare ) + { + m_pDirectoryMergeSplitter->show(); + if ( m_pMainWidget!=0 ) + { + m_pMainWidget->hide(); + } + break; + } + else + { + m_pDirectoryMergeSplitter->hide(); + init(); + + if ( ! m_sd1.isEmpty() && !m_sd1.hasData() || + ! m_sd2.isEmpty() && !m_sd2.hasData() || + ! m_sd3.isEmpty() && !m_sd3.hasData() ) + { + QString text( i18n("Opening of these files failed:") ); + text += "\n\n"; + if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) + text += " - " + m_sd1.getAliasName() + "\n"; + if ( ! m_sd2.isEmpty() && !m_sd2.hasData() ) + text += " - " + m_sd2.getAliasName() + "\n"; + if ( ! m_sd3.isEmpty() && !m_sd3.hasData() ) + text += " - " + m_sd3.getAliasName() + "\n"; + + KMessageBox::sorry( this, text, i18n("File open error") ); + continue; + } + } + } + break; + } + + slotUpdateAvailabilities(); + slotStatusMsg(i18n("Ready.")); +} + +void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn, + QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ) +{ + if ( !canContinue() ) return; + + if(fn1=="" && fn2=="" && fn3=="" && ofn=="" && m_pMainWidget!=0 ) + { + m_pMainWidget->hide(); + return; + } + + slotStatusMsg(i18n("Opening files...")); + + m_sd1.setFilename( fn1 ); + m_sd2.setFilename( fn2 ); + m_sd3.setFilename( fn3 ); + + m_sd1.setAliasName( an1 ); + m_sd2.setAliasName( an2 ); + m_sd3.setAliasName( an3 ); + + if ( ! ofn.isEmpty() ) + { + m_outputFilename = ofn; + m_bDefaultFilename = false; + } + else + { + m_outputFilename = ""; + m_bDefaultFilename = true; + } + + bool bDirCompare = m_bDirCompare; + improveFilenames(true); // Create new window for KDiff3 for directory comparison. + + if( m_bDirCompare ) + { + } + else + { + m_bDirCompare = bDirCompare; // Don't allow this to change here. + init( false, pTotalDiffStatus ); + + if ( pTotalDiffStatus!=0 ) + return; + + if ( ! m_sd1.isEmpty() && ! m_sd1.hasData() || + ! m_sd2.isEmpty() && ! m_sd2.hasData() || + ! m_sd3.isEmpty() && ! m_sd3.hasData() ) + { + QString text( i18n("Opening of these files failed:") ); + text += "\n\n"; + if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) + text += " - " + m_sd1.getAliasName() + "\n"; + if ( ! m_sd2.isEmpty() && !m_sd2.hasData() ) + text += " - " + m_sd2.getAliasName() + "\n"; + if ( ! m_sd3.isEmpty() && !m_sd3.hasData() ) + text += " - " + m_sd3.getAliasName() + "\n"; + + KMessageBox::sorry( this, text, i18n("File open error") ); + } + else + { + if ( m_pDirectoryMergeWindow!=0 && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) + { + slotDirViewToggle(); + } + } + } + slotStatusMsg(i18n("Ready.")); +} + + +void KDiff3App::slotFileNameChanged(const QString& fileName, int winIdx) +{ + QString fn1 = m_sd1.getFilename(); + QString an1 = m_sd1.getAliasName(); + QString fn2 = m_sd2.getFilename(); + QString an2 = m_sd2.getAliasName(); + QString fn3 = m_sd3.getFilename(); + QString an3 = m_sd3.getAliasName(); + if (winIdx==1) { fn1 = fileName; an1 = ""; } + if (winIdx==2) { fn2 = fileName; an2 = ""; } + if (winIdx==3) { fn3 = fileName; an3 = ""; } + + slotFileOpen2( fn1, fn2, fn3, m_outputFilename, an1, an2, an3, 0 ); +} + + +void KDiff3App::slotEditCut() +{ + slotStatusMsg(i18n("Cutting selection...")); + + QString s; + if ( m_pMergeResultWindow!=0 ) + { + s = m_pMergeResultWindow->getSelection(); + m_pMergeResultWindow->deleteSelection(); + + m_pMergeResultWindow->update(); + } + + if ( !s.isNull() ) + { + QApplication::clipboard()->setText( s, QClipboard::Clipboard ); + } + + slotStatusMsg(i18n("Ready.")); +} + +void KDiff3App::slotEditCopy() +{ + slotStatusMsg(i18n("Copying selection to clipboard...")); + QString s; + if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); + if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection(); + if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection(); + if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); + if ( !s.isNull() ) + { + QApplication::clipboard()->setText( s, QClipboard::Clipboard ); + } + + slotStatusMsg(i18n("Ready.")); +} + +void KDiff3App::slotEditPaste() +{ + slotStatusMsg(i18n("Inserting clipboard contents...")); + + if ( m_pMergeResultWindow!=0 && m_pMergeResultWindow->isVisible() ) + { + m_pMergeResultWindow->pasteClipboard(false); + } + else if ( canContinue() ) + { + if ( m_pDiffTextWindow1->hasFocus() ) + { + m_sd1.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); + init(); + } + else if ( m_pDiffTextWindow2->hasFocus() ) + { + m_sd2.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); + init(); + } + else if ( m_pDiffTextWindow3->hasFocus() ) + { + m_sd3.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); + init(); + } + } + + slotStatusMsg(i18n("Ready.")); +} + +void KDiff3App::slotEditSelectAll() +{ + int l=0,p=0; // needed as dummy return values + if ( m_pMergeResultWindow && m_pMergeResultWindow->hasFocus() ) { m_pMergeResultWindow->setSelection( 0,0,m_pMergeResultWindow->getNofLines(),0); } + else if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->hasFocus() ) { m_pDiffTextWindow1 ->setSelection( 0,0,m_pDiffTextWindow1->getNofLines(),0,l,p); } + else if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->hasFocus() ) { m_pDiffTextWindow2 ->setSelection( 0,0,m_pDiffTextWindow2->getNofLines(),0,l,p); } + else if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->hasFocus() ) { m_pDiffTextWindow3 ->setSelection( 0,0,m_pDiffTextWindow3->getNofLines(),0,l,p); } + + slotStatusMsg(i18n("Ready.")); +} + +void KDiff3App::slotGoCurrent() +{ + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoCurrent(); +} +void KDiff3App::slotGoTop() +{ + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoTop(); +} +void KDiff3App::slotGoBottom() +{ + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoBottom(); +} +void KDiff3App::slotGoPrevUnsolvedConflict() +{ + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoPrevUnsolvedConflict(); +} +void KDiff3App::slotGoNextUnsolvedConflict() +{ + m_bTimerBlock = false; + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoNextUnsolvedConflict(); +} +void KDiff3App::slotGoPrevConflict() +{ + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoPrevConflict(); +} +void KDiff3App::slotGoNextConflict() +{ + m_bTimerBlock = false; + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoNextConflict(); +} +void KDiff3App::slotGoPrevDelta() +{ + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoPrevDelta(); +} +void KDiff3App::slotGoNextDelta() +{ + if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoNextDelta(); +} + +void KDiff3App::choose( int choice ) +{ + if (!m_bTimerBlock ) + { + if ( m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->hasFocus() ) + { + if (choice==A) m_pDirectoryMergeWindow->slotCurrentChooseA(); + if (choice==B) m_pDirectoryMergeWindow->slotCurrentChooseB(); + if (choice==C) m_pDirectoryMergeWindow->slotCurrentChooseC(); + + chooseA->setChecked(false); + chooseB->setChecked(false); + chooseC->setChecked(false); + } + else if ( m_pMergeResultWindow ) + { + m_pMergeResultWindow->choose( choice ); + if ( autoAdvance->isChecked() ) + { + m_bTimerBlock = true; + QTimer::singleShot( m_pOptionDialog->m_autoAdvanceDelay, this, SLOT( slotGoNextUnsolvedConflict() ) ); + } + } + } +} + +void KDiff3App::slotChooseA() { choose( A ); } +void KDiff3App::slotChooseB() { choose( B ); } +void KDiff3App::slotChooseC() { choose( C ); } + +// bConflictsOnly automatically choose for conflicts only (true) or for everywhere +static void mergeChooseGlobal( MergeResultWindow* pMRW, int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ) +{ + if ( pMRW ) + { + pMRW->chooseGlobal(selector, bConflictsOnly, bWhiteSpaceOnly ); + } +} + +void KDiff3App::slotChooseAEverywhere() { mergeChooseGlobal( m_pMergeResultWindow, A, false, false ); } +void KDiff3App::slotChooseBEverywhere() { mergeChooseGlobal( m_pMergeResultWindow, B, false, false ); } +void KDiff3App::slotChooseCEverywhere() { mergeChooseGlobal( m_pMergeResultWindow, C, false, false ); } +void KDiff3App::slotChooseAForUnsolvedConflicts() { mergeChooseGlobal( m_pMergeResultWindow, A, true, false ); } +void KDiff3App::slotChooseBForUnsolvedConflicts() { mergeChooseGlobal( m_pMergeResultWindow, B, true, false ); } +void KDiff3App::slotChooseCForUnsolvedConflicts() { mergeChooseGlobal( m_pMergeResultWindow, C, true, false ); } +void KDiff3App::slotChooseAForUnsolvedWhiteSpaceConflicts() { mergeChooseGlobal( m_pMergeResultWindow, A, true, true ); } +void KDiff3App::slotChooseBForUnsolvedWhiteSpaceConflicts() { mergeChooseGlobal( m_pMergeResultWindow, B, true, true ); } +void KDiff3App::slotChooseCForUnsolvedWhiteSpaceConflicts() { mergeChooseGlobal( m_pMergeResultWindow, C, true, true ); } + + +void KDiff3App::slotAutoSolve() +{ + if (m_pMergeResultWindow ) + { + m_pMergeResultWindow->slotAutoSolve(); + // m_pMergeWindowFrame->show(); incompatible with bPreserveCarriageReturn + m_pMergeResultWindow->showNrOfConflicts(); + slotUpdateAvailabilities(); + } +} + +void KDiff3App::slotUnsolve() +{ + if (m_pMergeResultWindow ) + { + m_pMergeResultWindow->slotUnsolve(); + } +} + +void KDiff3App::slotMergeHistory() +{ + if (m_pMergeResultWindow ) + { + m_pMergeResultWindow->slotMergeHistory(); + } +} + +void KDiff3App::slotRegExpAutoMerge() +{ + if (m_pMergeResultWindow ) + { + m_pMergeResultWindow->slotRegExpAutoMerge(); + } +} + +void KDiff3App::slotSplitDiff() +{ + int firstLine = -1; + int lastLine = -1; + DiffTextWindow* pDTW=0; + if ( m_pDiffTextWindow1 ) { pDTW=m_pDiffTextWindow1; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } + if ( firstLine<0 && m_pDiffTextWindow2 ) { pDTW=m_pDiffTextWindow2; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } + if ( firstLine<0 && m_pDiffTextWindow3 ) { pDTW=m_pDiffTextWindow3; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } + if ( pDTW && firstLine>=0 && m_pMergeResultWindow) + { + pDTW->resetSelection(); + + m_pMergeResultWindow->slotSplitDiff( firstLine, lastLine ); + } +} + +void KDiff3App::slotJoinDiffs() +{ + int firstLine = -1; + int lastLine = -1; + DiffTextWindow* pDTW=0; + if ( m_pDiffTextWindow1 ) { pDTW=m_pDiffTextWindow1; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } + if ( firstLine<0 && m_pDiffTextWindow2 ) { pDTW=m_pDiffTextWindow2; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } + if ( firstLine<0 && m_pDiffTextWindow3 ) { pDTW=m_pDiffTextWindow3; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } + if ( pDTW && firstLine>=0 && m_pMergeResultWindow) + { + pDTW->resetSelection(); + + m_pMergeResultWindow->slotJoinDiffs( firstLine, lastLine ); + } +} + +void KDiff3App::slotConfigure() +{ + m_pOptionDialog->setState(); + m_pOptionDialog->incInitialSize ( QSize(0,40) ); + m_pOptionDialog->exec(); + slotRefresh(); +} + +void KDiff3App::slotConfigureKeys() +{ + KKeyDialog::configure(actionCollection(), this); +} + +void KDiff3App::slotRefresh() +{ + if (m_pDiffTextWindow1!=0) + { + m_pDiffTextWindow1->setFont(m_pOptionDialog->m_font); + m_pDiffTextWindow1->update(); + } + if (m_pDiffTextWindow2!=0) + { + m_pDiffTextWindow2->setFont(m_pOptionDialog->m_font); + m_pDiffTextWindow2->update(); + } + if (m_pDiffTextWindow3!=0) + { + m_pDiffTextWindow3->setFont(m_pOptionDialog->m_font); + m_pDiffTextWindow3->update(); + } + if (m_pMergeResultWindow!=0) + { + m_pMergeResultWindow->setFont(m_pOptionDialog->m_font); + m_pMergeResultWindow->update(); + } + if (m_pHScrollBar!=0) + { + m_pHScrollBar->setAgain(); + } + if ( m_pDiffWindowSplitter!=0 ) + { + m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? Qt::Horizontal : Qt::Vertical ); + } + if ( m_pDirectoryMergeWindow ) + { + m_pDirectoryMergeWindow->updateFileVisibilities(); + } +} + +void KDiff3App::slotSelectionStart() +{ + //editCopy->setEnabled( false ); + //editCut->setEnabled( false ); + + const QObject* s = sender(); + if (m_pDiffTextWindow1 && s!=m_pDiffTextWindow1) m_pDiffTextWindow1->resetSelection(); + if (m_pDiffTextWindow2 && s!=m_pDiffTextWindow2) m_pDiffTextWindow2->resetSelection(); + if (m_pDiffTextWindow3 && s!=m_pDiffTextWindow3) m_pDiffTextWindow3->resetSelection(); + if (m_pMergeResultWindow && s!=m_pMergeResultWindow) m_pMergeResultWindow->resetSelection(); +} + +void KDiff3App::slotSelectionEnd() +{ + //const QObject* s = sender(); + //editCopy->setEnabled(true); + //editCut->setEnabled( s==m_pMergeResultWindow ); + if ( m_pOptionDialog->m_bAutoCopySelection ) + { + slotEditCopy(); + } + else + { + QClipboard *clipBoard = QApplication::clipboard(); + + if (clipBoard->supportsSelection ()) + { + QString s; + if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); + if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection(); + if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection(); + if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); + if ( !s.isNull() ) + { + clipBoard->setText( s, QClipboard::Selection ); + } + } + } +} + +void KDiff3App::slotClipboardChanged() +{ + QString s = QApplication::clipboard()->text(); + //editPaste->setEnabled(!s.isEmpty()); +} + +void KDiff3App::slotOutputModified(bool bModified) +{ + if ( bModified && !m_bOutputModified ) + { + m_bOutputModified=true; + slotUpdateAvailabilities(); + } +} + +void KDiff3App::slotAutoAdvanceToggled() +{ + m_pOptionDialog->m_bAutoAdvance = autoAdvance->isChecked(); +} + +void KDiff3App::slotWordWrapToggled() +{ + m_pOptionDialog->m_bWordWrap = wordWrap->isChecked(); + recalcWordWrap(); +} + +void KDiff3App::slotRecalcWordWrap() +{ + recalcWordWrap(); +} + +void KDiff3App::recalcWordWrap(int nofVisibleColumns) // nofVisibleColumns is >=0 only for printing, otherwise the really visible width is used +{ + bool bPrinting = nofVisibleColumns>=0; + int firstD3LIdx = 0; + if( m_pDiffTextWindow1 ) + firstD3LIdx = m_pDiffTextWindow1->convertLineToDiff3LineIdx( m_pDiffTextWindow1->getFirstLine() ); + + // Convert selection to D3L-coords (converting back happens in DiffTextWindow::recalcWordWrap() + if ( m_pDiffTextWindow1 ) + m_pDiffTextWindow1->convertSelectionToD3LCoords(); + if ( m_pDiffTextWindow2 ) + m_pDiffTextWindow2->convertSelectionToD3LCoords(); + if ( m_pDiffTextWindow3 ) + m_pDiffTextWindow3->convertSelectionToD3LCoords(); + + + if ( !m_diff3LineList.empty() && m_pOptionDialog->m_bWordWrap ) + { + Diff3LineList::iterator i; + int sumOfLines=0; + for ( i=m_diff3LineList.begin(); i!=m_diff3LineList.end(); ++i ) + { + Diff3Line& d3l = *i; + d3l.linesNeededForDisplay = 1; + d3l.sumLinesNeededForDisplay = sumOfLines; + sumOfLines += d3l.linesNeededForDisplay; + } + + // Let every window calc how many lines will be needed. + if ( m_pDiffTextWindow1 ) + m_pDiffTextWindow1->recalcWordWrap(true,0,nofVisibleColumns); + if ( m_pDiffTextWindow2 ) + m_pDiffTextWindow2->recalcWordWrap(true,0,nofVisibleColumns); + if ( m_pDiffTextWindow3 ) + m_pDiffTextWindow3->recalcWordWrap(true,0,nofVisibleColumns); + + sumOfLines=0; + for ( i=m_diff3LineList.begin(); i!=m_diff3LineList.end(); ++i ) + { + Diff3Line& d3l = *i; + d3l.sumLinesNeededForDisplay = sumOfLines; + sumOfLines += d3l.linesNeededForDisplay; + } + + // Finish the initialisation: + if ( m_pDiffTextWindow1 ) + m_pDiffTextWindow1->recalcWordWrap(true,sumOfLines,nofVisibleColumns); + if ( m_pDiffTextWindow2 ) + m_pDiffTextWindow2->recalcWordWrap(true,sumOfLines,nofVisibleColumns); + if ( m_pDiffTextWindow3 ) + m_pDiffTextWindow3->recalcWordWrap(true,sumOfLines,nofVisibleColumns); + + m_neededLines = sumOfLines; + } + else + { + m_neededLines = m_diff3LineVector.size(); + if ( m_pDiffTextWindow1 ) + m_pDiffTextWindow1->recalcWordWrap(false,0,0); + if ( m_pDiffTextWindow2 ) + m_pDiffTextWindow2->recalcWordWrap(false,0,0); + if ( m_pDiffTextWindow3 ) + m_pDiffTextWindow3->recalcWordWrap(false,0,0); + } + if (bPrinting) + return; + + m_pOverview->slotRedraw(); + if ( m_pDiffTextWindow1 ) + { + m_pDiffTextWindow1->setFirstLine( m_pDiffTextWindow1->convertDiff3LineIdxToLine( firstD3LIdx ) ); + m_pDiffTextWindow1->update(); + } + if ( m_pDiffTextWindow2 ) + { + m_pDiffTextWindow2->setFirstLine( m_pDiffTextWindow2->convertDiff3LineIdxToLine( firstD3LIdx ) ); + m_pDiffTextWindow2->update(); + } + if ( m_pDiffTextWindow3 ) + { + m_pDiffTextWindow3->setFirstLine( m_pDiffTextWindow3->convertDiff3LineIdxToLine( firstD3LIdx ) ); + m_pDiffTextWindow3->update(); + } + + m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - m_DTWHeight) ); + if ( m_pDiffTextWindow1 ) + { + m_pDiffVScrollBar->setValue( m_pDiffTextWindow1->convertDiff3LineIdxToLine( firstD3LIdx ) ); + + m_maxWidth = max3( m_pDiffTextWindow1->getNofColumns(), + m_pDiffTextWindow2->getNofColumns(), + m_pDiffTextWindow3->getNofColumns() ) + (m_pOptionDialog->m_bWordWrap ? 0 : 5); + + m_pHScrollBar->setRange(0, max2( 0, m_maxWidth - m_pDiffTextWindow1->getNofVisibleColumns() ) ); + m_pHScrollBar->setPageStep( m_pDiffTextWindow1->getNofVisibleColumns() ); + m_pHScrollBar->setValue(0); + } +} + +void KDiff3App::slotShowWhiteSpaceToggled() +{ + m_pOptionDialog->m_bShowWhiteSpaceCharacters = showWhiteSpaceCharacters->isChecked(); + m_pOptionDialog->m_bShowWhiteSpace = showWhiteSpace->isChecked(); + showWhiteSpaceCharacters->setEnabled( showWhiteSpace->isChecked() ); + if ( m_pDiffTextWindow1!=0 ) + m_pDiffTextWindow1->update(); + if ( m_pDiffTextWindow2!=0 ) + m_pDiffTextWindow2->update(); + if ( m_pDiffTextWindow3!=0 ) + m_pDiffTextWindow3->update(); + if ( m_pOverview!=0 ) + m_pOverview->slotRedraw(); +} + +void KDiff3App::slotShowLineNumbersToggled() +{ + m_pOptionDialog->m_bShowLineNumbers = showLineNumbers->isChecked(); + if ( m_pDiffTextWindow1!=0 ) + m_pDiffTextWindow1->update(); + if ( m_pDiffTextWindow2!=0 ) + m_pDiffTextWindow2->update(); + if ( m_pDiffTextWindow3!=0 ) + m_pDiffTextWindow3->update(); +} + +/// Return true for success, else false +bool KDiff3App::improveFilenames( bool bCreateNewInstance ) +{ + m_bDirCompare = false; + + FileAccess f1(m_sd1.getFilename()); + FileAccess f2(m_sd2.getFilename()); + FileAccess f3(m_sd3.getFilename()); + FileAccess f4(m_outputFilename); + + if ( f1.isFile() && f1.exists() ) + { + if ( f2.isDir() ) + { + f2.addPath( f1.fileName() ); + if ( f2.isFile() && f2.exists() ) + m_sd2.setFileAccess( f2 ); + } + if ( f3.isDir() ) + { + f3.addPath( f1.fileName() ); + if ( f3.isFile() && f3.exists() ) + m_sd3.setFileAccess( f3 ); + } + if ( f4.isDir() ) + { + f4.addPath( f1.fileName() ); + if ( f4.isFile() && f4.exists() ) + m_outputFilename = f4.absFilePath(); + } + } + else if ( f1.isDir() ) + { + m_bDirCompare = true; + if (bCreateNewInstance) + { + emit createNewInstance( f1.absFilePath(), f2.absFilePath(), f3.absFilePath() ); + } + else + { + FileAccess destDir; + if (!m_bDefaultFilename) destDir = f4; + m_pDirectoryMergeSplitter->show(); + if (m_pMainWidget!=0) m_pMainWidget->hide(); + + bool bSuccess = m_pDirectoryMergeWindow->init( + f1, f2, f3, + destDir, // Destdirname + !m_outputFilename.isEmpty() + ); + + m_bDirCompare = true; // This seems redundant but it might have been reset during full analysis. + + if (bSuccess) + { + m_sd1.reset(); + if (m_pDiffTextWindow1!=0) m_pDiffTextWindow1->init(0,0,0,0,0,false); + m_sd2.reset(); + if (m_pDiffTextWindow2!=0) m_pDiffTextWindow2->init(0,0,0,0,0,false); + m_sd3.reset(); + if (m_pDiffTextWindow3!=0) m_pDiffTextWindow3->init(0,0,0,0,0,false); + } + slotUpdateAvailabilities(); + return bSuccess; + } + } + return true; +} + +void KDiff3App::slotReload() +{ + if ( !canContinue() ) return; + + init(); +} + +bool KDiff3App::canContinue() +{ + // First test if anything must be saved. + if(m_bOutputModified) + { + int result = KMessageBox::warningYesNoCancel(this, + i18n("The merge result hasn't been saved."), + i18n("Warning"), i18n("Save && Continue"), i18n("Continue Without Saving") ); + if ( result==KMessageBox::Cancel ) + return false; + else if ( result==KMessageBox::Yes ) + { + slotFileSave(); + if ( m_bOutputModified ) + { + KMessageBox::sorry(this, i18n("Saving the merge result failed."), i18n("Warning") ); + return false; + } + } + } + + m_bOutputModified = false; + return true; +} + +void KDiff3App::slotCheckIfCanContinue( bool* pbContinue ) +{ + if (pbContinue!=0) *pbContinue = canContinue(); +} + + +void KDiff3App::slotDirShowBoth() +{ + if( dirShowBoth->isChecked() ) + { + if ( m_bDirCompare ) + m_pDirectoryMergeSplitter->show(); + else + m_pDirectoryMergeSplitter->hide(); + + if ( m_pMainWidget!=0 ) + m_pMainWidget->show(); + } + else + { + if ( m_pMainWidget!=0 ) + { + m_pMainWidget->show(); + m_pDirectoryMergeSplitter->hide(); + } + else if ( m_bDirCompare ) + { + m_pDirectoryMergeSplitter->show(); + } + } + + slotUpdateAvailabilities(); +} + + +void KDiff3App::slotDirViewToggle() +{ + if ( m_bDirCompare ) + { + if( ! m_pDirectoryMergeSplitter->isVisible() ) + { + m_pDirectoryMergeSplitter->show(); + if (m_pMainWidget!=0) + m_pMainWidget->hide(); + } + else + { + if (m_pMainWidget!=0) + { + m_pDirectoryMergeSplitter->hide(); + m_pMainWidget->show(); + } + } + } + slotUpdateAvailabilities(); +} + +void KDiff3App::slotShowWindowAToggled() +{ + if ( m_pDiffTextWindow1!=0 ) + { + m_pDiffTextWindowFrame1->setVisible( showWindowA->isChecked() ); + slotUpdateAvailabilities(); + } +} + +void KDiff3App::slotShowWindowBToggled() +{ + if ( m_pDiffTextWindow2!=0 ) + { + m_pDiffTextWindowFrame2->setVisible( showWindowB->isChecked() ); + slotUpdateAvailabilities(); + } +} + +void KDiff3App::slotShowWindowCToggled() +{ + if ( m_pDiffTextWindow3!=0 ) + { + m_pDiffTextWindowFrame3->setVisible( showWindowC->isChecked() ); + slotUpdateAvailabilities(); + } +} + +void KDiff3App::slotEditFind() +{ + m_pFindDialog->currentLine = 0; + m_pFindDialog->currentPos = 0; + m_pFindDialog->currentWindow = 1; + + if ( QDialog::Accepted == m_pFindDialog->exec() ) + { + slotEditFindNext(); + } +} + +void KDiff3App::slotEditFindNext() +{ + QString s = m_pFindDialog->m_pSearchString->text(); + if ( s.isEmpty() ) + { + slotEditFind(); + return; + } + + bool bDirDown = true; + bool bCaseSensitive = m_pFindDialog->m_pCaseSensitive->isChecked(); + + int d3vLine = m_pFindDialog->currentLine; + int posInLine = m_pFindDialog->currentPos; + int l=0; + int p=0; + if ( m_pFindDialog->currentWindow == 1 ) + { + if ( m_pFindDialog->m_pSearchInA->isChecked() && m_pDiffTextWindow1!=0 && + m_pDiffTextWindow1->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) + { + m_pDiffTextWindow1->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(), l, p ); + m_pDiffVScrollBar->setValue(l-m_pDiffVScrollBar->pageStep()/2); + m_pHScrollBar->setValue( max2( 0, p+(int)s.length()-m_pHScrollBar->pageStep()) ); + m_pFindDialog->currentLine = d3vLine; + m_pFindDialog->currentPos = posInLine + 1; + return; + } + m_pFindDialog->currentWindow = 2; + m_pFindDialog->currentLine = 0; + m_pFindDialog->currentPos = 0; + } + + d3vLine = m_pFindDialog->currentLine; + posInLine = m_pFindDialog->currentPos; + if ( m_pFindDialog->currentWindow == 2 ) + { + if ( m_pFindDialog->m_pSearchInB->isChecked() && m_pDiffTextWindow2!=0 && + m_pDiffTextWindow2->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) + { + m_pDiffTextWindow2->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(),l,p ); + m_pDiffVScrollBar->setValue(l-m_pDiffVScrollBar->pageStep()/2); + m_pHScrollBar->setValue( max2( 0, p+(int)s.length()-m_pHScrollBar->pageStep()) ); + m_pFindDialog->currentLine = d3vLine; + m_pFindDialog->currentPos = posInLine + 1; + return; + } + m_pFindDialog->currentWindow = 3; + m_pFindDialog->currentLine = 0; + m_pFindDialog->currentPos = 0; + } + + d3vLine = m_pFindDialog->currentLine; + posInLine = m_pFindDialog->currentPos; + if ( m_pFindDialog->currentWindow == 3 ) + { + if ( m_pFindDialog->m_pSearchInC->isChecked() && m_pDiffTextWindow3!=0 && + m_pDiffTextWindow3->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) + { + m_pDiffTextWindow3->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(),l,p ); + m_pDiffVScrollBar->setValue(l-m_pDiffVScrollBar->pageStep()/2); + m_pHScrollBar->setValue( max2( 0, p+(int)s.length()-m_pHScrollBar->pageStep()) ); + m_pFindDialog->currentLine = d3vLine; + m_pFindDialog->currentPos = posInLine + 1; + return; + } + m_pFindDialog->currentWindow = 4; + m_pFindDialog->currentLine = 0; + m_pFindDialog->currentPos = 0; + } + + d3vLine = m_pFindDialog->currentLine; + posInLine = m_pFindDialog->currentPos; + if ( m_pFindDialog->currentWindow == 4 ) + { + if ( m_pFindDialog->m_pSearchInOutput->isChecked() && m_pMergeResultWindow!=0 && m_pMergeResultWindow->isVisible() && + m_pMergeResultWindow->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) + { + m_pMergeResultWindow->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length() ); + m_pMergeVScrollBar->setValue(d3vLine - m_pMergeVScrollBar->pageStep()/2); + m_pHScrollBar->setValue( max2( 0, posInLine+(int)s.length()-m_pHScrollBar->pageStep()) ); + m_pFindDialog->currentLine = d3vLine; + m_pFindDialog->currentPos = posInLine + 1; + return; + } + m_pFindDialog->currentWindow = 5; + m_pFindDialog->currentLine = 0; + m_pFindDialog->currentPos = 0; + } + + KMessageBox::information(this,i18n("Search complete."),i18n("Search Complete")); + m_pFindDialog->currentWindow = 1; + m_pFindDialog->currentLine = 0; + m_pFindDialog->currentPos = 0; +} + +void KDiff3App::slotMergeCurrentFile() +{ + if ( m_bDirCompare && m_pDirectoryMergeWindow->isVisible() && m_pDirectoryMergeWindow->isFileSelected() ) + { + m_pDirectoryMergeWindow->mergeCurrentFile(); + } + else if ( m_pMainWidget != 0 && m_pMainWidget->isVisible() ) + { + if ( !canContinue() ) return; + if ( m_outputFilename.isEmpty() ) + { + if ( !m_sd3.isEmpty() && !m_sd3.isFromBuffer() ) + { + m_outputFilename = m_sd3.getFilename(); + } + else if ( !m_sd2.isEmpty() && !m_sd2.isFromBuffer() ) + { + m_outputFilename = m_sd2.getFilename(); + } + else if ( !m_sd1.isEmpty() && !m_sd1.isFromBuffer() ) + { + m_outputFilename = m_sd1.getFilename(); + } + else + { + m_outputFilename = "unnamed.txt"; + m_bDefaultFilename = true; + } + } + init(); + } +} + +void KDiff3App::slotWinFocusNext() +{ + QWidget* focus = qApp->focusWidget(); + if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) + { + slotDirViewToggle(); + } + + std::list visibleWidgetList; + if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); + if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); + if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); + if ( m_pMergeResultWindow && m_pMergeResultWindow->isVisible() ) visibleWidgetList.push_back(m_pMergeResultWindow); + if ( m_bDirCompare /*m_pDirectoryMergeWindow->isVisible()*/ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow); + //if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); + + std::list::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); + ++i; + if ( i==visibleWidgetList.end() ) + i = visibleWidgetList.begin(); + if ( i!=visibleWidgetList.end() ) + { + if ( *i == m_pDirectoryMergeWindow && ! dirShowBoth->isChecked() ) + { + slotDirViewToggle(); + } + (*i)->setFocus(); + } +} + +void KDiff3App::slotWinFocusPrev() +{ + QWidget* focus = qApp->focusWidget(); + if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) + { + slotDirViewToggle(); + } + + std::list visibleWidgetList; + if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); + if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); + if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); + if ( m_pMergeResultWindow && m_pMergeResultWindow->isVisible() ) visibleWidgetList.push_back(m_pMergeResultWindow); + if (m_bDirCompare /* m_pDirectoryMergeWindow->isVisible() */ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow); + //if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); + + std::list::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); + if ( i==visibleWidgetList.begin() ) + i=visibleWidgetList.end(); + --i; + if ( i!=visibleWidgetList.end() ) + { + if ( *i == m_pDirectoryMergeWindow && ! dirShowBoth->isChecked() ) + { + slotDirViewToggle(); + } + (*i)->setFocus(); + } +} + +void KDiff3App::slotWinToggleSplitterOrientation() +{ + if ( m_pDiffWindowSplitter!=0 ) + { + m_pDiffWindowSplitter->setOrientation( + m_pDiffWindowSplitter->orientation()==Qt::Vertical ? Qt::Horizontal : Qt::Vertical + ); + + m_pOptionDialog->m_bHorizDiffWindowSplitting = m_pDiffWindowSplitter->orientation()==Qt::Horizontal; + } +} + +void KDiff3App::slotOverviewNormal() +{ + m_pOverview->setOverviewMode( Overview::eOMNormal ); + m_pMergeResultWindow->setOverviewMode( Overview::eOMNormal ); + slotUpdateAvailabilities(); +} + +void KDiff3App::slotOverviewAB() +{ + m_pOverview->setOverviewMode( Overview::eOMAvsB ); + m_pMergeResultWindow->setOverviewMode( Overview::eOMAvsB ); + slotUpdateAvailabilities(); +} + +void KDiff3App::slotOverviewAC() +{ + m_pOverview->setOverviewMode( Overview::eOMAvsC ); + m_pMergeResultWindow->setOverviewMode( Overview::eOMAvsC ); + slotUpdateAvailabilities(); +} + +void KDiff3App::slotOverviewBC() +{ + m_pOverview->setOverviewMode( Overview::eOMBvsC ); + m_pMergeResultWindow->setOverviewMode( Overview::eOMBvsC ); + slotUpdateAvailabilities(); +} + +void KDiff3App::slotNoRelevantChangesDetected() +{ + if ( m_bTripleDiff && ! m_outputFilename.isEmpty() ) + { + //KMessageBox::information( this, "No relevant changes detected", "KDiff3" ); + if (!m_pOptionDialog->m_IrrelevantMergeCmd.isEmpty()) + { + QString cmd = m_pOptionDialog->m_IrrelevantMergeCmd + " \"" + m_sd1.getAliasName()+ "\" \"" + m_sd2.getAliasName() + "\" \"" + m_sd3.getAliasName(); + QProcess process; + process.start( cmd ); + process.waitForFinished(-1); + //::system( cmd.local8Bit() ); + } + } +} + +static void insertManualDiffHelp( ManualDiffHelpList* pManualDiffHelpList, int winIdx, int firstLine, int lastLine ) +{ + // The manual diff help list must be sorted and compact. + // "Compact" means that upper items can't be empty if lower items contain data. + + // First insert the new item without regarding compactness. + // If the new item overlaps with previous items then the previous items will be removed. + + ManualDiffHelpEntry mdhe; + mdhe.firstLine( winIdx ) = firstLine; + mdhe.lastLine( winIdx ) = lastLine; + + ManualDiffHelpList::iterator i; + for( i=pManualDiffHelpList->begin(); i!=pManualDiffHelpList->end(); ++i ) + { + int& l1 = i->firstLine( winIdx ); + int& l2 = i->lastLine( winIdx ); + if (l1>=0 && l2>=0) + { + if ( firstLine<=l1 && lastLine>=l1 || firstLine <=l2 && lastLine>=l2 ) + { + // overlap + l1 = -1; + l2 = -1; + } + if ( firstLineinsert( i, mdhe ); + break; + } + } + } + if ( i == pManualDiffHelpList->end() ) + { + pManualDiffHelpList->insert( i, mdhe ); + } + + // Now make the list compact + for( int wIdx=1; wIdx<=3; ++wIdx ) + { + ManualDiffHelpList::iterator iEmpty = pManualDiffHelpList->begin(); + for( i=pManualDiffHelpList->begin(); i!=pManualDiffHelpList->end(); ++i ) + { + if ( iEmpty->firstLine(wIdx) >= 0 ) + { + ++iEmpty; + continue; + } + if ( i->firstLine(wIdx)>=0 ) // Current item is not empty -> move it to the empty place + { + iEmpty->firstLine(wIdx) = i->firstLine(wIdx); + iEmpty->lastLine(wIdx) = i->lastLine(wIdx); + i->firstLine(wIdx) = -1; + i->lastLine(wIdx) = -1; + ++iEmpty; + } + } + } + pManualDiffHelpList->remove( ManualDiffHelpEntry() ); // Remove all completely empty items. +} + +void KDiff3App::slotAddManualDiffHelp() +{ + int firstLine = -1; + int lastLine = -1; + int winIdx = -1; + if ( m_pDiffTextWindow1 ) { m_pDiffTextWindow1->getSelectionRange(&firstLine, &lastLine, eFileCoords); winIdx=1; } + if ( firstLine<0 && m_pDiffTextWindow2 ) { m_pDiffTextWindow2->getSelectionRange(&firstLine, &lastLine, eFileCoords); winIdx=2; } + if ( firstLine<0 && m_pDiffTextWindow3 ) { m_pDiffTextWindow3->getSelectionRange(&firstLine, &lastLine, eFileCoords); winIdx=3; } + + if ( firstLine<0 || lastLine <0 || lastLineisChecked() ) + { + if ( m_bDirCompare ) + m_pDirectoryMergeSplitter->show(); + else + m_pDirectoryMergeSplitter->hide(); + + if ( m_pMainWidget!=0 && !m_pMainWidget->isVisible() && + bTextDataAvailable && !m_pDirectoryMergeWindow->isScanning() + ) + m_pMainWidget->show(); + } + + + bool bDiffWindowVisible = m_pMainWidget != 0 && m_pMainWidget->isVisible(); + bool bMergeEditorVisible = m_pMergeWindowFrame !=0 && m_pMergeWindowFrame->isVisible(); + + m_pDirectoryMergeWindow->updateAvailabilities( m_bDirCompare, bDiffWindowVisible, chooseA, chooseB, chooseC ); + + dirShowBoth->setEnabled( m_bDirCompare ); + dirViewToggle->setEnabled( + m_bDirCompare && + (!m_pDirectoryMergeSplitter->isVisible() && m_pMainWidget!=0 && m_pMainWidget->isVisible() || + m_pDirectoryMergeSplitter->isVisible() && m_pMainWidget!=0 && !m_pMainWidget->isVisible() && bTextDataAvailable ) + ); + + bool bDirWindowHasFocus = m_pDirectoryMergeSplitter->isVisible() && m_pDirectoryMergeWindow->hasFocus(); + + showWhiteSpaceCharacters->setEnabled( bDiffWindowVisible ); + autoAdvance->setEnabled( bMergeEditorVisible ); + autoSolve->setEnabled( bMergeEditorVisible && m_bTripleDiff ); + unsolve->setEnabled( bMergeEditorVisible ); + if ( !bDirWindowHasFocus ) + { + chooseA->setEnabled( bMergeEditorVisible ); + chooseB->setEnabled( bMergeEditorVisible ); + chooseC->setEnabled( bMergeEditorVisible && m_bTripleDiff ); + } + chooseAEverywhere->setEnabled( bMergeEditorVisible ); + chooseBEverywhere->setEnabled( bMergeEditorVisible ); + chooseCEverywhere->setEnabled( bMergeEditorVisible && m_bTripleDiff ); + chooseAForUnsolvedConflicts->setEnabled( bMergeEditorVisible ); + chooseBForUnsolvedConflicts->setEnabled( bMergeEditorVisible ); + chooseCForUnsolvedConflicts->setEnabled( bMergeEditorVisible && m_bTripleDiff ); + chooseAForUnsolvedWhiteSpaceConflicts->setEnabled( bMergeEditorVisible ); + chooseBForUnsolvedWhiteSpaceConflicts->setEnabled( bMergeEditorVisible ); + chooseCForUnsolvedWhiteSpaceConflicts->setEnabled( bMergeEditorVisible && m_bTripleDiff ); + mergeHistory->setEnabled( bMergeEditorVisible ); + mergeRegExp->setEnabled( bMergeEditorVisible ); + showWindowA->setEnabled( bDiffWindowVisible && ( m_pDiffTextWindow2->isVisible() || m_pDiffTextWindow3->isVisible() ) ); + showWindowB->setEnabled( bDiffWindowVisible && ( m_pDiffTextWindow1->isVisible() || m_pDiffTextWindow3->isVisible() )); + showWindowC->setEnabled( bDiffWindowVisible && m_bTripleDiff && ( m_pDiffTextWindow1->isVisible() || m_pDiffTextWindow2->isVisible() ) ); + editFind->setEnabled( bDiffWindowVisible ); + editFindNext->setEnabled( bDiffWindowVisible ); + m_pFindDialog->m_pSearchInC->setEnabled( m_bTripleDiff ); + m_pFindDialog->m_pSearchInOutput->setEnabled( bMergeEditorVisible ); + + bool bSavable = bMergeEditorVisible && m_pMergeResultWindow->getNrOfUnsolvedConflicts()==0; + fileSave->setEnabled( m_bOutputModified && bSavable ); + fileSaveAs->setEnabled( bSavable ); + + goTop->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaAboveCurrent() ); + goBottom->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaBelowCurrent() ); + goCurrent->setEnabled( bDiffWindowVisible ); + goPrevUnsolvedConflict->setEnabled( bMergeEditorVisible && m_pMergeResultWindow->isUnsolvedConflictAboveCurrent() ); + goNextUnsolvedConflict->setEnabled( bMergeEditorVisible && m_pMergeResultWindow->isUnsolvedConflictBelowCurrent() ); + goPrevConflict->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isConflictAboveCurrent() ); + goNextConflict->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isConflictBelowCurrent() ); + goPrevDelta->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaAboveCurrent() ); + goNextDelta->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaBelowCurrent() ); + + overviewModeNormal->setEnabled( m_bTripleDiff && bDiffWindowVisible ); + overviewModeAB->setEnabled( m_bTripleDiff && bDiffWindowVisible ); + overviewModeAC->setEnabled( m_bTripleDiff && bDiffWindowVisible ); + overviewModeBC->setEnabled( m_bTripleDiff && bDiffWindowVisible ); + Overview::e_OverviewMode overviewMode = m_pOverview==0 ? Overview::eOMNormal : m_pOverview->getOverviewMode(); + overviewModeNormal->setChecked( overviewMode == Overview::eOMNormal ); + overviewModeAB->setChecked( overviewMode == Overview::eOMAvsB ); + overviewModeAC->setChecked( overviewMode == Overview::eOMAvsC ); + overviewModeBC->setChecked( overviewMode == Overview::eOMBvsC ); + + winToggleSplitOrientation->setEnabled( bDiffWindowVisible && m_pDiffWindowSplitter!=0 ); +} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/smalldialogs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/smalldialogs.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,595 @@ +/*************************************************************************** + * Copyright (C) 2005-2006 by Joachim Eibl * + * joachim.eibl at gmx.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include "smalldialogs.h" +#include "optiondialog.h" +#include "diff.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// OpenDialog ************************************************************** + +OpenDialog::OpenDialog( + QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, + bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ) +: QDialog( pParent ) +{ + setObjectName("OpenDialog"); + setModal(true); + m_pOptions = pOptions; + + QVBoxLayout* v = new QVBoxLayout( this ); + v->setMargin(5); + QGridLayout* h = new QGridLayout(); + v->addLayout(h); + h->setSpacing( 5 ); + h->setColumnStretch( 1, 10 ); + + QLabel* label = new QLabel( i18n("A (Base):"), this ); + + m_pLineA = new QComboBox(); + m_pLineA->setEditable(true); + m_pLineA->insertItems( 0, m_pOptions->m_recentAFiles ); + m_pLineA->setEditText( KURL(n1).prettyURL() ); + m_pLineA->setMinimumWidth( 200 ); + QPushButton * button = new QPushButton( i18n("File..."), this ); + connect( button, SIGNAL(clicked()), this, SLOT( selectFileA() ) ); + QPushButton * button2 = new QPushButton( i18n("Dir..."), this ); + connect( button2, SIGNAL(clicked()), this, SLOT( selectDirA() ) ); + connect( m_pLineA, SIGNAL(editTextChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); + + h->addWidget( label, 0, 0 ); + h->addWidget( m_pLineA, 0, 1 ); + h->addWidget( button, 0, 2 ); + h->addWidget( button2, 0, 3 ); + + label = new QLabel( "B:", this ); + m_pLineB = new QComboBox(); + m_pLineB->setEditable(true); + m_pLineB->insertItems( 0, m_pOptions->m_recentBFiles ); + m_pLineB->setEditText( KURL(n2).prettyURL() ); + m_pLineB->setMinimumWidth( 200 ); + button = new QPushButton( i18n("File..."), this ); + connect( button, SIGNAL(clicked()), this, SLOT( selectFileB() ) ); + button2 = new QPushButton( i18n("Dir..."), this ); + connect( button2, SIGNAL(clicked()), this, SLOT( selectDirB() ) ); + connect( m_pLineB, SIGNAL(editTextChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); + + h->addWidget( label, 1, 0 ); + h->addWidget( m_pLineB, 1, 1 ); + h->addWidget( button, 1, 2 ); + h->addWidget( button2, 1, 3 ); + + label = new QLabel( i18n("C (Optional):"), this ); + m_pLineC= new QComboBox(); + m_pLineC->setEditable(true); + m_pLineC->insertItems( 0, m_pOptions->m_recentCFiles ); + m_pLineC->setEditText( KURL(n3).prettyURL() ); + m_pLineC->setMinimumWidth( 200 ); + button = new QPushButton( i18n("File..."), this ); + connect( button, SIGNAL(clicked()), this, SLOT( selectFileC() ) ); + button2 = new QPushButton( i18n("Dir..."), this ); + connect( button2, SIGNAL(clicked()), this, SLOT( selectDirC() ) ); + connect( m_pLineC, SIGNAL(editTextChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); + + h->addWidget( label, 2, 0 ); + h->addWidget( m_pLineC, 2, 1 ); + h->addWidget( button, 2, 2 ); + h->addWidget( button2, 2, 3 ); + + m_pMerge = new QCheckBox( i18n("Merge"), this ); + h->addWidget( m_pMerge, 3, 0 ); + + QHBoxLayout* hl = new QHBoxLayout(); + h->addLayout( hl, 3, 1 ); + hl->addStretch(2); + button = new QPushButton(i18n("Swap/Copy Names ..."), this); + //button->setToggleButton(false); + hl->addWidget( button ); + + QMenu* m = new QMenu(this); + m->addAction( i18n("Swap %1<->%2").arg("A").arg("B") ); + m->addAction( i18n("Swap %1<->%2").arg("B").arg("C") ); + m->addAction( i18n("Swap %1<->%2").arg("C").arg("A") ); + m->addAction( i18n("Copy %1->Output").arg("A") ); + m->addAction( i18n("Copy %1->Output").arg("B") ); + m->addAction( i18n("Copy %1->Output").arg("C") ); + m->addAction( i18n("Swap %1<->Output").arg("A") ); + m->addAction( i18n("Swap %1<->Output").arg("B") ); + m->addAction( i18n("Swap %1<->Output").arg("C") ); + connect( m, SIGNAL(triggered(QAction*)), this, SLOT(slotSwapCopyNames(QAction*))); + button->setMenu(m); + + + hl->addStretch(2); + + label = new QLabel( i18n("Output (optional):"), this ); + m_pLineOut = new QComboBox(); + m_pLineOut->setEditable(true); + m_pLineOut->insertItems( 0, m_pOptions->m_recentOutputFiles ); + m_pLineOut->setEditText( KURL(outputName).prettyURL() ); + m_pLineOut->setMinimumWidth( 200 ); + button = new QPushButton( i18n("File..."), this ); + connect( button, SIGNAL(clicked()), this, SLOT( selectOutputName() ) ); + button2 = new QPushButton( i18n("Dir..."), this ); + connect( button2, SIGNAL(clicked()), this, SLOT( selectOutputDir() ) ); + connect( m_pMerge, SIGNAL(stateChanged(int)), this, SLOT(internalSlot(int)) ); + connect( this, SIGNAL(internalSignal(bool)), m_pLineOut, SLOT(setEnabled(bool)) ); + connect( this, SIGNAL(internalSignal(bool)), button, SLOT(setEnabled(bool)) ); + connect( this, SIGNAL(internalSignal(bool)), button2, SLOT(setEnabled(bool)) ); + + m_pMerge->setChecked( !bMerge ); + m_pMerge->setChecked( bMerge ); +// m_pLineOutput->setEnabled( bMerge ); + +// button->setEnabled( bMerge ); + + h->addWidget( label, 4, 0 ); + h->addWidget( m_pLineOut, 4, 1 ); + h->addWidget( button, 4, 2 ); + h->addWidget( button2, 4, 3 ); + + h->addItem(new QSpacerItem(200, 0), 0, 1); + + QHBoxLayout* l = new QHBoxLayout(); + v->addLayout( l ); + l->setSpacing(5); + + button = new QPushButton( i18n("Configure..."), this ); + connect( button, SIGNAL(clicked()), pParent, slotConfigure ); + l->addWidget( button, 1 ); + + l->addStretch(1); + + button = new QPushButton( i18n("&OK"), this ); + button->setDefault( true ); + connect( button, SIGNAL(clicked()), this, SLOT( accept() ) ); + l->addWidget( button, 1 ); + + button = new QPushButton( i18n("&Cancel"), this ); + connect( button, SIGNAL(clicked()), this, SLOT( reject() ) ); + l->addWidget( button,1 ); + + QSize sh = sizeHint(); + setFixedHeight( sh.height() ); + m_bInputFileNameChanged = false; + +#ifdef KREPLACEMENTS_H + m_pLineA->lineEdit()->installEventFilter( this ); + m_pLineB->lineEdit()->installEventFilter( this ); + m_pLineC->lineEdit()->installEventFilter( this ); + m_pLineOut->lineEdit()->installEventFilter( this ); +#endif +} + +// Eventfilter: Only needed under Windows. +// Without this, files dropped in the line edit have URL-encoding. +// This eventfilter decodes the filenames as needed by KDiff3. +bool OpenDialog::eventFilter(QObject* o, QEvent* e) +{ + if ( e->type()==QEvent::DragEnter ) + { + QDragEnterEvent* d = static_cast(e); + d->setAccepted( d->mimeData()->hasUrls() ); + return true; + } + if (e->type()==QEvent::Drop) + { + QDropEvent* d = static_cast(e); + + if ( !d->mimeData()->hasUrls() ) + return false; + + QList lst = d->mimeData()->urls(); + + if ( lst.count() > 0 ) + { + static_cast(o)->setText( QDir::toNativeSeparators( lst[0].toLocalFile() ) ); + static_cast(o)->setFocus(); + } + + return true; + } + return false; +} + + +void OpenDialog::selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ) +{ + QString current = pLine->currentText(); + if (current.isEmpty() && i>3 ){ current = m_pLineC->currentText(); } + if (current.isEmpty() ){ current = m_pLineB->currentText(); } + if (current.isEmpty() ){ current = m_pLineA->currentText(); } + KURL newURL = bDir ? KFileDialog::getExistingURL( current, this) + : bSave ? KFileDialog::getSaveURL( current, 0, this) + : KFileDialog::getOpenURL( current, 0, this); + if ( !newURL.isEmpty() ) + { + pLine->setEditText( newURL.url() ); + } + // newURL won't be modified if nothing was selected. +} + +void OpenDialog::selectFileA() { selectURL( m_pLineA, false, 1, false ); } +void OpenDialog::selectFileB() { selectURL( m_pLineB, false, 2, false ); } +void OpenDialog::selectFileC() { selectURL( m_pLineC, false, 3, false ); } +void OpenDialog::selectOutputName(){ selectURL( m_pLineOut, false, 4, true ); } +void OpenDialog::selectDirA() { selectURL( m_pLineA, true, 1, false ); } +void OpenDialog::selectDirB() { selectURL( m_pLineB, true, 2, false ); } +void OpenDialog::selectDirC() { selectURL( m_pLineC, true, 3, false ); } +void OpenDialog::selectOutputDir() { selectURL( m_pLineOut, true, 4, true ); } + +void OpenDialog::internalSlot(int i) +{ + emit internalSignal(i!=0); +} + +// Clear the output-filename when any input-filename changed, +// because users forgot to change the output and accidently overwrote it with +// wrong data during a merge. +void OpenDialog::inputFilenameChanged() +{ + if(!m_bInputFileNameChanged) + { + m_bInputFileNameChanged=true; + m_pLineOut->clearEditText(); + } +} + +static void fixCurrentText( QComboBox* pCB ) +{ + QString s = pCB->currentText(); + + int pos = s.indexOf( '\n' ); + if ( pos>=0 ) + s=s.left(pos); + pos = s.indexOf( '\r' ); + if ( pos>=0 ) + s=s.left(pos); + + pCB->setEditText( s ); +} + +void OpenDialog::accept() +{ + int maxNofRecentFiles = 10; + fixCurrentText( m_pLineA ); + + QString s = m_pLineA->currentText(); + s = KURL::fromPathOrURL(s).prettyURL(); + QStringList* sl = &m_pOptions->m_recentAFiles; + // If an item exist, remove it from the list and reinsert it at the beginning. + sl->removeAll(s); + if ( !s.isEmpty() ) sl->prepend( s ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); + + fixCurrentText( m_pLineB ); + s = m_pLineB->currentText(); + s = KURL::fromPathOrURL(s).prettyURL(); + sl = &m_pOptions->m_recentBFiles; + sl->removeAll(s); + if ( !s.isEmpty() ) sl->prepend( s ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); + + fixCurrentText( m_pLineC ); + s = m_pLineC->currentText(); + s = KURL::fromPathOrURL(s).prettyURL(); + sl = &m_pOptions->m_recentCFiles; + sl->removeAll(s); + if ( !s.isEmpty() ) sl->prepend( s ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); + + fixCurrentText( m_pLineOut ); + s = m_pLineOut->currentText(); + s = KURL::fromPathOrURL(s).prettyURL(); + sl = &m_pOptions->m_recentOutputFiles; + sl->removeAll(s); + if ( !s.isEmpty() ) sl->prepend( s ); + if (sl->count()>maxNofRecentFiles) sl->erase( sl->begin()+maxNofRecentFiles, sl->end() ); + + QDialog::accept(); +} + +void OpenDialog::slotSwapCopyNames( QAction* pAction ) // id selected in the popup menu +{ + int id = pAction->parentWidget()->actions().indexOf(pAction); + QComboBox* cb1=0; + QComboBox* cb2=0; + switch(id) + { + case 0: cb1=m_pLineA; cb2=m_pLineB; break; + case 1: cb1=m_pLineB; cb2=m_pLineC; break; + case 2: cb1=m_pLineC; cb2=m_pLineA; break; + case 3: cb1=m_pLineA; cb2=m_pLineOut; break; + case 4: cb1=m_pLineB; cb2=m_pLineOut; break; + case 5: cb1=m_pLineC; cb2=m_pLineOut; break; + case 6: cb1=m_pLineA; cb2=m_pLineOut; break; + case 7: cb1=m_pLineB; cb2=m_pLineOut; break; + case 8: cb1=m_pLineC; cb2=m_pLineOut; break; + } + if ( cb1 && cb2 ) + { + QString t1 = cb1->currentText(); + QString t2 = cb2->currentText(); + cb2->setEditText(t1); + if ( id<=2 || id>=6 ) + { + cb1->setEditText( t2 ); + } + } +} + +// FindDialog ********************************************* + +FindDialog::FindDialog(QWidget* pParent) +: QDialog( pParent ) +{ + QGridLayout* layout = new QGridLayout( this ); + layout->setMargin(5); + layout->setSpacing(5); + + int line=0; + layout->addWidget( new QLabel(i18n("Search text:"),this), line, 0, 1, 2 ); + ++line; + + m_pSearchString = new QLineEdit( this ); + layout->addWidget( m_pSearchString, line, 0, 1, 2 ); + ++line; + + m_pCaseSensitive = new QCheckBox(i18n("Case sensitive"),this); + layout->addWidget( m_pCaseSensitive, line, 1 ); + + m_pSearchInA = new QCheckBox(i18n("Search A"),this); + layout->addWidget( m_pSearchInA, line, 0 ); + m_pSearchInA->setChecked( true ); + ++line; + + m_pSearchInB = new QCheckBox(i18n("Search B"),this); + layout->addWidget( m_pSearchInB, line, 0 ); + m_pSearchInB->setChecked( true ); + ++line; + + m_pSearchInC = new QCheckBox(i18n("Search C"),this); + layout->addWidget( m_pSearchInC, line, 0 ); + m_pSearchInC->setChecked( true ); + ++line; + + m_pSearchInOutput = new QCheckBox(i18n("Search output"),this); + layout->addWidget( m_pSearchInOutput, line, 0 ); + m_pSearchInOutput->setChecked( true ); + ++line; + + QPushButton* pButton = new QPushButton( i18n("&Search"), this ); + layout->addWidget( pButton, line, 0 ); + connect( pButton, SIGNAL(clicked()), this, SLOT(accept())); + + pButton = new QPushButton( i18n("&Cancel"), this ); + layout->addWidget( pButton, line, 1 ); + connect( pButton, SIGNAL(clicked()), this, SLOT(reject())); + + hide(); +} + + +RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, + const QString& historyStartRegExpToolTip, const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ) +: QDialog( pParent) +{ + int line=0; + setWindowTitle(i18n("Regular Expression Tester")); + QGridLayout* pGrid = new QGridLayout( this ); + pGrid->setSpacing(5); + pGrid->setMargin(5); + + QLabel* l = new QLabel(i18n("Auto merge regular expression:"), this); + pGrid->addWidget(l,line,0); + l->setToolTip( autoMergeRegExpToolTip ); + m_pAutoMergeRegExpEdit = new QLineEdit(this); + pGrid->addWidget(m_pAutoMergeRegExpEdit,line,1); + connect( m_pAutoMergeRegExpEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + ++line; + + l = new QLabel(i18n("Example auto merge line:"), this); + pGrid->addWidget(l,line,line,0,1); + l->setToolTip( i18n("For auto merge test copy a line as used in your files.") ); + m_pAutoMergeExampleEdit = new QLineEdit(this); + pGrid->addWidget(m_pAutoMergeExampleEdit,line,1); + connect( m_pAutoMergeExampleEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + ++line; + + l = new QLabel(i18n("Match result:"), this); + pGrid->addWidget(l,line,0); + m_pAutoMergeMatchResult = new QLineEdit(this); + m_pAutoMergeMatchResult->setReadOnly(true); + pGrid->addWidget(m_pAutoMergeMatchResult,line,1); + ++line; + + pGrid->addItem( new QSpacerItem(100,20), line, 0 ); + pGrid->setRowStretch( line, 5); + ++line; + + l = new QLabel(i18n("History start regular expression:"), this); + pGrid->addWidget(l,line,0); + l->setToolTip( historyStartRegExpToolTip ); + m_pHistoryStartRegExpEdit = new QLineEdit(this); + pGrid->addWidget(m_pHistoryStartRegExpEdit,line,1); + connect( m_pHistoryStartRegExpEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + ++line; + + l = new QLabel(i18n("Example history start line (with leading comment):"), this); + pGrid->addWidget(l,line,line,0,1); + ++line; + l->setToolTip( i18n("Copy a history start line as used in your files,\n" + "including the leading comment.") ); + m_pHistoryStartExampleEdit = new QLineEdit(this); + pGrid->addWidget(m_pHistoryStartExampleEdit,line,1); + connect( m_pHistoryStartExampleEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + ++line; + + l = new QLabel(i18n("Match result:"), this); + pGrid->addWidget(l,line,0); + m_pHistoryStartMatchResult = new QLineEdit(this); + m_pHistoryStartMatchResult->setReadOnly(true); + pGrid->addWidget(m_pHistoryStartMatchResult,line,1); + ++line; + + pGrid->addItem( new QSpacerItem(100,20), line, 0 ); + pGrid->setRowStretch( line, 5); + ++line; + + l = new QLabel(i18n("History entry start regular expression:"), this); + pGrid->addWidget(l,line,0); + l->setToolTip( historyEntryStartRegExpToolTip ); + m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); + pGrid->addWidget(m_pHistoryEntryStartRegExpEdit,line,1); + connect( m_pHistoryEntryStartRegExpEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + ++line; + + l = new QLabel(i18n("History sort key order:"), this); + pGrid->addWidget(l,line,0); + l->setToolTip( historySortKeyOrderToolTip ); + m_pHistorySortKeyOrderEdit = new QLineEdit(this); + pGrid->addWidget(m_pHistorySortKeyOrderEdit,line,1); + connect( m_pHistorySortKeyOrderEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + ++line; + + l = new QLabel(i18n("Example history entry start line (without leading comment):"), this); + pGrid->addWidget(l,line,line,0,1); + l->setToolTip( i18n("Copy a history entry start line as used in your files,\n" + "but omit the leading comment.") ); + ++line; + m_pHistoryEntryStartExampleEdit = new QLineEdit(this); + pGrid->addWidget(m_pHistoryEntryStartExampleEdit,line,1); + connect( m_pHistoryEntryStartExampleEdit, SIGNAL(editTextChanged(const QString&)), this, SLOT(slotRecalc())); + ++line; + + l = new QLabel(i18n("Match result:"), this); + pGrid->addWidget(l,line,0); + m_pHistoryEntryStartMatchResult = new QLineEdit(this); + m_pHistoryEntryStartMatchResult->setReadOnly(true); + pGrid->addWidget(m_pHistoryEntryStartMatchResult,line,1); + ++line; + + l = new QLabel(i18n("Sort key result:"), this); + pGrid->addWidget(l,line,0); + m_pHistorySortKeyResult = new QLineEdit(this); + m_pHistorySortKeyResult->setReadOnly(true); + pGrid->addWidget(m_pHistorySortKeyResult,line,1); + ++line; + + QPushButton* pButton = new QPushButton(i18n("OK"), this); + pGrid->addWidget(pButton,line,0); + connect( pButton, SIGNAL(clicked()), this, SLOT(accept())); + + pButton = new QPushButton(i18n("Cancel"), this); + pGrid->addWidget(pButton,line,1); + connect( pButton, SIGNAL(clicked()), this, SLOT(reject())); + + resize( 800, sizeHint().height() ); +} + +void RegExpTester::init( const QString& autoMergeRegExp, const QString& historyStartRegExp, const QString& historyEntryStartRegExp, const QString historySortKeyOrder ) +{ + m_pAutoMergeRegExpEdit->setText( autoMergeRegExp ); + m_pHistoryStartRegExpEdit->setText( historyStartRegExp ); + m_pHistoryEntryStartRegExpEdit->setText( historyEntryStartRegExp ); + m_pHistorySortKeyOrderEdit->setText( historySortKeyOrder ); +} + +QString RegExpTester::autoMergeRegExp() +{ + return m_pAutoMergeRegExpEdit->text(); +} + +QString RegExpTester::historyStartRegExp() +{ + return m_pHistoryStartRegExpEdit->text(); +} + +QString RegExpTester::historyEntryStartRegExp() +{ + return m_pHistoryEntryStartRegExpEdit->text(); +} + +QString RegExpTester::historySortKeyOrder() +{ + return m_pHistorySortKeyOrderEdit->text(); +} + +void RegExpTester::slotRecalc() +{ + QRegExp autoMergeRegExp( m_pAutoMergeRegExpEdit->text() ); + if ( autoMergeRegExp.exactMatch( m_pAutoMergeExampleEdit->text() ) ) + { + m_pAutoMergeMatchResult->setText( i18n("Match success.") ); + } + else + { + m_pAutoMergeMatchResult->setText( i18n("Match failed.") ); + } + + QRegExp historyStartRegExp( m_pHistoryStartRegExpEdit->text() ); + if ( historyStartRegExp.exactMatch( m_pHistoryStartExampleEdit->text() ) ) + { + m_pHistoryStartMatchResult->setText( i18n("Match success.") ); + } + else + { + m_pHistoryStartMatchResult->setText( i18n("Match failed.") ); + } + + + QStringList parenthesesGroups; + bool bSuccess = findParenthesesGroups( m_pHistoryEntryStartRegExpEdit->text(), parenthesesGroups ); + if ( ! bSuccess ) + { + m_pHistoryEntryStartMatchResult->setText( i18n("Opening and closing parentheses don't match in regular expression.") ); + m_pHistorySortKeyResult->setText( i18n("") ); + return; + } + QRegExp historyEntryStartRegExp( m_pHistoryEntryStartRegExpEdit->text() ); + QString s = m_pHistoryEntryStartExampleEdit->text(); + + if ( historyEntryStartRegExp.exactMatch( s ) ) + { + m_pHistoryEntryStartMatchResult->setText( i18n("Match success.") ); + QString key = calcHistorySortKey( m_pHistorySortKeyOrderEdit->text(),historyEntryStartRegExp,parenthesesGroups); + m_pHistorySortKeyResult->setText(key); + } + else + { + m_pHistoryEntryStartMatchResult->setText( i18n("Match failed.") ); + m_pHistorySortKeyResult->setText( i18n("") ); + } +} + +//#include "smalldialogs.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/smalldialogs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/smalldialogs.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,119 @@ +/*************************************************************************** + * Copyright (C) 2005 by Joachim Eibl * + * joachim.eibl at gmx.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef SMALLDIALOGS_H +#define SMALLDIALOGS_H + +#include + +class OptionDialog; +class QComboBox; +class QCheckBox; +class QLineEdit; +class QLabel; + +class OpenDialog : public QDialog +{ + Q_OBJECT +public: + OpenDialog( + QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, + bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ); + + QComboBox* m_pLineA; + QComboBox* m_pLineB; + QComboBox* m_pLineC; + QComboBox* m_pLineOut; + + QCheckBox* m_pMerge; + virtual void accept(); + virtual bool eventFilter(QObject* o, QEvent* e); +private: + OptionDialog* m_pOptions; + void selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ); + bool m_bInputFileNameChanged; +private slots: + void selectFileA(); + void selectFileB(); + void selectFileC(); + void selectDirA(); + void selectDirB(); + void selectDirC(); + void selectOutputName(); + void selectOutputDir(); + void internalSlot(int); + void inputFilenameChanged(); + void slotSwapCopyNames(QAction*); +signals: + void internalSignal(bool); +}; + +class FindDialog : public QDialog +{ + Q_OBJECT +public: + FindDialog(QWidget* pParent); + +signals: + void findNext(); + +public: + QLineEdit* m_pSearchString; + QCheckBox* m_pSearchInA; + QCheckBox* m_pSearchInB; + QCheckBox* m_pSearchInC; + QCheckBox* m_pSearchInOutput; + QCheckBox* m_pCaseSensitive; + + int currentLine; + int currentPos; + int currentWindow; +}; + + +class RegExpTester : public QDialog +{ + Q_OBJECT +private: + QLineEdit* m_pAutoMergeRegExpEdit; + QLineEdit* m_pAutoMergeMatchResult; + QLineEdit* m_pAutoMergeExampleEdit; + QLineEdit* m_pHistoryStartRegExpEdit; + QLineEdit* m_pHistoryStartMatchResult; + QLineEdit* m_pHistoryStartExampleEdit; + QLineEdit* m_pHistoryEntryStartRegExpEdit; + QLineEdit* m_pHistorySortKeyOrderEdit; + QLineEdit* m_pHistoryEntryStartExampleEdit; + QLineEdit* m_pHistoryEntryStartMatchResult; + QLineEdit* m_pHistorySortKeyResult; + OptionDialog* m_pOptionDialog; +public: + RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, const QString& historyStartRegExpToolTip, + const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ); + void init( const QString& autoMergeRegExp, const QString& historyStartRegExp, const QString& historyEntryStartRegExp, const QString sortKeyOrder ); + QString autoMergeRegExp(); + QString historyStartRegExp(); + QString historyEntryStartRegExp(); + QString historySortKeyOrder(); +public slots: + void slotRecalc(); +}; + +#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/stable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/stable.cpp Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,1 @@ +#include "stable.h" \ No newline at end of file diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/stable.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/stable.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,6 @@ +#ifndef STABLE_H +#define STABLE_H +#include +#include +#include +#endif \ No newline at end of file diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/version.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/version.h Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,2 @@ +#undef VERSION +#define VERSION "0.9.91-Qt4" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/autoadvance.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/autoadvance.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *autoadvance[] = { +/* columns rows colors chars-per-pixel */ +"16 16 3 1", +". c #0080FF", +"# c #000000", +" c None", +/* pixels */ +" ## # # ### # ", +"# # # # # # #", +"# # # # # # #", +"#### # # # # #", +"# # ### # # ", +" ", +" ", +" ######## ", +" #....# ", +" #..# ", +" ## ", +" ######## ", +" #....# ", +" #..# ", +" ## ", +" " +}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/currentpos.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/currentpos.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *currentpos[]={ +"16 16 3 1", +" c #0080FF", +"# c #000000", +". c None", +"................", +"................", +"................", +".#............#.", +".##..........##.", +".# #........# #.", +".# #..##..# #.", +".# ## ## #.", +".# # # #.", +".# ## ## #.", +".# #..##..# #.", +".# #........# #.", +".##..........##.", +".#............#.", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/down1arrow.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/down1arrow.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *down1arrow[] = { +/* columns rows colors chars-per-pixel */ +"16 16 3 1", +" c #0080ff", +"# c #000000", +". c None", +/* pixels */ +"................", +"................", +"................", +"................", +"................", +"..############..", +"...# #...", +"....# #....", +".....# #.....", +"......# #......", +".......##.......", +"................", +"................", +"................", +"................", +"................" +}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/down2arrow.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/down2arrow.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *down2arrow[] = { +/* columns rows colors chars-per-pixel */ +"16 16 3 1", +" c #0080ff", +"# c #000000", +". c None", +/* pixels */ +"................", +"................", +"..############..", +"...# #...", +"....# #....", +".....# #.....", +"......# #......", +".......##.......", +"..############..", +"...# #...", +"....# #....", +".....# #.....", +"......# #......", +".......##.......", +"................", +"................" +}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/downend.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/downend.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *downend[]={ +"16 16 3 1", +" c #0080ff", +"# c #000000", +". c None", +"................", +"................", +"................", +"................", +"................", +"..############..", +"...# #...", +"....# #....", +".....# #.....", +"......# #......", +".......##.......", +"..############..", +"................", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/file.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/file.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,24 @@ +/* XPM */ +static const char *file_pm[]={ +"16 16 5 1", +". c None", +"# c #000000", +"c c #c0c0c0", +"b c #dcdcdc", +"a c #ffffff", +"..#########.....", +"..#aaaaaabb#....", +"..#aaaaaacab#...", +"..#aaaaaacaab#..", +"..#aaaaaac####..", +"..#aaaaaaaccc#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..############.."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/filenew.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/filenew.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char * filenew[] = { +"10 14 5 1", +" c None", +". c #000000", +"+ c #FFFFFF", +"@ c #DCDCDC", +"# c #C0C0C0", +"....... ", +".++++@@. ", +".++++#+@. ", +".++++#++@.", +".++++#....", +".+++++###.", +".++++++++.", +".++++++++.", +".++++++++.", +".++++++++.", +".++++++++.", +".++++++++.", +".++++++++.", +".........."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/fileopen.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/fileopen.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *fileopen[] = { +" 16 13 5 1", +". c #040404", +"# c #808304", +"a c None", +"b c #f3f704", +"c c #f3f7f3", +"aaaaaaaaa...aaaa", +"aaaaaaaa.aaa.a.a", +"aaaaaaaaaaaaa..a", +"a...aaaaaaaa...a", +".bcb.......aaaaa", +".cbcbcbcbc.aaaaa", +".bcbcbcbcb.aaaaa", +".cbcb...........", +".bcb.#########.a", +".cb.#########.aa", +".b.#########.aaa", +"..#########.aaaa", +"...........aaaaa" +}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/fileprint.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/fileprint.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,24 @@ +/* XPM */ +static const char *fileprint[] = { +" 16 14 6 1", +". c #000000", +"# c #848284", +"a c #c6c3c6", +"b c #ffff00", +"c c #ffffff", +"d c None", +"ddddd.........dd", +"dddd.cccccccc.dd", +"dddd.c.....c.ddd", +"ddd.cccccccc.ddd", +"ddd.c.....c....d", +"dd.cccccccc.a.a.", +"d..........a.a..", +".aaaaaaaaaa.a.a.", +".............aa.", +".aaaaaa###aa.a.d", +".aaaaaabbbaa...d", +".............a.d", +"d.aaaaaaaaa.a.dd", +"dd...........ddd" +}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/filesave.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/filesave.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,21 @@ +/* XPM */ +static const char *filesave[] = { +" 14 14 3 1", +". c #040404", +"# c #808304", +"a c #bfc2bf", +"..............", +".#.aaaaaaaa.a.", +".#.aaaaaaaa...", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".##........##.", +".############.", +".##.........#.", +".##......aa.#.", +".##......aa.#.", +".##......aa.#.", +"a............." +}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/folder.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/folder.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,24 @@ +/* XPM */ +static const char *folder_pm[]={ +"16 16 5 1", +". c None", +"# c #040404", +"c c #808304", +"a c #f3f704", +"b c #f3f7f3", +"................", +"................", +"................", +".###............", +"#aba#######.....", +"#babababab#.....", +"#ababababa#.....", +"#baba###########", +"#aba#ccccccccc#.", +"#ba#ccccccccc#..", +"#a#ccccccccc#...", +"##ccccccccc#....", +"###########.....", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/iconA.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/iconA.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *iconA[]={ +"16 16 3 1", +" c #0080FF", +"# c #000000", +". c None", +"................", +"................", +"......###.......", +".....# #......", +"....# # #.....", +"...# #.# #....", +"...# #...# #....", +"...# #...# #....", +"...# ##### #....", +"...# #....", +"...# ##### #....", +"...# #...# #....", +"...###...###....", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/iconB.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/iconB.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *iconB[]={ +"16 16 3 1", +" c #0080FF", +"# c #000000", +". c None", +"................", +"................", +"...#######......", +"...# #.....", +"...# #### #....", +"...# #...# #....", +"...# #### #....", +"...# #.....", +"...# #### #....", +"...# #...# #....", +"...# #### #....", +"...# #.....", +"...#######......", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/iconC.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/iconC.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *iconC[]={ +"16 16 3 1", +" c #0080FF", +"# c #000000", +". c None", +"................", +"................", +"......####......", +".....# #.....", +"....# ### #....", +"...# #...##....", +"...# #..........", +"...# #..........", +"...# #..........", +"...# #..........", +"...# #...##....", +"....# ### #....", +".....# #.....", +"......####......", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/link_arrow.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/link_arrow.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,24 @@ +/* XPM */ +static const char *link_arrow[]={ +"16 16 5 1", +". c None", +"b c #000000", +"# c #585858", +"c c #dcdcdc", +"a c #ffffff", +"................", +"................", +"................", +"................", +"................", +"................", +"................", +"................", +"########........", +"#aaaaaab........", +"#aabbbab........", +"#aac#bab........", +"#acbcbab........", +"#abcaaab........", +"#aaaaaab........", +"#bbbbbbb........"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/nextunsolved.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/nextunsolved.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,23 @@ +/* XPM */ +static const char *nextunsolved[]={ +"16 16 4 1", +". c None", +" c #0080ff", +"# c #000000", +"a c #ff0000", +"..############..", +"...# #...", +"....# #....", +".....# #.....", +"......# #......", +"..############..", +"...# #...", +"....# #....", +".....# #.....", +"......# #......", +"..############..", +"...#aaaaaaaa#...", +"....#aaaaaa#....", +".....#aaaa#.....", +"......#aa#......", +".......##......."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/prevunsolved.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/prevunsolved.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,23 @@ +/* XPM */ +static const char *prevunsolved[]={ +"16 16 4 1", +" c #0080ff", +"# c #000000", +"a c #ff0000", +". c None", +".......##.......", +"......#aa#......", +".....#aaaa#.....", +"....#aaaaaa#....", +"...#aaaaaaaa#...", +"..############..", +"......# #......", +".....# #.....", +"....# #....", +"...# #...", +"..############..", +"......# #......", +".....# #.....", +"....# #....", +"...# #...", +"..############.."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/reload.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/reload.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,74 @@ +/* XPM */ +static const char *reloadIcon[]={ +"16 16 55 1", +". c None", +"e c #25502a", +"# c #25512b", +"d c #25522b", +"g c #26552c", +"c c #27562e", +"n c #27582f", +"b c #28592e", +"M c #285930", +"a c #295a2f", +"q c #295a30", +"G c #295c31", +"t c #2a5e31", +"y c #2b6635", +"U c #2b6636", +"Q c #2f703a", +"H c #327b3d", +"0 c #36843f", +"W c #388943", +"u c #3f7046", +"r c #42764a", +"f c #44754b", +"A c #488653", +"N c #50995b", +"K c #529d5f", +"J c #529f60", +"m c #53885c", +"l c #55a161", +"B c #57a863", +"R c #5aaa66", +"I c #5aad69", +"v c #5baa67", +"X c #5cb16b", +"o c #5db469", +"k c #5eb56c", +"z c #5eb66b", +"s c #5fb26d", +"V c #64b171", +"Y c #64c274", +"j c #69c779", +"Z c #6dc97d", +"p c #729a77", +"O c #73c782", +"i c #7ace89", +"w c #7bce89", +"C c #7ecb8b", +"L c #80d191", +"h c #80d193", +"S c #8dd49b", +"P c #95d8a1", +"D c #a7ddb1", +"x c #bde3c2", +"T c #c0e5c5", +"E c #daf0de", +"F c #f9fdf9", +"................", +"..#abcde#df.....", +"..ghhhijklm.....", +"..nhoooooop.....", +"..qho....rso....", +"..tho...uvwxo...", +"..yhz..ABCDEFo..", +"gGHhIJJAAKLooo..", +"MNOPEFo..Qho....", +".eRSTo...Uho....", +"..eV.....Uho....", +"...W.....Qho....", +"....nXYZihho....", +"....0ooooooo....", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/showequalfiles.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/showequalfiles.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,23 @@ +/* XPM */ +static const char *showequalfiles[]={ +"16 16 4 1", +"# c None", +"a c None", +". c #000000", +"b c #00ff00", +"...........##aaa", +".bbbb.bbbb.##aaa", +".bbbb.bbbb.##aaa", +".bbbb.bbbb.##aaa", +".bbbb.bbbb.##aaa", +"...........##aaa", +"aaaaaaaaaaaaaaaa", +"................", +"aaaaaaaaaaaaaaaa", +"................", +".bbbb.bbbb.bbbb.", +".bbbb.bbbb.bbbb.", +".bbbb.bbbb.bbbb.", +".bbbb.bbbb.bbbb.", +"................", +"aaaaaaaaaaaaaaaa"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/showfilesonlyina.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/showfilesonlyina.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,23 @@ +/* XPM */ +static const char *showfilesonlyina[]={ +"16 16 4 1", +"# c None", +"a c None", +". c #000000", +"b c #00ff00", +"...........##aaa", +".bbbb......##aaa", +".bbbb......##aaa", +".bbbb......##aaa", +".bbbb......##aaa", +"...........##aaa", +"aaaaaaaaaaaaaaaa", +"................", +"aaaaaaaaaaaaaaaa", +"................", +".bbbb...........", +".bbbb...........", +".bbbb...........", +".bbbb...........", +"................", +"aaaaaaaaaaaaaaaa"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/showfilesonlyinb.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/showfilesonlyinb.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,23 @@ +/* XPM */ +static const char *showfilesonlyinb[]={ +"16 16 4 1", +"# c None", +"a c None", +". c #000000", +"b c #00ff00", +"...........##aaa", +"......bbbb.##aaa", +"......bbbb.##aaa", +"......bbbb.##aaa", +"......bbbb.##aaa", +"...........##aaa", +"aaaaaaaaaaaaaaaa", +"................", +"aaaaaaaaaaaaaaaa", +"................", +"......bbbb......", +"......bbbb......", +"......bbbb......", +"......bbbb......", +"................", +"aaaaaaaaaaaaaaaa"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/showfilesonlyinc.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/showfilesonlyinc.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *showfilesonlyinc[]={ +"16 16 3 1", +". c None", +"# c #000000", +"a c #00ff00", +"................", +"................", +"................", +"................", +"................", +"################", +"###########aaaa#", +"###########aaaa#", +"###########aaaa#", +"###########aaaa#", +"################", +"................", +"................", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/showlinenumbers.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/showlinenumbers.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,21 @@ +/* XPM */ +static const char *showlinenumbers[]={ +"16 16 2 1", +". c None", +"# c #000040", +"................", +"................", +"................", +"................", +"...#...##..###..", +"..##..#..#....#.", +"...#.....#....#.", +"...#....#...##..", +"...#...#......#.", +"...#..#.......#.", +"..###.####.###..", +"................", +"................", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/showwhitespace.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/showwhitespace.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *showwhitespace[]={ +"16 16 3 1", +". c None", +"# c #000000", +"a c #ffffff", +"................", +"................", +"..############..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..#aaaaaaaaaa#..", +"..############..", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/showwhitespacechars.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/showwhitespacechars.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,21 @@ +/* XPM */ +static const char *showwhitespacechars[]={ +"16 16 2 1", +". c None", +"# c #000040", +"................", +"................", +"................", +"................", +"................", +"................", +"................", +"................", +"................", +"................", +".####.####.####.", +".####.####.####.", +"................", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/startmerge.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/startmerge.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *startmerge[]={ +"16 16 6 1", +". c None", +"# c #000000", +"b c #0000ff", +"c c #00ffff", +"d c #ff0000", +"a c #ffff00", +".......##.......", +"......#aa#......", +"......#aa#......", +"...b.b.##.b.b...", +"...bb......bb...", +"...bbb....bbb...", +".##..........##.", +"#cc#........#cc#", +"#cc#........#cc#", +".##.b.b..b.b.##.", +".....bb..bb.....", +"....bbb..bbb....", +".......##.......", +"......#dd#......", +"......#dd#......", +".......##......."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/up1arrow.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/up1arrow.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *up1arrow[]={ +"16 16 3 1", +". c None", +"# c #000000", +"a c #0080ff", +"................", +"................", +"................", +"................", +"................", +".......##.......", +"......#aa#......", +".....#aaaa#.....", +"....#aaaaaa#....", +"...#aaaaaaaa#...", +"..############..", +"................", +"................", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/up2arrow.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/up2arrow.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *up2arrow[] = { +/* columns rows colors chars-per-pixel */ +"16 16 3 1", +" c #0080ff", +"# c #000000", +". c None", +/* pixels */ +"................", +"................", +".......##.......", +"......# #......", +".....# #.....", +"....# #....", +"...# #...", +"..############..", +".......##.......", +"......# #......", +".....# #.....", +"....# #....", +"...# #...", +"..############..", +"................", +"................" +}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src-QT4/xpm/upend.xpm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/src-QT4/xpm/upend.xpm Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,22 @@ +/* XPM */ +static const char *upend[]={ +"16 16 3 1", +" c #0080ff", +"# c #000000", +". c None", +"................", +"................", +"................", +"................", +"..############..", +".......##.......", +"......# #......", +".....# #.....", +"....# #....", +"...# #...", +"..############..", +"................", +"................", +"................", +"................", +"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/Makefile.am --- a/kdiff3/src/Makefile.am Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ - -# set the include path for X, qt and KDE -INCLUDES = $(all_includes) - -# these are the headers for your project -noinst_HEADERS = kdiff3_part.h kdiff3_shell.h kdiff3.h common.h diff.h \ - directorymergewindow.h merger.h optiondialog.h fileaccess.h version.h \ - smalldialogs.h difftextwindow.h mergeresultwindow.h - -# let automoc handle all of the meta source files (moc) -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kdiff3.pot - -KDE_ICON = kdiff3 - -# this Makefile creates both a KPart application and a KPart -######################################################################### -# APPLICATION SECTION -######################################################################### -# this is the program that gets installed. it's name is used for all -# of the other Makefile.am variables -bin_PROGRAMS = kdiff3 - -# the application source, library search path, and link libraries -kdiff3_SOURCES = main.cpp kdiff3_shell.cpp -kdiff3_LDFLAGS = $(KDE_RPATH) $(all_libraries) -kdiff3_LDADD = $(LIB_KPARTS) - -# this is where the desktop file will go -shelldesktopdir = $(kde_appsdir)/Development -shelldesktop_DATA = kdiff3.desktop - -# this is where the shell's XML-GUI resource file goes -shellrcdir = $(kde_datadir)/kdiff3 -shellrc_DATA = kdiff3_shell.rc - -######################################################################### -# KPART SECTION -######################################################################### -kde_module_LTLIBRARIES = libkdiff3part.la - -# the Part's source, library search path, and link libraries -libkdiff3part_la_SOURCES = kdiff3_part.cpp kdiff3.cpp directorymergewindow.cpp \ - merger.cpp pdiff.cpp difftextwindow.cpp diff.cpp optiondialog.cpp \ - mergeresultwindow.cpp fileaccess.cpp gnudiff_analyze.cpp gnudiff_io.cpp gnudiff_xmalloc.cpp \ - common.cpp smalldialogs.cpp -libkdiff3part_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) -libkdiff3part_la_LIBADD = $(LIB_KDEPRINT) $(LIB_KPARTS) $(LIB_KFILE) - -# this is where the desktop file will go -partdesktopdir = $(kde_servicesdir) -partdesktop_DATA = kdiff3part.desktop - -# this is where the part's XML-GUI resource file goes -partrcdir = $(kde_datadir)/kdiff3part -partrc_DATA = kdiff3_part.rc diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/Makefile.qt --- a/kdiff3/src/Makefile.qt Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,425 +0,0 @@ -############################################################################# -# Makefile for building: kdiff3 -# Generated by qmake (1.07a) (Qt 3.3.5) on: Sat Apr 8 20:11:51 2006 -# Project: kdiff3.pro -# Template: app -# Command: $(QMAKE) -o Makefile kdiff3.pro -############################################################################# - -####### Compiler, tools and options - -CC = gcc -CXX = g++ -LEX = flex -YACC = yacc -CFLAGS = -pipe -O2 -Wall -W -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -D__USE_STD_IOSTREAM -CXXFLAGS = -pipe -O2 -Wall -W -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 -LINK = g++ -LFLAGS = -LIBS = $(SUBLIBS) -L/usr/lib/ -L$(QTDIR)/lib/ -L/usr/X11R6/lib/ -lqt-mt -lXext -lX11 -lm -lpthread -AR = ar cqs -RANLIB = -MOC = $(QTDIR)/bin/moc -UIC = $(QTDIR)/bin/uic -QMAKE = qmake -TAR = tar -cf -GZIP = gzip -9f -COPY = cp -f -COPY_FILE= $(COPY) -COPY_DIR = $(COPY) -r -INSTALL_FILE= $(COPY_FILE) -INSTALL_DIR = $(COPY_DIR) -DEL_FILE = rm -f -SYMLINK = ln -sf -DEL_DIR = rmdir -MOVE = mv -f -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p - -####### Output directory - -OBJECTS_DIR = ./ - -####### Files - -HEADERS = version.h \ - diff.h \ - difftextwindow.h \ - mergeresultwindow.h \ - kdiff3.h \ - merger.h \ - optiondialog.h \ - kreplacements/kreplacements.h \ - directorymergewindow.h \ - fileaccess.h \ - kdiff3_shell.h \ - kdiff3_part.h \ - smalldialogs.h -SOURCES = main.cpp \ - diff.cpp \ - difftextwindow.cpp \ - kdiff3.cpp \ - merger.cpp \ - mergeresultwindow.cpp \ - optiondialog.cpp \ - pdiff.cpp \ - directorymergewindow.cpp \ - fileaccess.cpp \ - smalldialogs.cpp \ - kdiff3_shell.cpp \ - kdiff3_part.cpp \ - gnudiff_analyze.cpp \ - gnudiff_io.cpp \ - gnudiff_xmalloc.cpp \ - common.cpp \ - kreplacements/kreplacements.cpp \ - kreplacements/ShellContextMenu.cpp -OBJECTS = main.o \ - diff.o \ - difftextwindow.o \ - kdiff3.o \ - merger.o \ - mergeresultwindow.o \ - optiondialog.o \ - pdiff.o \ - directorymergewindow.o \ - fileaccess.o \ - smalldialogs.o \ - kdiff3_shell.o \ - kdiff3_part.o \ - gnudiff_analyze.o \ - gnudiff_io.o \ - gnudiff_xmalloc.o \ - common.o \ - kreplacements.o \ - ShellContextMenu.o -FORMS = -UICDECLS = -UICIMPLS = -SRCMOC = moc_difftextwindow.cpp \ - moc_mergeresultwindow.cpp \ - moc_kdiff3.cpp \ - moc_optiondialog.cpp \ - kreplacements/moc_kreplacements.cpp \ - moc_directorymergewindow.cpp \ - moc_fileaccess.cpp \ - moc_kdiff3_shell.cpp \ - moc_kdiff3_part.cpp \ - moc_smalldialogs.cpp -OBJMOC = moc_difftextwindow.o \ - moc_mergeresultwindow.o \ - moc_kdiff3.o \ - moc_optiondialog.o \ - moc_kreplacements.o \ - moc_directorymergewindow.o \ - moc_fileaccess.o \ - moc_kdiff3_shell.o \ - moc_kdiff3_part.o \ - moc_smalldialogs.o -DIST = kdiff3.pro -QMAKE_TARGET = kdiff3 -DESTDIR = -TARGET = kdiff3 - -first: all -####### Implicit rules - -.SUFFIXES: .c .o .cpp .cc .cxx .C - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.C.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.c.o: - $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< - -####### Build rules - -all: $(TARGET) - -$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS) - -mocables: $(SRCMOC) -uicables: $(UICDECLS) $(UICIMPLS) - -$(MOC): - ( cd $(QTDIR)/src/moc && $(MAKE) ) - -dist: - @mkdir -p .tmp/kdiff3 && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/kdiff3/ && ( cd `dirname .tmp/kdiff3` && $(TAR) kdiff3.tar kdiff3 && $(GZIP) kdiff3.tar ) && $(MOVE) `dirname .tmp/kdiff3`/kdiff3.tar.gz . && $(DEL_FILE) -r .tmp/kdiff3 - -mocclean: - -$(DEL_FILE) $(OBJMOC) - -$(DEL_FILE) $(SRCMOC) - -uiclean: - -yaccclean: -lexclean: -clean: mocclean - -$(DEL_FILE) $(OBJECTS) - -$(DEL_FILE) *~ core *.core - - -####### Sub-libraries - -distclean: clean - -$(DEL_FILE) $(TARGET) $(TARGET) - - -FORCE: - -####### Compile - -main.o: main.cpp kdiff3_shell.h \ - version.h \ - optiondialog.h \ - common.h - -diff.o: diff.cpp diff.h \ - fileaccess.h \ - optiondialog.h \ - common.h - -difftextwindow.o: difftextwindow.cpp difftextwindow.h \ - merger.h \ - optiondialog.h \ - diff.h \ - common.h \ - fileaccess.h - -kdiff3.o: kdiff3.cpp difftextwindow.h \ - mergeresultwindow.h \ - kdiff3.h \ - optiondialog.h \ - fileaccess.h \ - kdiff3_part.h \ - directorymergewindow.h \ - smalldialogs.h \ - xpm/downend.xpm \ - xpm/currentpos.xpm \ - xpm/down1arrow.xpm \ - xpm/down2arrow.xpm \ - xpm/upend.xpm \ - xpm/up1arrow.xpm \ - xpm/up2arrow.xpm \ - xpm/prevunsolved.xpm \ - xpm/nextunsolved.xpm \ - xpm/iconA.xpm \ - xpm/iconB.xpm \ - xpm/iconC.xpm \ - xpm/autoadvance.xpm \ - xpm/showwhitespace.xpm \ - xpm/showwhitespacechars.xpm \ - xpm/showlinenumbers.xpm \ - diff.h \ - common.h - -merger.o: merger.cpp merger.h \ - diff.h \ - common.h \ - fileaccess.h \ - optiondialog.h - -mergeresultwindow.o: mergeresultwindow.cpp mergeresultwindow.h \ - optiondialog.h \ - diff.h \ - common.h \ - fileaccess.h - -optiondialog.o: optiondialog.cpp optiondialog.h \ - diff.h \ - smalldialogs.h \ - common.h \ - fileaccess.h - -pdiff.o: pdiff.cpp difftextwindow.h \ - mergeresultwindow.h \ - directorymergewindow.h \ - smalldialogs.h \ - kdiff3.h \ - optiondialog.h \ - fileaccess.h \ - gnudiff_diff.h \ - diff.h \ - common.h \ - gnudiff_system.h - -directorymergewindow.o: directorymergewindow.cpp directorymergewindow.h \ - optiondialog.h \ - xpm/link_arrow.xpm \ - xpm/file.xpm \ - xpm/folder.xpm \ - xpm/startmerge.xpm \ - xpm/showequalfiles.xpm \ - xpm/showfilesonlyina.xpm \ - xpm/showfilesonlyinb.xpm \ - xpm/showfilesonlyinc.xpm \ - common.h \ - fileaccess.h \ - diff.h - -fileaccess.o: fileaccess.cpp fileaccess.h \ - optiondialog.h \ - common.h - -smalldialogs.o: smalldialogs.cpp smalldialogs.h \ - optiondialog.h \ - diff.h \ - common.h \ - fileaccess.h - -kdiff3_shell.o: kdiff3_shell.cpp kdiff3_shell.h \ - kdiff3.h \ - diff.h \ - common.h \ - fileaccess.h \ - optiondialog.h - -kdiff3_part.o: kdiff3_part.cpp kdiff3_part.h \ - kdiff3.h \ - fileaccess.h \ - version.h \ - diff.h \ - common.h \ - optiondialog.h - -gnudiff_analyze.o: gnudiff_analyze.cpp gnudiff_diff.h \ - gnudiff_system.h - -gnudiff_io.o: gnudiff_io.cpp gnudiff_diff.h \ - gnudiff_system.h - -gnudiff_xmalloc.o: gnudiff_xmalloc.cpp gnudiff_diff.h \ - gnudiff_system.h - -common.o: common.cpp common.h - -kreplacements.o: kreplacements/kreplacements.cpp kreplacements/kreplacements.h \ - common.h \ - xpm/fileopen.xpm \ - xpm/filesave.xpm \ - xpm/fileprint.xpm \ - kreplacements/kreplacements.moc - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o kreplacements.o kreplacements/kreplacements.cpp - -ShellContextMenu.o: kreplacements/ShellContextMenu.cpp kreplacements/ShellContextMenu.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ShellContextMenu.o kreplacements/ShellContextMenu.cpp - -moc_difftextwindow.o: moc_difftextwindow.cpp difftextwindow.h diff.h \ - common.h \ - fileaccess.h \ - optiondialog.h - -moc_mergeresultwindow.o: moc_mergeresultwindow.cpp mergeresultwindow.h diff.h \ - common.h \ - fileaccess.h \ - optiondialog.h - -moc_kdiff3.o: moc_kdiff3.cpp kdiff3.h diff.h \ - common.h \ - fileaccess.h \ - optiondialog.h - -moc_optiondialog.o: moc_optiondialog.cpp optiondialog.h - -moc_kreplacements.o: kreplacements/moc_kreplacements.cpp kreplacements/kreplacements.h common.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_kreplacements.o kreplacements/moc_kreplacements.cpp - -moc_directorymergewindow.o: moc_directorymergewindow.cpp directorymergewindow.h common.h \ - fileaccess.h \ - diff.h \ - optiondialog.h - -moc_fileaccess.o: moc_fileaccess.cpp fileaccess.h - -moc_kdiff3_shell.o: moc_kdiff3_shell.cpp kdiff3_shell.h - -moc_kdiff3_part.o: moc_kdiff3_part.cpp kdiff3_part.h - -moc_smalldialogs.o: moc_smalldialogs.cpp smalldialogs.h diff.h \ - common.h \ - fileaccess.h \ - optiondialog.h - -moc_difftextwindow.cpp: $(MOC) difftextwindow.h - $(MOC) difftextwindow.h -o moc_difftextwindow.cpp - -moc_mergeresultwindow.cpp: $(MOC) mergeresultwindow.h - $(MOC) mergeresultwindow.h -o moc_mergeresultwindow.cpp - -moc_kdiff3.cpp: $(MOC) kdiff3.h - $(MOC) kdiff3.h -o moc_kdiff3.cpp - -moc_optiondialog.cpp: $(MOC) optiondialog.h - $(MOC) optiondialog.h -o moc_optiondialog.cpp - -kreplacements/moc_kreplacements.cpp: $(MOC) kreplacements/kreplacements.h - $(MOC) kreplacements/kreplacements.h -o kreplacements/moc_kreplacements.cpp - -moc_directorymergewindow.cpp: $(MOC) directorymergewindow.h - $(MOC) directorymergewindow.h -o moc_directorymergewindow.cpp - -moc_fileaccess.cpp: $(MOC) fileaccess.h - $(MOC) fileaccess.h -o moc_fileaccess.cpp - -moc_kdiff3_shell.cpp: $(MOC) kdiff3_shell.h - $(MOC) kdiff3_shell.h -o moc_kdiff3_shell.cpp - -moc_kdiff3_part.cpp: $(MOC) kdiff3_part.h - $(MOC) kdiff3_part.h -o moc_kdiff3_part.cpp - -moc_smalldialogs.cpp: $(MOC) smalldialogs.h - $(MOC) smalldialogs.h -o moc_smalldialogs.cpp - -####### Install - -install_documentation: all - @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/da" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/de" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/en" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/et" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/fr" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/it" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/pt" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - -$(INSTALL_DIR) "../doc/sv" "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - - -uninstall_documentation: - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/da" - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/de" - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/en" - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/et" - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/fr" - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/it" - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/pt" - -$(DEL_FILE) -r "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/sv" - -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/share/doc/kdiff3/" - - -install_target: all - @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/bin/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/bin/" - -$(INSTALL_FILE) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)" - -uninstall_target: - -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)" - -$(DEL_DIR) "$(INSTALL_ROOT)/usr/local/bin/" - - -install: install_documentation install_target - -uninstall: uninstall_documentation uninstall_target - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/common.cpp --- a/kdiff3/src/common.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,341 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004-2006 by Joachim Eibl * - * joachim.eibl at gmx.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "common.h" -#include -#include -#include -#include -#include -#include -#include - -ValueMap::ValueMap() -{ -} - -ValueMap::~ValueMap() -{ -} - -void ValueMap::save( QTextStream& ts ) -{ - std::map::iterator i; - for( i=m_map.begin(); i!=m_map.end(); ++i) - { - QString key = i->first; - QString val = i->second; - ts << key << "=" << val << "\n"; - } -} - -QString ValueMap::getAsString() -{ - QString result; - std::map::iterator i; - for( i=m_map.begin(); i!=m_map.end(); ++i) - { - QString key = i->first; - QString val = i->second; - result += key + "=" + val + "\n"; - } - return result; -} - -void ValueMap::load( QTextStream& ts ) -{ - while ( !ts.atEnd() ) - { // until end of file... - QString s = ts.readLine(); // line of text excluding '\n' - int pos = s.find('='); - if( pos > 0 ) // seems not to have a tag - { - QString key = s.left(pos); - QString val = s.mid(pos+1); - m_map[key] = val; - } - } -} -/* -void ValueMap::load( const QString& s ) -{ - int pos=0; - while ( pos<(int)s.length() ) - { // until end of file... - int pos2 = s.find('=', pos); - int pos3 = s.find('\n', pos2 ); - if (pos3<0) - pos3=s.length(); - if( pos2 > 0 ) // seems not to have a tag - { - QString key = s.mid(pos, pos2-pos); - QString val = s.mid(pos2+1, pos3-pos2-1); - m_map[key] = val; - } - pos = pos3; - } -} -*/ - -// safeStringJoin and safeStringSplit allow to convert a stringlist into a string and back -// safely, even if the individual strings in the list contain the separator character. -QString safeStringJoin(const QStringList& sl, char sepChar, char metaChar ) -{ - // Join the strings in the list, using the separator ',' - // If a string contains the separator character, it will be replaced with "\,". - // Any occurances of "\" (one backslash) will be replaced with "\\" (2 backslashes) - - assert(sepChar!=metaChar); - - QString sep; - sep += sepChar; - QString meta; - meta += metaChar; - - QString safeString; - - QStringList::const_iterator i; - for (i=sl.begin(); i!=sl.end(); ++i) - { - QString s = *i; - s.replace(meta, meta+meta); // "\" -> "\\" - s.replace(sep, meta+sep); // "," -> "\," - if ( i==sl.begin() ) - safeString = s; - else - safeString += sep + s; - } - return safeString; -} - -// Split a string that was joined with safeStringJoin -QStringList safeStringSplit(const QString& s, char sepChar, char metaChar ) -{ - assert(sepChar!=metaChar); - QStringList sl; - // Miniparser - int i=0; - int len=s.length(); - QString b; - for(i=0;i0 ) - { - pos = s.find( sep, pos ); - --idx; - if (pos<0) break; - ++pos; - } - if ( pos>=0 ) - { - int pos2 = s.find( sep, pos ); - if ( pos2>0 ) - return s.mid(pos, pos2-pos); - else - return s.mid(pos); - } - - return ""; -} - -static int num( QString& s, int idx ) -{ - return subSection( s, idx, ',').toInt(); -} - -void ValueMap::writeEntry(const QString& k, const QFont& v ) -{ - m_map[k] = v.family() + "," + QString::number(v.pointSize()) + "," + (v.bold() ? "bold" : "normal"); -} - -void ValueMap::writeEntry(const QString& k, const QColor& v ) -{ - m_map[k] = numStr(v.red()) + "," + numStr(v.green()) + "," + numStr(v.blue()); -} - -void ValueMap::writeEntry(const QString& k, const QSize& v ) -{ - m_map[k] = numStr(v.width()) + "," + numStr(v.height()); -} - -void ValueMap::writeEntry(const QString& k, const QPoint& v ) -{ - m_map[k] = numStr(v.x()) + "," + numStr(v.y()); -} - -void ValueMap::writeEntry(const QString& k, int v ) -{ - m_map[k] = numStr(v); -} - -void ValueMap::writeEntry(const QString& k, bool v ) -{ - m_map[k] = numStr(v); -} - -void ValueMap::writeEntry(const QString& k, const QString& v ) -{ - m_map[k] = v; -} - -void ValueMap::writeEntry(const QString& k, const char* v ) -{ - m_map[k] = v; -} - -void ValueMap::writeEntry(const QString& k, const QStringList& v, char separator ) -{ - m_map[k] = safeStringJoin(v, separator); -} - - -QFont ValueMap::readFontEntry(const QString& k, QFont* defaultVal ) -{ - QFont f = *defaultVal; - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - f.setFamily( subSection( i->second, 0, ',' ) ); - f.setPointSize( subSection( i->second, 1, ',' ).toInt() ); - f.setBold( subSection( i->second, 2, ',' )=="bold" ); - //f.fromString(i->second); - } - - return f; -} - -QColor ValueMap::readColorEntry(const QString& k, QColor* defaultVal ) -{ - QColor c= *defaultVal; - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - QString s = i->second; - c = QColor( num(s,0),num(s,1),num(s,2) ); - } - - return c; -} - -QSize ValueMap::readSizeEntry(const QString& k, QSize* defaultVal ) -{ - QSize size = defaultVal ? *defaultVal : QSize(600,400); - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - - QString s = i->second; - size = QSize( num(s,0),num(s,1) ); - } - - return size; -} - -QPoint ValueMap::readPointEntry(const QString& k, QPoint* defaultVal) -{ - QPoint point = defaultVal ? *defaultVal : QPoint(0,0); - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - QString s = i->second; - point = QPoint( num(s,0),num(s,1) ); - } - - return point; -} - -bool ValueMap::readBoolEntry(const QString& k, bool bDefault ) -{ - bool b = bDefault; - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - QString s = i->second; - b = (bool)num(s,0); - } - - return b; -} - -int ValueMap::readNumEntry(const QString& k, int iDefault ) -{ - int ival = iDefault; - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - QString s = i->second; - ival = num(s,0); - } - - return ival; -} - -QString ValueMap::readEntry(const QString& k, const QString& sDefault ) -{ - QString sval = sDefault; - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - sval = i->second; - } - - return sval; -} - -QStringList ValueMap::readListEntry(const QString& k, const QStringList& defaultVal, char separator ) -{ - QStringList strList; - - std::map::iterator i = m_map.find( k ); - if ( i!=m_map.end() ) - { - strList = safeStringSplit( i->second, separator ); - return strList; - } - else - return defaultVal; -} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/common.h --- a/kdiff3/src/common.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/*************************************************************************** - common.h - Things that are needed often - ------------------- - begin : Mon Mar 18 2002 - copyright : (C) 2002-2006 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef _COMMON_H -#define _COMMON_H - -#include - -template< class T > -T min2( T x, T y ) -{ - return x -T max2( T x, T y ) -{ - return x>y ? x : y; -} - -typedef unsigned char UINT8; -typedef unsigned short UINT16; -typedef unsigned int UINT32; - - -template -T min3( T d1, T d2, T d3 ) -{ - if ( d1 < d2 && d1 < d3 ) return d1; - if ( d2 < d3 ) return d2; - return d3; -} - -template -T max3( T d1, T d2, T d3 ) -{ - - if ( d1 > d2 && d1 > d3 ) return d1; - - - if ( d2 > d3 ) return d2; - return d3; - -} - -template -T minMaxLimiter( T d, T minimum, T maximum ) -{ - assert(minimum<=maximum); - if ( d < minimum ) return minimum; - if ( d > maximum ) return maximum; - return d; -} - -#include -#include -class QFont; -class QColor; -class QSize; -class QPoint; -class QStringList; -class QTextStream; - -class ValueMap -{ -private: - std::map m_map; -public: - ValueMap(); - virtual ~ValueMap(); - - void save( QTextStream& ts ); - void load( QTextStream& ts ); - QString getAsString(); - // void load( const QString& s ); - - virtual void writeEntry(const QString&, const QFont& ); - virtual void writeEntry(const QString&, const QColor& ); - virtual void writeEntry(const QString&, const QSize& ); - virtual void writeEntry(const QString&, const QPoint& ); - virtual void writeEntry(const QString&, int ); - virtual void writeEntry(const QString&, bool ); - virtual void writeEntry(const QString&, const QStringList&, char separator ); - virtual void writeEntry(const QString&, const QString& ); - virtual void writeEntry(const QString&, const char* ); - - virtual QFont readFontEntry (const QString&, QFont* defaultVal ); - virtual QColor readColorEntry(const QString&, QColor* defaultVal ); - virtual QSize readSizeEntry (const QString&, QSize* defaultVal ); - virtual QPoint readPointEntry(const QString&, QPoint* defaultVal ); - virtual bool readBoolEntry (const QString&, bool bDefault ); - virtual int readNumEntry (const QString&, int iDefault ); - virtual QStringList readListEntry (const QString&, const QStringList& defaultVal, char separator ); - virtual QString readEntry (const QString&, const QString& ); -}; - -QStringList safeStringSplit(const QString& s, char sepChar=',', char metaChar='\\' ); -QString safeStringJoin(const QStringList& sl, char sepChar=',', char metaChar='\\' ); - -#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/diff.cpp --- a/kdiff3/src/diff.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1876 +0,0 @@ -/*************************************************************************** - diff.cpp - description - ------------------- - begin : Mon Mar 18 2002 - copyright : (C) 2002-2004 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include -#include - -#include "diff.h" -#include "fileaccess.h" -#include "optiondialog.h" - -#include -#include -#include -#include -#include -//Added by qt3to4: -#include - -#include -#include -#include -//using namespace std; - - -int LineData::width(int tabSize) const -{ - int w=0; - int j=0; - for( int i=0; i=5 || l2.occurances>=5) ) - return false; - - // Ignore white space diff - const QChar* p1 = l1.pLine; - const QChar* p1End = p1 + l1.size; - - const QChar* p2 = l2.pLine; - const QChar* p2End = p2 + l2.size; - - if ( g_bIgnoreWhiteSpace ) - { - int nonWhite = 0; - for(;;) - { - while( isWhite( *p1 ) && p1!=p1End ) ++p1; - while( isWhite( *p2 ) && p2!=p2End ) ++p2; - - if ( p1 == p1End && p2 == p2End ) - { - if ( bStrict && g_bIgnoreTrivialMatches ) - { // Then equality is not enough - return nonWhite>2; - } - else // equality is enough - return true; - } - else if ( p1 == p1End || p2 == p2End ) - return false; - - if( *p1 != *p2 ) - return false; - ++p1; - ++p2; - ++nonWhite; - } - } - - else - { - if ( l1.size==l2.size && memcmp(p1, p2, l1.size)==0) - return true; - else - return false; - } -} - - -static bool isLineOrBufEnd( const QChar* p, int i, int size ) -{ - return - i>=size // End of file - || p[i]=='\n' // Normal end of line - - // No support for Mac-end of line yet, because incompatible with GNU-diff-routines. - // || ( p[i]=='\r' && (i>=size-1 || p[i+1]!='\n') - // && (i==0 || p[i-1]!='\n') ) // Special case: '\r' without '\n' - ; -} - - -/* Features of class SourceData: -- Read a file (from the given URL) or accept data via a string. -- Allocate and free buffers as necessary. -- Run a preprocessor, when specified. -- Run the line-matching preprocessor, when specified. -- Run other preprocessing steps: Uppercase, ignore comments, - remove carriage return, ignore numbers. - -Order of operation: - 1. If data was given via a string then save it to a temp file. (see setData()) - 2. If the specified file is nonlocal (URL) copy it to a temp file. - 3. If a preprocessor was specified, run the input file through it. - 4. Read the output of the preprocessor. - 5. If Uppercase was specified: Turn the read data to uppercase. - 6. Write the result to a temp file. - 7. If a line-matching preprocessor was specified, run the temp file through it. - 8. Read the output of the line-matching preprocessor. - 9. If ignore numbers was specified, strip the LMPP-output of all numbers. -10. If ignore comments was specified, strip the LMPP-output of comments. - -Optimizations: Skip unneeded steps. -*/ - -SourceData::SourceData() -{ - m_pOptionDialog = 0; - reset(); -} - -SourceData::~SourceData() -{ - reset(); -} - -void SourceData::reset() -{ - m_fileAccess = FileAccess(); - m_normalData.reset(); - m_lmppData.reset(); - if ( !m_tempInputFileName.isEmpty() ) - { - FileAccess::removeFile( m_tempInputFileName ); - m_tempInputFileName = ""; - } -} - -void SourceData::setFilename( const QString& filename ) -{ - if (filename.isEmpty()) - { - reset(); - } - else - { - FileAccess fa( filename ); - setFileAccess( fa ); - } -} - -bool SourceData::isEmpty() -{ - return getFilename().isEmpty(); -} - -bool SourceData::hasData() -{ - return m_normalData.m_pBuf != 0; -} - -bool SourceData::isValid() -{ - return isEmpty() || hasData(); -} - -void SourceData::setOptionDialog( OptionDialog* pOptionDialog ) -{ - m_pOptionDialog = pOptionDialog; -} - -QString SourceData::getFilename() -{ - return m_fileAccess.absFilePath(); -} - -QString SourceData::getAliasName() -{ - return m_aliasName.isEmpty() ? m_fileAccess.prettyAbsPath() : m_aliasName; -} - -void SourceData::setAliasName( const QString& name ) -{ - m_aliasName = name; -} - -void SourceData::setFileAccess( const FileAccess& fileAccess ) -{ - m_fileAccess = fileAccess; - m_aliasName = QString(); - if ( !m_tempInputFileName.isEmpty() ) - { - FileAccess::removeFile( m_tempInputFileName ); - m_tempInputFileName = ""; - } -} - -void SourceData::setData( const QString& data ) -{ - // Create a temp file for preprocessing: - if ( m_tempInputFileName.isEmpty() ) - { - m_tempInputFileName = FileAccess::tempFileName(); - } - - FileAccess f( m_tempInputFileName ); - bool bSuccess = f.writeFile( QTextCodec::codecForName("UTF-8")->fromUnicode(data), data.length() ); - if ( !bSuccess ) - { - KMessageBox::error( m_pOptionDialog, i18n("Writing clipboard data to temp file failed.") ); - return; - } - - m_aliasName = i18n("From Clipboard"); - m_fileAccess = FileAccess(""); // Effect: m_fileAccess.isValid() is false -} - -const LineData* SourceData::getLineDataForDiff() const -{ - if ( m_lmppData.m_pBuf==0 ) - return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : 0; - else - return m_lmppData.m_v.size()>0 ? &m_lmppData.m_v[0] : 0; -} - -const LineData* SourceData::getLineDataForDisplay() const -{ - return m_normalData.m_v.size()>0 ? &m_normalData.m_v[0] : 0; -} - -int SourceData::getSizeLines() const -{ - return m_normalData.m_vSize; -} - -int SourceData::getSizeBytes() const -{ - return m_normalData.m_size; -} - -const char* SourceData::getBuf() const -{ - return m_normalData.m_pBuf; -} - -bool SourceData::isText() -{ - return m_normalData.m_bIsText; -} - -bool SourceData::isFromBuffer() -{ - return !m_fileAccess.isValid(); -} - - -bool SourceData::isBinaryEqualWith( const SourceData& other ) const -{ - return getSizeBytes() == other.getSizeBytes() && - ( getSizeBytes()==0 || memcmp( getBuf(), other.getBuf(), getSizeBytes() )==0 ); -} - -void SourceData::FileData::reset() -{ - delete[] (char*)m_pBuf; - m_pBuf = 0; - m_v.clear(); - m_size = 0; - m_vSize = 0; - m_bIsText = true; -} - -bool SourceData::FileData::readFile( const QString& filename ) -{ - reset(); - if ( filename.isEmpty() ) { return true; } - - FileAccess fa( filename ); - m_size = fa.sizeForReading(); - char* pBuf; - m_pBuf = pBuf = new char[m_size+100]; // Alloc 100 byte extra: Savety hack, not nice but does no harm. - // Some extra bytes at the end of the buffer are needed by - // the diff algorithm. See also GnuDiff::diff_2_files(). - bool bSuccess = fa.readFile( pBuf, m_size ); - if ( !bSuccess ) - { - delete pBuf; - m_pBuf = 0; - m_size = 0; - } - return bSuccess; -} - -bool SourceData::saveNormalDataAs( const QString& fileName ) -{ - return m_normalData.writeFile( fileName ); -} - -bool SourceData::FileData::writeFile( const QString& filename ) -{ - if ( filename.isEmpty() ) { return true; } - - FileAccess fa( filename ); - bool bSuccess = fa.writeFile(m_pBuf, m_size); - return bSuccess; -} - -void SourceData::FileData::copyBufFrom( const FileData& src ) -{ - reset(); - char* pBuf; - m_size = src.m_size; - m_pBuf = pBuf = new char[m_size+100]; - memcpy( pBuf, src.m_pBuf, m_size ); -} - -// Convert the input file from input encoding to output encoding and write it to the output file. -static bool convertFileEncoding( const QString& fileNameIn, QTextCodec* pCodecIn, - const QString& fileNameOut, QTextCodec* pCodecOut ) -{ - QFile in( fileNameIn ); - if ( ! in.open(QIODevice::ReadOnly ) ) - return false; - QTextStream inStream( &in ); - inStream.setCodec( pCodecIn ); - - QFile out( fileNameOut ); - if ( ! out.open( QIODevice::WriteOnly ) ) - return false; - QTextStream outStream( &out ); - outStream.setCodec( pCodecOut ); - - QString data = inStream.read(); - outStream << data; - - return true; -} - -void SourceData::readAndPreprocess(QTextCodec* pEncoding) -{ - m_pEncoding = pEncoding; - QString fileNameIn1; - QString fileNameOut1; - QString fileNameIn2; - QString fileNameOut2; - QTextCodec* pEncoding1 = pEncoding; - QTextCodec* pEncoding2 = pEncoding; - - bool bTempFileFromClipboard = !m_fileAccess.isValid(); - - // Detect the input for the preprocessing operations - if ( !bTempFileFromClipboard ) - { - if ( m_fileAccess.isLocal() ) - { - fileNameIn1 = m_fileAccess.absFilePath(); - } - else // File is not local: create a temporary local copy: - { - if ( m_tempInputFileName.isEmpty() ) { m_tempInputFileName = FileAccess::tempFileName(); } - - m_fileAccess.copyFile(m_tempInputFileName); - fileNameIn1 = m_tempInputFileName; - } - } - else // The input was set via setData(), probably from clipboard. - { - fileNameIn1 = m_tempInputFileName; - m_pEncoding = QTextCodec::codecForName("UTF-8"); - pEncoding1 = m_pEncoding; - pEncoding2 = m_pEncoding; - } - - m_normalData.reset(); - m_lmppData.reset(); - - FileAccess faIn(fileNameIn1); - int fileInSize = faIn.size(); - - if ( faIn.exists() ) // fileInSize > 0 ) - { - -#ifdef _WIN32 - QString catCmd = "type"; - fileNameIn1.replace( '/', "\\" ); -#else - QString catCmd = "cat"; -#endif - - // Run the first preprocessor - if ( m_pOptionDialog->m_PreProcessorCmd.isEmpty() ) - { - // No preprocessing: Read the file directly: - m_normalData.readFile( fileNameIn1 ); - } - else - { - QString fileNameInPP = fileNameIn1; - - if ( pEncoding1 != m_pOptionDialog->m_pEncodingPP ) - { - // Before running the preprocessor convert to the format that the preprocessor expects. - fileNameInPP = FileAccess::tempFileName(); - pEncoding1 = m_pOptionDialog->m_pEncodingPP; - convertFileEncoding( fileNameIn1, pEncoding, fileNameInPP, pEncoding1 ); - } - - QString ppCmd = m_pOptionDialog->m_PreProcessorCmd; - fileNameOut1 = FileAccess::tempFileName(); - QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut1+"\""; - ::system( encodeString(cmd) ); - bool bSuccess = m_normalData.readFile( fileNameOut1 ); - if ( fileInSize >0 && ( !bSuccess || m_normalData.m_size==0 ) ) - { - KMessageBox::error(m_pOptionDialog, - i18n("Preprocessing possibly failed. Check this command:\n\n %1" - "\n\nThe preprocessing command will be disabled now." - ).arg(cmd) ); - m_pOptionDialog->m_PreProcessorCmd = ""; - m_normalData.readFile( fileNameIn1 ); - pEncoding1 = m_pEncoding; - } - if (fileNameInPP != fileNameIn1) - { - FileAccess::removeTempFile( fileNameInPP ); - } - } - - // LineMatching Preprocessor - if ( ! m_pOptionDialog->m_LineMatchingPreProcessorCmd.isEmpty() ) - { - fileNameIn2 = fileNameOut1.isEmpty() ? fileNameIn1 : fileNameOut1; - QString fileNameInPP = fileNameIn2; - pEncoding2 = pEncoding1; - if ( pEncoding2 != m_pOptionDialog->m_pEncodingPP ) - { - // Before running the preprocessor convert to the format that the preprocesor expects. - fileNameInPP = FileAccess::tempFileName(); - pEncoding2 = m_pOptionDialog->m_pEncodingPP; - convertFileEncoding( fileNameIn2, pEncoding1, fileNameInPP, pEncoding2 ); - } - - QString ppCmd = m_pOptionDialog->m_LineMatchingPreProcessorCmd; - fileNameOut2 = FileAccess::tempFileName(); - QString cmd = catCmd + " \"" + fileNameInPP + "\" | " + ppCmd + " >\"" + fileNameOut2 + "\""; - ::system( encodeString(cmd) ); - bool bSuccess = m_lmppData.readFile( fileNameOut2 ); - if ( FileAccess(fileNameIn2).size()>0 && ( !bSuccess || m_lmppData.m_size==0 ) ) - { - KMessageBox::error(m_pOptionDialog, - i18n("The line-matching-preprocessing possibly failed. Check this command:\n\n %1" - "\n\nThe line-matching-preprocessing command will be disabled now." - ).arg(cmd) ); - m_pOptionDialog->m_LineMatchingPreProcessorCmd = ""; - m_lmppData.readFile( fileNameIn2 ); - } - FileAccess::removeTempFile( fileNameOut2 ); - if (fileNameInPP != fileNameIn2) - { - FileAccess::removeTempFile( fileNameInPP ); - } - } - else if ( m_pOptionDialog->m_bIgnoreComments || m_pOptionDialog->m_bIgnoreCase ) - { - // We need a copy of the normal data. - m_lmppData.copyBufFrom( m_normalData ); - } - else - { // We don't need any lmpp data at all. - m_lmppData.reset(); - } - } - - m_normalData.preprocess( m_pOptionDialog->m_bPreserveCarriageReturn, pEncoding1 ); - m_lmppData.preprocess( false, pEncoding2 ); - - if ( m_lmppData.m_vSize < m_normalData.m_vSize ) - { - // This probably is the fault of the LMPP-Command, but not worth reporting. - m_lmppData.m_v.resize( m_normalData.m_vSize ); - for(int i=m_lmppData.m_vSize; im_bIgnoreCase ) - { - int i; - QChar* pBuf = const_cast(m_lmppData.m_unicodeBuf.unicode()); - int ucSize = m_lmppData.m_unicodeBuf.length(); - for(i=0; im_bIgnoreComments ) - { - m_lmppData.removeComments(); - int vSize = min2(m_normalData.m_vSize, m_lmppData.m_vSize); - for(int i=0; i0 && m_v[lineIdx].pLine[lineLength-1]=='\r' ) - { - --lineLength; - } - m_v[lineIdx].pFirstNonWhiteChar = m_v[lineIdx].pLine + min2(whiteLength,lineLength); - m_v[lineIdx].size = lineLength; - lineLength = 0; - bNonWhiteFound = false; - whiteLength = 0; - ++lineIdx; - } - else - { - ++lineLength; - - if ( ! bNonWhiteFound && isWhite( p[i] ) ) - ++whiteLength; - else - bNonWhiteFound = true; - } - } - assert( lineIdx == lines ); - - m_vSize = lines; -} - - -// Must not be entered, when within a comment. -// Returns either at a newline-character p[i]=='\n' or when i==size. -// A line that contains only comments is still "white". -// Comments in white lines must remain, while comments in -// non-white lines are overwritten with spaces. -static void checkLineForComments( - QChar* p, // pointer to start of buffer - int& i, // index of current position (in, out) - int size, // size of buffer - bool& bWhite, // false if this line contains nonwhite characters (in, out) - bool& bCommentInLine, // true if any comment is within this line (in, out) - bool& bStartsOpenComment // true if the line ends within an comment (out) - ) -{ - bStartsOpenComment = false; - for(; i(m_unicodeBuf.unicode()); - bool bWithinComment=false; - int size = m_unicodeBuf.length(); - for(int i=0; ibegin(); - int lineA=0; - int lineB=0; - Diff d(0,0,0); - - for(;;) - { - if ( d.nofEquals==0 && d.diff1==0 && d.diff2==0 ) - { - if ( i!=pDiffListAB->end() ) - { - d=*i; - ++i; - } - else - break; - } - - Diff3Line d3l; - if( d.nofEquals>0 ) - { - d3l.bAEqB = true; - d3l.lineA = lineA; - d3l.lineB = lineB; - --d.nofEquals; - ++lineA; - ++lineB; - } - else if ( d.diff1>0 && d.diff2>0 ) - { - d3l.lineA = lineA; - d3l.lineB = lineB; - --d.diff1; - --d.diff2; - ++lineA; - ++lineB; - } - else if ( d.diff1>0 ) - { - d3l.lineA = lineA; - --d.diff1; - ++lineA; - } - else if ( d.diff2>0 ) - { - d3l.lineB = lineB; - --d.diff2; - ++lineB; - } - - d3ll.push_back( d3l ); - } -} - - -// Second step -void calcDiff3LineListUsingAC( - const DiffList* pDiffListAC, - Diff3LineList& d3ll - ) -{ - //////////////// - // Now insert data from C using pDiffListAC - - DiffList::const_iterator i=pDiffListAC->begin(); - Diff3LineList::iterator i3 = d3ll.begin(); - int lineA=0; - int lineC=0; - Diff d(0,0,0); - - for(;;) - { - if ( d.nofEquals==0 && d.diff1==0 && d.diff2==0 ) - { - if ( i!=pDiffListAC->end() ) - { - d=*i; - ++i; - } - else - break; - } - - Diff3Line d3l; - if( d.nofEquals>0 ) - { - // Find the corresponding lineA - while( (*i3).lineA!=lineA ) - ++i3; - - (*i3).lineC = lineC; - (*i3).bAEqC = true; - (*i3).bBEqC = (*i3).bAEqB; - - --d.nofEquals; - ++lineA; - ++lineC; - ++i3; - } - else if ( d.diff1>0 && d.diff2>0 ) - { - d3l.lineC = lineC; - d3ll.insert( i3, d3l ); - --d.diff1; - --d.diff2; - ++lineA; - ++lineC; - } - else if ( d.diff1>0 ) - { - --d.diff1; - ++lineA; - } - else if ( d.diff2>0 ) - { - d3l.lineC = lineC; - d3ll.insert( i3, d3l ); - --d.diff2; - ++lineC; - } - } -} - -// Third step -void calcDiff3LineListUsingBC( - const DiffList* pDiffListBC, - Diff3LineList& d3ll - ) -{ - //////////////// - // Now improve the position of data from C using pDiffListBC - // If a line from C equals a line from A then it is in the - // same Diff3Line already. - // If a line from C equals a line from B but not A, this - // information will be used here. - - DiffList::const_iterator i=pDiffListBC->begin(); - Diff3LineList::iterator i3b = d3ll.begin(); - Diff3LineList::iterator i3c = d3ll.begin(); - int lineB=0; - int lineC=0; - Diff d(0,0,0); - - for(;;) - { - if ( d.nofEquals==0 && d.diff1==0 && d.diff2==0 ) - { - if ( i!=pDiffListBC->end() ) - { - d=*i; - ++i; - } - else - break; - } - - Diff3Line d3l; - if( d.nofEquals>0 ) - { - // Find the corresponding lineB and lineC - while( i3b!=d3ll.end() && (*i3b).lineB!=lineB ) - ++i3b; - - while( i3c!=d3ll.end() && (*i3c).lineC!=lineC ) - ++i3c; - - assert(i3b!=d3ll.end()); - assert(i3c!=d3ll.end()); - - if ( i3b==i3c ) - { - assert( (*i3b).lineC == lineC ); - (*i3b).bBEqC = true; - } - else - { - // Is it possible to move this line up? - // Test if no other B's are used between i3c and i3b - - // First test which is before: i3c or i3b ? - Diff3LineList::iterator i3c1 = i3c; - Diff3LineList::iterator i3b1 = i3b; - while( i3c1!=i3b && i3b1!=i3c ) - { - assert(i3b1!=d3ll.end() || i3c1!=d3ll.end()); - if( i3c1!=d3ll.end() ) ++i3c1; - if( i3b1!=d3ll.end() ) ++i3b1; - } - - if( i3c1==i3b && !(*i3b).bAEqB ) // i3c before i3b - { - Diff3LineList::iterator i3 = i3c; - int nofDisturbingLines = 0; - while( i3 != i3b && i3!=d3ll.end() ) - { - if ( (*i3).lineB != -1 ) - ++nofDisturbingLines; - ++i3; - } - - if ( nofDisturbingLines>0 )//&& nofDisturbingLines < d.nofEquals*d.nofEquals+4 ) - { - // Move the disturbing lines up, out of sight. - i3 = i3c; - while( i3 != i3b ) - { - if ( (*i3).lineB != -1 ) - { - Diff3Line d3l; - d3l.lineB = (*i3).lineB; - (*i3).lineB = -1; - (*i3).bAEqB = false; - (*i3).bBEqC = false; - d3ll.insert( i3c, d3l ); - } - ++i3; - } - nofDisturbingLines=0; - } - - if ( nofDisturbingLines == 0 ) - { - // Yes, the line from B can be moved. - (*i3b).lineB = -1; // This might leave an empty line: removed later. - (*i3b).bAEqB = false; - (*i3b).bAEqC = false; - (*i3b).bBEqC = false; - (*i3c).lineB = lineB; - (*i3c).bBEqC = true; - } - } - else if( i3b1==i3c && !(*i3c).bAEqC) - { - Diff3LineList::iterator i3 = i3b; - int nofDisturbingLines = 0; - while( i3 != i3c && i3!=d3ll.end() ) - { - if ( (*i3).lineC != -1 ) - ++nofDisturbingLines; - ++i3; - } - - if ( nofDisturbingLines>0 )//&& nofDisturbingLines < d.nofEquals*d.nofEquals+4 ) - { - // Move the disturbing lines up. - i3 = i3b; - while( i3 != i3c ) - { - if ( (*i3).lineC != -1 ) - { - Diff3Line d3l; - d3l.lineC = (*i3).lineC; - (*i3).lineC = -1; - (*i3).bAEqC = false; - (*i3).bBEqC = false; - d3ll.insert( i3b, d3l ); - } - ++i3; - } - nofDisturbingLines=0; - } - - if ( nofDisturbingLines == 0 ) - { - // Yes, the line from C can be moved. - (*i3c).lineC = -1; // This might leave an empty line: removed later. - (*i3c).bAEqC = false; - (*i3c).bBEqC = false; - (*i3b).lineC = lineC; - (*i3b).bBEqC = true; - } - } - } - - --d.nofEquals; - ++lineB; - ++lineC; - ++i3b; - ++i3c; - } - else if ( d.diff1>0 ) - { - Diff3LineList::iterator i3 = i3b; - while( (*i3).lineB!=lineB ) - ++i3; - if( i3 != i3b && (*i3).bAEqB==false ) - { - // Take B from this line and move it up as far as possible - d3l.lineB = lineB; - d3ll.insert( i3b, d3l ); - (*i3).lineB = -1; - } - else - { - i3b=i3; - } - --d.diff1; - ++lineB; - ++i3b; - - if( d.diff2>0 ) - { - --d.diff2; - ++lineC; - } - } - else if ( d.diff2>0 ) - { - --d.diff2; - ++lineC; - } - } -/* - Diff3LineList::iterator it = d3ll.begin(); - int li=0; - for( ; it!=d3ll.end(); ++it, ++li ) - { - printf( "%4d %4d %4d %4d A%c=B A%c=C B%c=C\n", - li, (*it).lineA, (*it).lineB, (*it).lineC, - (*it).bAEqB ? '=' : '!', (*it).bAEqC ? '=' : '!', (*it).bBEqC ? '=' : '!' ); - } - printf("\n");*/ -} - -#ifdef _WIN32 -using ::equal; -#endif - -// Test if the move would pass a barrier. Return true if not. -static bool isValidMove( ManualDiffHelpList* pManualDiffHelpList, int line1, int line2, int winIdx1, int winIdx2 ) -{ - if (line1>=0 && line2>=0) - { - ManualDiffHelpList::const_iterator i; - for( i = pManualDiffHelpList->begin(); i!=pManualDiffHelpList->end(); ++i ) - { - const ManualDiffHelpEntry& mdhe = *i; - - // Barrier - int l1 = winIdx1 == 1 ? mdhe.lineA1 : winIdx1==2 ? mdhe.lineB1 : mdhe.lineC1 ; - int l2 = winIdx2 == 1 ? mdhe.lineA1 : winIdx2==2 ? mdhe.lineB1 : mdhe.lineC1 ; - - if ( l1>=0 && l2>=0 ) - { - if ( line1>=l1 && line2=l2 ) - return false; - l1 = winIdx1 == 1 ? mdhe.lineA2 : winIdx1==2 ? mdhe.lineB2 : mdhe.lineC2 ; - l2 = winIdx2 == 1 ? mdhe.lineA2 : winIdx2==2 ? mdhe.lineB2 : mdhe.lineC2 ; - ++l1; - ++l2; - if ( line1>=l1 && line2=l2 ) - return false; - } - } - } - return true; // no barrier passed. -} - -void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManualDiffHelpList ) -{ - if ( pManualDiffHelpList->empty() ) - return; - - // If a line appears unaligned in comparison to the manual alignment, correct this. - - ManualDiffHelpList::iterator iMDHL; - for( iMDHL = pManualDiffHelpList->begin(); iMDHL != pManualDiffHelpList->end(); ++iMDHL ) - { - Diff3LineList::iterator i3 = d3ll.begin(); - int winIdxPreferred = 0; - int missingWinIdx = 0; - int alignedSum = (iMDHL->lineA1<0?0:1) + (iMDHL->lineB1<0?0:1) + (iMDHL->lineC1<0?0:1); - if (alignedSum==2) - { - // If only A & B are aligned then let C rather be aligned with A - // If only A & C are aligned then let B rather be aligned with A - // If only B & C are aligned then let A rather be aligned with B - missingWinIdx = iMDHL->lineA1<0 ? 1 : (iMDHL->lineB1<0 ? 2 : 3 ); - winIdxPreferred = missingWinIdx == 1 ? 2 : 1; - } - else if (alignedSum<=1) - { - return; - } - - // At the first aligned line, move up the two other lines into new d3ls until the second input is aligned - // Then move up the third input until all three lines are aligned. - int wi=0; - for( ; i3!=d3ll.end(); ++i3 ) - { - for ( wi=1; wi<=3; ++wi ) - { - if ( i3->getLineInFile(wi) >= 0 && iMDHL->firstLine(wi) == i3->getLineInFile(wi) ) - break; - } - if ( wi<=3 ) - break; - } - - if (wi>=1 && wi <= 3) - { - // Found manual alignment for one source - Diff3LineList::iterator iDest = i3; - - // Move lines up until the next firstLine is found. Omit wi from move and search. - int wi2=0; - for( ; i3!=d3ll.end(); ++i3 ) - { - for ( wi2=1; wi2<=3; ++wi2 ) - { - if ( wi!=wi2 && i3->getLineInFile(wi2) >= 0 && iMDHL->firstLine(wi2) == i3->getLineInFile(wi2) ) - break; - } - if (wi2>3) - { // Not yet found - // Move both others up - Diff3Line d3l; - // Move both up - if (wi==1) // Move B and C up - { - d3l.bBEqC = i3->bBEqC; - d3l.lineB = i3->lineB; - d3l.lineC = i3->lineC; - i3->lineB = -1; - i3->lineC = -1; - } - if (wi==2) // Move A and C up - { - d3l.bAEqC = i3->bAEqC; - d3l.lineA = i3->lineA; - d3l.lineC = i3->lineC; - i3->lineA = -1; - i3->lineC = -1; - } - if (wi==3) // Move A and B up - { - d3l.bAEqB = i3->bAEqB; - d3l.lineA = i3->lineA; - d3l.lineB = i3->lineB; - i3->lineA = -1; - i3->lineB = -1; - } - i3->bAEqB = false; - i3->bAEqC = false; - i3->bBEqC = false; - d3ll.insert( iDest, d3l ); - } - else - { - // align the found line with the line we already have here - if ( i3 != iDest ) - { - if (wi2==1) - { - iDest->lineA = i3->lineA; - i3->lineA = -1; - i3->bAEqB = false; - i3->bAEqC = false; - } - else if (wi2==2) - { - iDest->lineB = i3->lineB; - i3->lineB = -1; - i3->bAEqB = false; - i3->bBEqC = false; - } - else if (wi2==3) - { - iDest->lineC = i3->lineC; - i3->lineC = -1; - i3->bBEqC = false; - i3->bAEqC = false; - } - } - - if ( missingWinIdx!=0 ) - { - for( ; i3!=d3ll.end(); ++i3 ) - { - int wi3 = missingWinIdx; - if ( i3->getLineInFile(wi3) >= 0 ) - { - // 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 ) - { - if (i3->bAEqB) - break; - d3l.lineB = i3->lineB; - i3->lineB = -1; - i3->bAEqB = false; - i3->bBEqC = false; - } - if ( wi3==3 ) - { - 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 - } - break; - } - } // for(), searching for wi2 - } // if, wi found - } // for (iMDHL) -} - -// Fourth step -void calcDiff3LineListTrim( - Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList - ) -{ - const Diff3Line d3l_empty; - d3ll.remove( d3l_empty ); - - Diff3LineList::iterator i3 = d3ll.begin(); - Diff3LineList::iterator i3A = d3ll.begin(); - Diff3LineList::iterator i3B = d3ll.begin(); - Diff3LineList::iterator i3C = d3ll.begin(); - - int line=0; // diff3line counters - int lineA=0; // - int lineB=0; - int lineC=0; - - ManualDiffHelpList::iterator iMDHL = pManualDiffHelpList->begin(); - // The iterator i3 and the variable line look ahead. - // The iterators i3A, i3B, i3C and corresponding lineA, lineB and lineC stop at empty lines, if found. - // If possible, then the texts from the look ahead will be moved back to the empty places. - - for( ; i3!=d3ll.end(); ++i3, ++line ) - { - if ( iMDHL!=pManualDiffHelpList->end() ) - { - if ( i3->lineA >= 0 && i3->lineA==iMDHL->lineA1 || - i3->lineB >= 0 && i3->lineB==iMDHL->lineB1 || - i3->lineC >= 0 && i3->lineC==iMDHL->lineC1 ) - { - i3A = i3; - i3B = i3; - i3C = i3; - lineA = line; - lineB = line; - lineC = line; - ++iMDHL; - } - } - - if( line>lineA && (*i3).lineA != -1 && (*i3A).lineB!=-1 && (*i3A).bBEqC && - ::equal( pldA[(*i3).lineA], pldB[(*i3A).lineB], false ) && - isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineB, 1, 2 ) && - isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineC, 1, 3 ) ) - { - // Empty space for A. A matches B and C in the empty line. Move it up. - (*i3A).lineA = (*i3).lineA; - (*i3A).bAEqB = true; - (*i3A).bAEqC = true; - (*i3).lineA = -1; - (*i3).bAEqB = false; - (*i3).bAEqC = false; - ++i3A; - ++lineA; - } - - if( line>lineB && (*i3).lineB != -1 && (*i3B).lineA!=-1 && (*i3B).bAEqC && - ::equal( pldB[(*i3).lineB], pldA[(*i3B).lineA], false ) && - isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineA, 2, 1 ) && - isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineC, 2, 3 ) ) - { - // Empty space for B. B matches A and C in the empty line. Move it up. - (*i3B).lineB = (*i3).lineB; - (*i3B).bAEqB = true; - (*i3B).bBEqC = true; - (*i3).lineB = -1; - (*i3).bAEqB = false; - (*i3).bBEqC = false; - ++i3B; - ++lineB; - } - - if( line>lineC && (*i3).lineC != -1 && (*i3C).lineA!=-1 && (*i3C).bAEqB && - ::equal( pldC[(*i3).lineC], pldA[(*i3C).lineA], false )&& - isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineA, 3, 1 ) && - isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineB, 3, 2 ) ) - { - // Empty space for C. C matches A and B in the empty line. Move it up. - (*i3C).lineC = (*i3).lineC; - (*i3C).bAEqC = true; - (*i3C).bBEqC = true; - (*i3).lineC = -1; - (*i3).bAEqC = false; - (*i3).bBEqC = false; - ++i3C; - ++lineC; - } - - if( line>lineA && (*i3).lineA != -1 && !(*i3).bAEqB && !(*i3).bAEqC && - isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineB, 1, 2 ) && - isValidMove( pManualDiffHelpList, (*i3).lineA, (*i3A).lineC, 1, 3 ) ) { - // Empty space for A. A doesn't match B or C. Move it up. - (*i3A).lineA = (*i3).lineA; - (*i3).lineA = -1; - ++i3A; - ++lineA; - } - - if( line>lineB && (*i3).lineB != -1 && !(*i3).bAEqB && !(*i3).bBEqC && - isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineA, 2, 1 ) && - isValidMove( pManualDiffHelpList, (*i3).lineB, (*i3B).lineC, 2, 3 ) ) - { - // Empty space for B. B matches neither A nor C. Move B up. - (*i3B).lineB = (*i3).lineB; - (*i3).lineB = -1; - ++i3B; - ++lineB; - } - - if( line>lineC && (*i3).lineC != -1 && !(*i3).bAEqC && !(*i3).bBEqC && - isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineA, 3, 1 ) && - isValidMove( pManualDiffHelpList, (*i3).lineC, (*i3C).lineB, 3, 2 ) ) - { - // Empty space for C. C matches neither A nor B. Move C up. - (*i3C).lineC = (*i3).lineC; - (*i3).lineC = -1; - ++i3C; - ++lineC; - } - - if( line>lineA && line>lineB && (*i3).lineA != -1 && (*i3).bAEqB && !(*i3).bAEqC ) - { - // Empty space for A and B. A matches B, but not C. Move A & B up. - Diff3LineList::iterator i = lineA > lineB ? i3A : i3B; - int l = lineA > lineB ? lineA : lineB; - - if ( isValidMove( pManualDiffHelpList, i->lineC, (*i3).lineA, 3, 1 ) && - isValidMove( pManualDiffHelpList, i->lineC, (*i3).lineB, 3, 2 ) ) - { - (*i).lineA = (*i3).lineA; - (*i).lineB = (*i3).lineB; - (*i).bAEqB = true; - - (*i3).lineA = -1; - (*i3).lineB = -1; - (*i3).bAEqB = false; - i3A = i; - i3B = i; - ++i3A; - ++i3B; - lineA=l+1; - lineB=l+1; - } - } - else if( line>lineA && line>lineC && (*i3).lineA != -1 && (*i3).bAEqC && !(*i3).bAEqB ) - { - // Empty space for A and C. A matches C, but not B. Move A & C up. - Diff3LineList::iterator i = lineA > lineC ? i3A : i3C; - int l = lineA > lineC ? lineA : lineC; - - if ( isValidMove( pManualDiffHelpList, i->lineB, (*i3).lineA, 2, 1 ) && - isValidMove( pManualDiffHelpList, i->lineB, (*i3).lineC, 2, 3 ) ) - { - (*i).lineA = (*i3).lineA; - (*i).lineC = (*i3).lineC; - (*i).bAEqC = true; - - (*i3).lineA = -1; - (*i3).lineC = -1; - (*i3).bAEqC = false; - i3A = i; - i3C = i; - ++i3A; - ++i3C; - lineA=l+1; - lineC=l+1; - } - } - else if( line>lineB && line>lineC && (*i3).lineB != -1 && (*i3).bBEqC && !(*i3).bAEqC ) - { - // Empty space for B and C. B matches C, but not A. Move B & C up. - Diff3LineList::iterator i = lineB > lineC ? i3B : i3C; - int l = lineB > lineC ? lineB : lineC; - - if ( isValidMove( pManualDiffHelpList, i->lineA, (*i3).lineB, 1, 2 ) && - isValidMove( pManualDiffHelpList, i->lineA, (*i3).lineC, 1, 3 ) ) - { - (*i).lineB = (*i3).lineB; - (*i).lineC = (*i3).lineC; - (*i).bBEqC = true; - - (*i3).lineB = -1; - (*i3).lineC = -1; - (*i3).bBEqC = false; - i3B = i; - i3C = i; - ++i3B; - ++i3C; - lineB=l+1; - lineC=l+1; - } - } - - if ( (*i3).lineA != -1 ) - { - lineA = line+1; - i3A = i3; - ++i3A; - } - if ( (*i3).lineB != -1 ) - { - lineB = line+1; - i3B = i3; - ++i3B; - } - if ( (*i3).lineC != -1 ) - { - lineC = line+1; - i3C = i3; - ++i3C; - } - } - - d3ll.remove( d3l_empty ); - -/* - - Diff3LineList::iterator it = d3ll.begin(); - int li=0; - for( ; it!=d3ll.end(); ++it, ++li ) - { - printf( "%4d %4d %4d %4d A%c=B A%c=C B%c=C\n", - li, (*it).lineA, (*it).lineB, (*it).lineC, - (*it).bAEqB ? '=' : '!', (*it).bAEqC ? '=' : '!', (*it).bBEqC ? '=' : '!' ); - - } -*/ -} - -void DiffBufferInfo::init( Diff3LineList* pD3ll, const Diff3LineVector* pD3lv, - const LineData* pldA, int sizeA, const LineData* pldB, int sizeB, const LineData* pldC, int sizeC ) -{ - m_pDiff3LineList = pD3ll; - m_pDiff3LineVector = pD3lv; - m_pLineDataA = pldA; - m_pLineDataB = pldB; - m_pLineDataC = pldC; - m_sizeA = sizeA; - m_sizeB = sizeB; - m_sizeC = sizeC; - Diff3LineList::iterator i3 = pD3ll->begin(); - for( ; i3!=pD3ll->end(); ++i3 ) - { - i3->m_pDiffBufferInfo = this; - } -} - -void calcWhiteDiff3Lines( - Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC - ) -{ - Diff3LineList::iterator i3 = d3ll.begin(); - - for( ; i3!=d3ll.end(); ++i3 ) - { - i3->bWhiteLineA = ( (*i3).lineA == -1 || pldA==0 || pldA[(*i3).lineA].whiteLine() || pldA[(*i3).lineA].bContainsPureComment ); - i3->bWhiteLineB = ( (*i3).lineB == -1 || pldB==0 || pldB[(*i3).lineB].whiteLine() || pldB[(*i3).lineB].bContainsPureComment ); - i3->bWhiteLineC = ( (*i3).lineC == -1 || pldC==0 || pldC[(*i3).lineC].whiteLine() || pldC[(*i3).lineC].bContainsPureComment ); - } -} - -// Just make sure that all input lines are in the output too, exactly once. -void debugLineCheck( Diff3LineList& d3ll, int size, int idx ) -{ - Diff3LineList::iterator it = d3ll.begin(); - int i=0; - - for ( it = d3ll.begin(); it!= d3ll.end(); ++it ) - { - int l=0; - if (idx==1) l=(*it).lineA; - else if (idx==2) l=(*it).lineB; - else if (idx==3) l=(*it).lineC; - else assert(false); - - if ( l!=-1 ) - { - if( l!=i ) - { - KMessageBox::error(0, i18n( - "Data loss error:\n" - "If it is reproducable please contact the author.\n" - ), i18n("Severe Internal Error") ); - assert(false); - std::cerr << "Severe Internal Error.\n"; - ::exit(-1); - } - ++i; - } - } - - if( size!=i ) - { - KMessageBox::error(0, i18n( - "Data loss error:\n" - "If it is reproducable please contact the author.\n" - ), i18n("Severe Internal Error") ); - assert(false); - std::cerr << "Severe Internal Error.\n"; - ::exit(-1); - } -} - -inline bool equal( QChar c1, QChar c2, bool /*bStrict*/ ) -{ - // If bStrict then white space doesn't match - - //if ( bStrict && ( c1==' ' || c1=='\t' ) ) - // return false; - - return c1==c2; -} - - -// My own diff-invention: -template -void calcDiff( const T* p1, int size1, const T* p2, int size2, DiffList& diffList, int match, int maxSearchRange ) -{ - diffList.clear(); - - const T* p1start = p1; - const T* p2start = p2; - const T* p1end=p1+size1; - const T* p2end=p2+size2; - for(;;) - { - int nofEquals = 0; - while( p1!=p1end && p2!=p2end && equal(*p1, *p2, false) ) - { - ++p1; - ++p2; - ++nofEquals; - } - - bool bBestValid=false; - int bestI1=0; - int bestI2=0; - int i1=0; - int i2=0; - for( i1=0; ; ++i1 ) - { - if ( &p1[i1]==p1end || ( bBestValid && i1>= bestI1+bestI2)) - { - break; - } - for(i2=0;i2=bestI1+bestI2) ) - { - break; - } - else if( equal( p2[i2], p1[i1], true ) && - ( match==1 || abs(i1-i2)<3 || ( &p2[i2+1]==p2end && &p1[i1+1]==p1end ) || - ( &p2[i2+1]!=p2end && &p1[i1+1]!=p1end && equal( p2[i2+1], p1[i1+1], false )) - ) - ) - { - if ( i1+i2 < bestI1+bestI2 || bBestValid==false ) - { - bestI1 = i1; - bestI2 = i2; - bBestValid = true; - break; - } - } - } - } - - // The match was found using the strict search. Go back if there are non-strict - // matches. - while( bestI1>=1 && bestI2>=1 && equal( p1[bestI1-1], p2[bestI2-1], false ) ) - { - --bestI1; - --bestI2; - } - - - bool bEndReached = false; - if (bBestValid) - { - // continue somehow - Diff d(nofEquals, bestI1, bestI2); - diffList.push_back( d ); - - p1 += bestI1; - p2 += bestI2; - } - else - { - // Nothing else to match. - Diff d(nofEquals, p1end-p1, p2end-p2); - diffList.push_back( d ); - - bEndReached = true; //break; - } - - // Sometimes the algorithm that chooses the first match unfortunately chooses - // a match where later actually equal parts don't match anymore. - // A different match could be achieved, if we start at the end. - // Do it, if it would be a better match. - int nofUnmatched = 0; - const T* pu1 = p1-1; - const T* pu2 = p2-1; - while ( pu1>=p1start && pu2>=p2start && equal( *pu1, *pu2, false ) ) - { - ++nofUnmatched; - --pu1; - --pu2; - } - - Diff d = diffList.back(); - if ( nofUnmatched > 0 ) - { - // We want to go backwards the nofUnmatched elements and redo - // the matching - d = diffList.back(); - Diff origBack = d; - diffList.pop_back(); - - while ( nofUnmatched > 0 ) - { - if ( d.diff1 > 0 && d.diff2 > 0 ) - { - --d.diff1; - --d.diff2; - --nofUnmatched; - } - else if ( d.nofEquals > 0 ) - { - --d.nofEquals; - --nofUnmatched; - } - - if ( d.nofEquals==0 && (d.diff1==0 || d.diff2==0) && nofUnmatched>0 ) - { - if ( diffList.empty() ) - break; - d.nofEquals += diffList.back().nofEquals; - d.diff1 += diffList.back().diff1; - d.diff2 += diffList.back().diff2; - diffList.pop_back(); - bEndReached = false; - } - } - - if ( bEndReached ) - diffList.push_back( origBack ); - else - { - - p1 = pu1 + 1 + nofUnmatched; - p2 = pu2 + 1 + nofUnmatched; - diffList.push_back( d ); - } - } - if ( bEndReached ) - break; - } - -#ifndef NDEBUG - // Verify difflist - { - int l1=0; - int l2=0; - DiffList::iterator i; - for( i = diffList.begin(); i!=diffList.end(); ++i ) - { - l1+= i->nofEquals + i->diff1; - l2+= i->nofEquals + i->diff2; - } - - //if( l1!=p1-p1start || l2!=p2-p2start ) - if( l1!=size1 || l2!=size2 ) - assert( false ); - } -#endif -} - -void fineDiff( - Diff3LineList& diff3LineList, - int selector, - const LineData* v1, - const LineData* v2, - bool& bTextsTotalEqual - ) -{ - // Finetuning: Diff each line with deltas - ProgressProxy pp; - int maxSearchLength=500; - Diff3LineList::iterator i; - int k1=0; - int k2=0; - bTextsTotalEqual = true; - int listSize = diff3LineList.size(); - int listIdx = 0; - for( i= diff3LineList.begin(); i!= diff3LineList.end(); ++i) - { - if (selector==1){ k1=i->lineA; k2=i->lineB; } - else if (selector==2){ k1=i->lineB; k2=i->lineC; } - else if (selector==3){ k1=i->lineC; k2=i->lineA; } - else assert(false); - if( k1==-1 && k2!=-1 || k1!=-1 && k2==-1 ) bTextsTotalEqual=false; - if( k1!=-1 && k2!=-1 ) - { - if ( v1[k1].size != v2[k2].size || memcmp( v1[k1].pLine, v2[k2].pLine, v1[k1].size<<1)!=0 ) - { - bTextsTotalEqual = false; - DiffList* pDiffList = new DiffList; - calcDiff( v1[k1].pLine, v1[k1].size, v2[k2].pLine, v2[k2].size, *pDiffList, 2, maxSearchLength ); - - // Optimize the diff list. - DiffList::iterator dli; - bool bUsefulFineDiff = false; - for( dli = pDiffList->begin(); dli!=pDiffList->end(); ++dli) - { - if( dli->nofEquals >= 4 ) - { - bUsefulFineDiff = true; - break; - } - } - - for( dli = pDiffList->begin(); dli!=pDiffList->end(); ++dli) - { - if( dli->nofEquals < 4 && (dli->diff1>0 || dli->diff2>0) - && !( bUsefulFineDiff && dli==pDiffList->begin() ) - ) - { - dli->diff1 += dli->nofEquals; - dli->diff2 += dli->nofEquals; - dli->nofEquals = 0; - } - } - - if (selector==1){ delete (*i).pFineAB; (*i).pFineAB = pDiffList; } - else if (selector==2){ delete (*i).pFineBC; (*i).pFineBC = pDiffList; } - else if (selector==3){ delete (*i).pFineCA; (*i).pFineCA = pDiffList; } - else assert(false); - } - - if ( (v1[k1].bContainsPureComment || v1[k1].whiteLine()) && (v2[k2].bContainsPureComment || v2[k2].whiteLine())) - { - if (selector==1){ i->bAEqB = true; } - else if (selector==2){ i->bBEqC = true; } - else if (selector==3){ i->bAEqC = true; } - else assert(false); - } - } - ++listIdx; - pp.setCurrent(double(listIdx)/listSize); - } -} - - -// Convert the list to a vector of pointers -void calcDiff3LineVector( Diff3LineList& d3ll, Diff3LineVector& d3lv ) -{ - d3lv.resize( d3ll.size() ); - Diff3LineList::iterator i; - int j=0; - for( i= d3ll.begin(); i!= d3ll.end(); ++i, ++j) - { - d3lv[j] = &(*i); - } - assert( j==(int)d3lv.size() ); -} - - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/diff.h --- a/kdiff3/src/diff.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,462 +0,0 @@ -/*************************************************************************** - diff.h - description - ------------------- - begin : Mon Mar 18 2002 - copyright : (C) 2002-2004 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DIFF_H -#define DIFF_H - -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include "common.h" -#include "fileaccess.h" -#include "optiondialog.h" - - -// Each range with matching elements is followed by a range with differences on either side. -// Then again range of matching elements should follow. -struct Diff -{ - int nofEquals; - - int diff1; - int diff2; - - Diff(int eq, int d1, int d2){nofEquals=eq; diff1=d1; diff2=d2; } -}; - -typedef std::list DiffList; - -struct LineData -{ - const QChar* pLine; - const QChar* pFirstNonWhiteChar; - int size; - - LineData(){ pLine=0; pFirstNonWhiteChar=0; size=0; /*occurances=0;*/ bContainsPureComment=false; } - int width(int tabSize) const; // Calcs width considering tabs. - //int occurances; - bool whiteLine() const { return pFirstNonWhiteChar-pLine == size; } - bool bContainsPureComment; -}; - -class Diff3LineList; -class Diff3LineVector; - -struct DiffBufferInfo -{ - const LineData* m_pLineDataA; - const LineData* m_pLineDataB; - const LineData* m_pLineDataC; - int m_sizeA; - int m_sizeB; - int m_sizeC; - const Diff3LineList* m_pDiff3LineList; - const Diff3LineVector* m_pDiff3LineVector; - void init( Diff3LineList* d3ll, const Diff3LineVector* d3lv, - const LineData* pldA, int sizeA, const LineData* pldB, int sizeB, const LineData* pldC, int sizeC ); -}; - -struct Diff3Line -{ - int lineA; - int lineB; - int lineC; - - bool bAEqC : 1; // These are true if equal or only white-space changes exist. - bool bBEqC : 1; - bool bAEqB : 1; - - bool bWhiteLineA : 1; - bool bWhiteLineB : 1; - bool bWhiteLineC : 1; - - DiffList* pFineAB; // These are 0 only if completely equal or if either source doesn't exist. - DiffList* pFineBC; - DiffList* pFineCA; - - int linesNeededForDisplay; // Due to wordwrap - int sumLinesNeededForDisplay; // For fast conversion to m_diff3WrapLineVector - - DiffBufferInfo* m_pDiffBufferInfo; // For convenience - - Diff3Line() - { - lineA=-1; lineB=-1; lineC=-1; - bAEqC=false; bAEqB=false; bBEqC=false; - pFineAB=0; pFineBC=0; pFineCA=0; - linesNeededForDisplay=1; - sumLinesNeededForDisplay=0; - bWhiteLineA=false; bWhiteLineB=false; bWhiteLineC=false; - m_pDiffBufferInfo=0; - } - - ~Diff3Line() - { - if (pFineAB!=0) delete pFineAB; - if (pFineBC!=0) delete pFineBC; - if (pFineCA!=0) delete pFineCA; - pFineAB=0; pFineBC=0; pFineCA=0; - } - - bool operator==( const Diff3Line& d3l ) - { - return lineA == d3l.lineA && lineB == d3l.lineB && lineC == d3l.lineC - && bAEqB == d3l.bAEqB && bAEqC == d3l.bAEqC && bBEqC == d3l.bBEqC; - } - - const LineData* getLineData( int src ) const - { - assert( m_pDiffBufferInfo!=0 ); - if ( src == 1 && lineA >= 0 ) return &m_pDiffBufferInfo->m_pLineDataA[lineA]; - if ( src == 2 && lineB >= 0 ) return &m_pDiffBufferInfo->m_pLineDataB[lineB]; - if ( src == 3 && lineC >= 0 ) return &m_pDiffBufferInfo->m_pLineDataC[lineC]; - return 0; - } - QString getString( int src ) const - { - const LineData* pld = getLineData(src); - if ( pld ) - return QString( pld->pLine, pld->size); - else - return QString(); - } - int getLineInFile( int src ) const - { - if ( src == 1 ) return lineA; - if ( src == 2 ) return lineB; - if ( src == 3 ) return lineC; - return -1; - } -}; - - -class Diff3LineList : public std::list -{ -}; -class Diff3LineVector : public std::vector -{ -}; - -class Diff3WrapLine -{ -public: - Diff3Line* pD3L; - int diff3LineIndex; - int wrapLineOffset; - int wrapLineLength; -}; - -typedef std::vector Diff3WrapLineVector; - - -class TotalDiffStatus -{ -public: - TotalDiffStatus(){ reset(); } - void reset() {bBinaryAEqC=false; bBinaryBEqC=false; bBinaryAEqB=false; - bTextAEqC=false; bTextBEqC=false; bTextAEqB=false; - nofUnsolvedConflicts=0; nofSolvedConflicts=0; - nofWhitespaceConflicts=0; - } - bool bBinaryAEqC; - bool bBinaryBEqC; - bool bBinaryAEqB; - - bool bTextAEqC; - bool bTextBEqC; - bool bTextAEqB; - - int nofUnsolvedConflicts; - int nofSolvedConflicts; - int nofWhitespaceConflicts; -}; - -// Three corresponding ranges. (Minimum size of a valid range is one line.) -class ManualDiffHelpEntry -{ -public: - ManualDiffHelpEntry() { lineA1=-1; lineA2=-1; - lineB1=-1; lineB2=-1; - lineC1=-1; lineC2=-1; } - int lineA1; - int lineA2; - int lineB1; - int lineB2; - int lineC1; - int lineC2; - int& firstLine( int winIdx ) - { - return winIdx==1 ? lineA1 : (winIdx==2 ? lineB1 : lineC1 ); - } - int& lastLine( int winIdx ) - { - return winIdx==1 ? lineA2 : (winIdx==2 ? lineB2 : lineC2 ); - } - bool isLineInRange( int line, int winIdx ) - { - return line>=0 && line>=firstLine(winIdx) && line<=lastLine(winIdx); - } - bool operator==(const ManualDiffHelpEntry& r) const - { - return lineA1 == r.lineA1 && lineB1 == r.lineB1 && lineC1 == r.lineC1 && - lineA2 == r.lineA2 && lineB2 == r.lineB2 && lineC2 == r.lineC2; - } -}; - -// A list of corresponding ranges -typedef std::list ManualDiffHelpList; - -void calcDiff3LineListUsingAB( - const DiffList* pDiffListAB, - Diff3LineList& d3ll - ); - -void calcDiff3LineListUsingAC( - const DiffList* pDiffListBC, - Diff3LineList& d3ll - ); - -void calcDiff3LineListUsingBC( - const DiffList* pDiffListBC, - Diff3LineList& d3ll - ); - -void correctManualDiffAlignment( Diff3LineList& d3ll, ManualDiffHelpList* pManualDiffHelpList ); - -class SourceData -{ -public: - SourceData(); - ~SourceData(); - - void setOptionDialog( OptionDialog* pOptionDialog ); - - int getSizeLines() const; - int getSizeBytes() const; - const char* getBuf() const; - const LineData* getLineDataForDisplay() const; - const LineData* getLineDataForDiff() const; - - void setFilename(const QString& filename); - void setFileAccess( const FileAccess& fa ); - FileAccess& getFileAccess(); - QString getFilename(); - void setAliasName(const QString& a); - QString getAliasName(); - bool isEmpty(); // File was set - bool hasData(); // Data was readable - bool isText(); // is it pure text (vs. binary data) - bool isFromBuffer(); // was it set via setData() (vs. setFileAccess() or setFilename()) - void setData( const QString& data ); - bool isValid(); // Either no file is specified or reading was successful - - void readAndPreprocess(QTextCodec* pEncoding); - bool saveNormalDataAs( const QString& fileName ); - - bool isBinaryEqualWith( const SourceData& other ) const; - - void reset(); - -private: - QString m_aliasName; - FileAccess m_fileAccess; - OptionDialog* m_pOptionDialog; - QString m_tempInputFileName; - - struct FileData - { - FileData(){ m_pBuf=0; m_size=0; m_vSize=0; m_bIsText=false; } - ~FileData(){ reset(); } - const char* m_pBuf; - int m_size; - int m_vSize; // Nr of lines in m_pBuf1 and size of m_v1, m_dv12 and m_dv13 - QString m_unicodeBuf; - std::vector m_v; - bool m_bIsText; - bool readFile( const QString& filename ); - bool writeFile( const QString& filename ); - void preprocess(bool bPreserveCR, QTextCodec* pEncoding ); - void reset(); - void removeComments(); - void copyBufFrom( const FileData& src ); - }; - FileData m_normalData; - FileData m_lmppData; - QTextCodec* m_pEncoding; -}; - -void calcDiff3LineListTrim( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC, ManualDiffHelpList* pManualDiffHelpList ); -void calcWhiteDiff3Lines( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC ); - -void calcDiff3LineVector( Diff3LineList& d3ll, Diff3LineVector& d3lv ); - -void debugLineCheck( Diff3LineList& d3ll, int size, int idx ); - -class QStatusBar; - - -class Selection -{ -public: - Selection(){ reset(); oldLastLine=-1; lastLine=-1; oldFirstLine=-1; } - int firstLine; - int firstPos; - int lastLine; - int lastPos; - int oldLastLine; - int oldFirstLine; - bool bSelectionContainsData; - bool isEmpty() { return firstLine==-1 || (firstLine==lastLine && firstPos==lastPos) || bSelectionContainsData==false;} - void reset(){ - oldFirstLine=firstLine; - oldLastLine =lastLine; - firstLine=-1; - lastLine=-1; - bSelectionContainsData = false; - } - void start( int l, int p ) { firstLine = l; firstPos = p; } - void end( int l, int p ) { - if ( oldLastLine == -1 ) - oldLastLine = lastLine; - lastLine = l; - lastPos = p; - } - bool within( int l, int p ); - - bool lineWithin( int l ); - int firstPosInLine(int l); - int lastPosInLine(int l); - int beginLine(){ - if (firstLine<0 && lastLine<0) return -1; - return max2(0,min2(firstLine,lastLine)); - } - int endLine(){ - if (firstLine<0 && lastLine<0) return -1; - return max2(firstLine,lastLine); - } - int beginPos() { return firstLine==lastLine ? min2(firstPos,lastPos) : - firstLine -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class DiffTextWindowData -{ -public: - DiffTextWindowData( DiffTextWindow* p ) - { - m_pDiffTextWindow = p; - m_bPaintingAllowed = false; - m_pLineData = 0; - m_size = 0; - m_bWordWrap = false; - m_delayedDrawTimer = 0; - m_pDiff3LineVector = 0; - m_pManualDiffHelpList = 0; - m_pOptionDialog = 0; - m_fastSelectorLine1 = 0; - m_fastSelectorNofLines = 0; - m_bTriple = 0; - m_winIdx = 0; - m_firstLine = 0; - m_oldFirstLine = 0; - m_oldFirstColumn = 0; - m_firstColumn = 0; - m_lineNumberWidth = 0; - m_pStatusBar = 0; - m_scrollDeltaX = 0; - m_scrollDeltaY = 0; - m_bMyUpdate = false; - m_bSelectionInProgress = false; - } - DiffTextWindow* m_pDiffTextWindow; - DiffTextWindowFrame* m_pDiffTextWindowFrame; - - bool m_bPaintingAllowed; - const LineData* m_pLineData; - int m_size; - QString m_filename; - bool m_bWordWrap; - int m_delayedDrawTimer; - - const Diff3LineVector* m_pDiff3LineVector; - Diff3WrapLineVector m_diff3WrapLineVector; - const ManualDiffHelpList* m_pManualDiffHelpList; - - OptionDialog* m_pOptionDialog; - QColor m_cThis; - QColor m_cDiff1; - QColor m_cDiff2; - QColor m_cDiffBoth; - - int m_fastSelectorLine1; - int m_fastSelectorNofLines; - - bool m_bTriple; - int m_winIdx; - int m_firstLine; - int m_oldFirstLine; - int m_oldFirstColumn; - int m_firstColumn; - int m_lineNumberWidth; - - void getLineInfo( - const Diff3Line& d, - int& lineIdx, - DiffList*& pFineDiff1, DiffList*& pFineDiff2, // return values - int& changed, int& changed2 ); - - QString getString( int d3lIdx ); - QString getLineString( int line ); - - void writeLine( - MyPainter& p, const LineData* pld, - const DiffList* pLineDiff1, const DiffList* pLineDiff2, int line, - int whatChanged, int whatChanged2, int srcLineIdx, - int wrapLineOffset, int wrapLineLength, bool bWrapLine, const QRect& invalidRect, int deviceWidth - ); - - void draw( MyPainter& p, const QRect& invalidRect, int deviceWidth, int beginLine, int endLine ); - - QStatusBar* m_pStatusBar; - - Selection m_selection; - - int m_scrollDeltaX; - int m_scrollDeltaY; - - bool m_bMyUpdate; - void myUpdate(int afterMilliSecs ); - - int leftInfoWidth() { return 4+m_lineNumberWidth; } // Nr of information columns on left side - int convertLineOnScreenToLineInSource( int lineOnScreen, e_CoordType coordType, bool bFirstLine ); - - bool m_bSelectionInProgress; - QPoint m_lastKnownMousePos; -}; - -DiffTextWindow::DiffTextWindow( - DiffTextWindowFrame* pParent, - QStatusBar* pStatusBar, - OptionDialog* pOptionDialog, - int winIdx - ) - : QWidget(pParent, 0, Qt::WNoAutoErase ) -{ - d = new DiffTextWindowData(this); - d->m_pDiffTextWindowFrame = pParent; - setFocusPolicy( Qt::ClickFocus ); - setAcceptDrops( true ); - - d->m_pOptionDialog = pOptionDialog; - init( 0, 0, 0, 0, 0, false ); - - setMinimumSize(QSize(20,20)); - - d->m_pStatusBar = pStatusBar; - d->m_bPaintingAllowed = true; - d->m_bWordWrap = false; - d->m_winIdx = winIdx; - - setFont(d->m_pOptionDialog->m_font); - setAutoFillBackground( true ); -} - -DiffTextWindow::~DiffTextWindow() -{ - delete d; -} - -void DiffTextWindow::init( - const QString& filename, - const LineData* pLineData, - int size, - const Diff3LineVector* pDiff3LineVector, - const ManualDiffHelpList* pManualDiffHelpList, - bool bTriple - ) -{ - d->m_filename = filename; - d->m_pLineData = pLineData; - d->m_size = size; - d->m_pDiff3LineVector = pDiff3LineVector; - d->m_diff3WrapLineVector.clear(); - d->m_pManualDiffHelpList = pManualDiffHelpList; - - d->m_firstLine = 0; - d->m_oldFirstLine = -1; - d->m_firstColumn = 0; - d->m_oldFirstColumn = -1; - d->m_bTriple = bTriple; - d->m_scrollDeltaX=0; - d->m_scrollDeltaY=0; - d->m_bMyUpdate = false; - d->m_fastSelectorLine1 = 0; - d->m_fastSelectorNofLines = 0; - d->m_lineNumberWidth = 0; - d->m_selection.reset(); - d->m_selection.oldFirstLine = -1; // reset is not enough here. - d->m_selection.oldLastLine = -1; - d->m_selection.lastLine = -1; - - update(); - d->m_pDiffTextWindowFrame->init(); -} - -void DiffTextWindow::reset() -{ - d->m_pLineData=0; - d->m_size=0; - d->m_pDiff3LineVector=0; - d->m_filename=""; - d->m_diff3WrapLineVector.clear(); -} - -void DiffTextWindow::setPaintingAllowed( bool bAllowPainting ) -{ - if (d->m_bPaintingAllowed != bAllowPainting) - { - d->m_bPaintingAllowed = bAllowPainting; - if ( d->m_bPaintingAllowed ) update(); - else reset(); - } -} - -void DiffTextWindow::dragEnterEvent( QDragEnterEvent* e ) -{ - e->accept( Q3UriDrag::canDecode(e) || Q3TextDrag::canDecode(e) ); - // Note that the corresponding drop is handled in KDiff3App::eventFilter(). -} - - -void DiffTextWindow::setFirstLine(int firstLine) -{ - int fontHeight = fontMetrics().height(); - - int newFirstLine = max2(0,firstLine); - - int deltaY = fontHeight * ( d->m_firstLine - newFirstLine ); - - d->m_firstLine = newFirstLine; - - if ( d->m_bSelectionInProgress && d->m_selection.firstLine != -1 ) - { - int line, pos; - convertToLinePos( d->m_lastKnownMousePos.x(), d->m_lastKnownMousePos.y(), line, pos ); - d->m_selection.end( line, pos ); - update(); - } - else - { - QWidget::scroll( 0, deltaY ); - } - d->m_pDiffTextWindowFrame->setFirstLine( d->m_firstLine ); -} - -int DiffTextWindow::getFirstLine() -{ - return d->m_firstLine; -} - -void DiffTextWindow::setFirstColumn(int firstCol) -{ - int fontWidth = fontMetrics().width('W'); - int xOffset = d->leftInfoWidth() * fontWidth; - - int newFirstColumn = max2(0,firstCol); - - int deltaX = fontWidth * ( d->m_firstColumn - newFirstColumn ); - - d->m_firstColumn = newFirstColumn; - - QRect r( xOffset, 0, width()-xOffset, height() ); - - if ( d->m_pOptionDialog->m_bRightToLeftLanguage ) - { - deltaX = -deltaX; - r = QRect( width()-1-xOffset, 0, -(width()-xOffset), height() ).normalize(); - } - - if ( d->m_bSelectionInProgress && d->m_selection.firstLine != -1 ) - { - int line, pos; - convertToLinePos( d->m_lastKnownMousePos.x(), d->m_lastKnownMousePos.y(), line, pos ); - d->m_selection.end( line, pos ); - update(); - } - else - { - QWidget::scroll( deltaX, 0, r ); - } -} - -int DiffTextWindow::getNofColumns() -{ - if (d->m_bWordWrap) - { - return getNofVisibleColumns(); - } - else - { - int nofColumns = 0; - for( int i = 0; i< d->m_size; ++i ) - { - if ( d->m_pLineData[i].width( d->m_pOptionDialog->m_tabSize ) > nofColumns ) - nofColumns = d->m_pLineData[i].width( d->m_pOptionDialog->m_tabSize ); - } - return nofColumns; - } -} - -int DiffTextWindow::getNofLines() -{ - return d->m_bWordWrap ? d->m_diff3WrapLineVector.size() : - d->m_pDiff3LineVector->size(); -} - - -int DiffTextWindow::convertLineToDiff3LineIdx( int line ) -{ - if ( d->m_bWordWrap && d->m_diff3WrapLineVector.size()>0 ) - return d->m_diff3WrapLineVector[ min2( line, (int)d->m_diff3WrapLineVector.size()-1 ) ].diff3LineIndex; - else - return line; -} - -int DiffTextWindow::convertDiff3LineIdxToLine( int d3lIdx ) -{ - if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 && d->m_pDiff3LineVector->size()>0 ) - return (*d->m_pDiff3LineVector)[ min2( d3lIdx, (int)d->m_pDiff3LineVector->size()-1 ) ]->sumLinesNeededForDisplay; - else - return d3lIdx; -} - -/** Returns a line number where the linerange [line, line+nofLines] can - be displayed best. If it fits into the currently visible range then - the returned value is the current firstLine. -*/ -int getBestFirstLine( int line, int nofLines, int firstLine, int visibleLines ) -{ - int newFirstLine = firstLine; - if ( line < firstLine || line + nofLines + 2 > firstLine + visibleLines ) - { - if ( nofLines > visibleLines || nofLines <= ( 2*visibleLines / 3 - 1) ) - newFirstLine = line - visibleLines/3; - else - newFirstLine = line - (visibleLines - nofLines); - } - - return newFirstLine; -} - - -void DiffTextWindow::setFastSelectorRange( int line1, int nofLines ) -{ - d->m_fastSelectorLine1 = line1; - d->m_fastSelectorNofLines = nofLines; - if ( isVisible() ) - { - int newFirstLine = getBestFirstLine( - convertDiff3LineIdxToLine(d->m_fastSelectorLine1), - convertDiff3LineIdxToLine(d->m_fastSelectorLine1+d->m_fastSelectorNofLines)-convertDiff3LineIdxToLine(d->m_fastSelectorLine1), - d->m_firstLine, - getNofVisibleLines() - ); - if ( newFirstLine != d->m_firstLine ) - { - scroll( 0, newFirstLine - d->m_firstLine ); - } - - update(); - } -} - - -void DiffTextWindow::showStatusLine(int line ) -{ - int d3lIdx = convertLineToDiff3LineIdx( line ); - if(d3lIdx >= 0 && d3lIdx<(int)d->m_pDiff3LineVector->size() ) - { - const Diff3Line* pD3l = (*d->m_pDiff3LineVector)[d3lIdx]; - if ( pD3l != 0 ) - { - int l = pD3l->getLineInFile( d->m_winIdx ); - - QString s; - if ( l!=-1 ) - s.sprintf("File %s: Line %d", d->m_filename.ascii(), l+1 ); - else - s.sprintf("File %s: Line not available", d->m_filename.ascii() ); - if (d->m_pStatusBar!=0) d->m_pStatusBar->message(s); - - emit lineClicked( d->m_winIdx, l ); - } - } -} - -void DiffTextWindow::focusInEvent(QFocusEvent* e) -{ - emit gotFocus(); - QWidget::focusInEvent(e); -} - -void DiffTextWindow::mousePressEvent ( QMouseEvent* e ) -{ - if ( e->button() == Qt::LeftButton ) - { - int line; - int pos; - convertToLinePos( e->x(), e->y(), line, pos ); - if ( pos < d->m_firstColumn ) - { - emit setFastSelectorLine( convertLineToDiff3LineIdx(line) ); - d->m_selection.firstLine = -1; // Disable current d->m_selection - } - else - { // Selection - resetSelection(); - d->m_selection.start( line, pos ); - d->m_selection.end( line, pos ); - d->m_bSelectionInProgress = true; - d->m_lastKnownMousePos = e->pos(); - - showStatusLine( line ); - } - } -} - -bool isCTokenChar( QChar c ) -{ - return (c=='_') || - ( c>='A' && c<='Z' ) || ( c>='a' && c<='z' ) || - (c>='0' && c<='9'); -} - -/// Calculate where a token starts and ends, given the x-position on screen. -void calcTokenPos( const QString& s, int posOnScreen, int& pos1, int& pos2, int tabSize ) -{ - // Cursor conversions that consider g_tabSize - int pos = convertToPosInText( s, max2( 0, posOnScreen ), tabSize ); - if ( pos>=(int)s.length() ) - { - pos1=s.length(); - pos2=s.length(); - return; - } - - pos1 = pos; - pos2 = pos+1; - - if( isCTokenChar( s[pos1] ) ) - { - while( pos1>=0 && isCTokenChar( s[pos1] ) ) - --pos1; - ++pos1; - - while( pos2<(int)s.length() && isCTokenChar( s[pos2] ) ) - ++pos2; - } -} - -void DiffTextWindow::mouseDoubleClickEvent( QMouseEvent* e ) -{ - d->m_bSelectionInProgress = false; - d->m_lastKnownMousePos = e->pos(); - if ( e->button() == Qt::LeftButton ) - { - int line; - int pos; - convertToLinePos( e->x(), e->y(), line, pos ); - - // Get the string data of the current line - QString s; - if ( d->m_bWordWrap ) - { - const Diff3WrapLine& d3wl = d->m_diff3WrapLineVector[line]; - s = d->getString( d3wl.diff3LineIndex ).mid( d3wl.wrapLineOffset, d3wl.wrapLineLength ); - } - else - { - s = d->getString( line ); - } - - if ( ! s.isEmpty() ) - { - int pos1, pos2; - calcTokenPos( s, pos, pos1, pos2, d->m_pOptionDialog->m_tabSize ); - - resetSelection(); - d->m_selection.start( line, convertToPosOnScreen( s, pos1, d->m_pOptionDialog->m_tabSize ) ); - d->m_selection.end( line, convertToPosOnScreen( s, pos2, d->m_pOptionDialog->m_tabSize ) ); - update(); - // emit d->m_selectionEnd() happens in the mouseReleaseEvent. - showStatusLine( line ); - } - } -} - -void DiffTextWindow::mouseReleaseEvent ( QMouseEvent* e ) -{ - d->m_bSelectionInProgress = false; - d->m_lastKnownMousePos = e->pos(); - //if ( e->button() == LeftButton ) - { - killTimer(d->m_delayedDrawTimer); - d->m_delayedDrawTimer = 0; - if (d->m_selection.firstLine != -1 ) - { - emit selectionEnd(); - } - } - d->m_scrollDeltaX=0; - d->m_scrollDeltaY=0; -} - -inline int sqr(int x){return x*x;} - -void DiffTextWindow::mouseMoveEvent ( QMouseEvent * e ) -{ - int line; - int pos; - convertToLinePos( e->x(), e->y(), line, pos ); - d->m_lastKnownMousePos = e->pos(); - - if (d->m_selection.firstLine != -1 ) - { - d->m_selection.end( line, pos ); - - showStatusLine( line ); - - // Scroll because mouse moved out of the window - const QFontMetrics& fm = fontMetrics(); - int fontWidth = fm.width('W'); - int deltaX=0; - int deltaY=0; - if ( ! d->m_pOptionDialog->m_bRightToLeftLanguage ) - { - if ( e->x() < d->leftInfoWidth()*fontWidth ) deltaX = -1 - abs(e->x()-d->leftInfoWidth()*fontWidth)/fontWidth; - if ( e->x() > width() ) deltaX = +1 + abs(e->x()-width())/fontWidth; - } - else - { - if ( e->x() > width()-1-d->leftInfoWidth()*fontWidth ) deltaX=+1+ abs(e->x() - (width()-1-d->leftInfoWidth()*fontWidth)) / fontWidth; - if ( e->x() < fontWidth ) deltaX=-1- abs(e->x()-fontWidth)/fontWidth; - } - if ( e->y() < 0 ) deltaY = -1 - sqr( e->y() ) / sqr(fm.height()); - if ( e->y() > height() ) deltaY = +1 + sqr( e->y() - height() ) / sqr(fm.height()); - if ( deltaX != 0 && d->m_scrollDeltaX!=deltaX || deltaY!= 0 && d->m_scrollDeltaY!=deltaY ) - { - d->m_scrollDeltaX = deltaX; - d->m_scrollDeltaY = deltaY; - emit scroll( deltaX, deltaY ); - killTimer( d->m_delayedDrawTimer ); - d->m_delayedDrawTimer = startTimer(50); - } - else - { - d->m_scrollDeltaX = deltaX; - d->m_scrollDeltaY = deltaY; - d->myUpdate(0); - } - } -} - - -void DiffTextWindowData::myUpdate(int afterMilliSecs) -{ - m_pDiffTextWindow->killTimer( m_delayedDrawTimer ); - m_bMyUpdate = true; - m_delayedDrawTimer = m_pDiffTextWindow->startTimer( afterMilliSecs ); -} - -void DiffTextWindow::timerEvent(QTimerEvent*) -{ - killTimer(d->m_delayedDrawTimer); - d->m_delayedDrawTimer = 0; - - if ( d->m_bMyUpdate ) - { - int fontHeight = fontMetrics().height(); - - if ( d->m_selection.oldLastLine != -1 ) - { - int lastLine; - int firstLine; - if ( d->m_selection.oldFirstLine != -1 ) - { - firstLine = min3( d->m_selection.oldFirstLine, d->m_selection.lastLine, d->m_selection.oldLastLine ); - lastLine = max3( d->m_selection.oldFirstLine, d->m_selection.lastLine, d->m_selection.oldLastLine ); - } - else - { - firstLine = min2( d->m_selection.lastLine, d->m_selection.oldLastLine ); - lastLine = max2( d->m_selection.lastLine, d->m_selection.oldLastLine ); - } - int y1 = ( firstLine - d->m_firstLine ) * fontHeight; - int y2 = min2( height(), ( lastLine - d->m_firstLine + 1 ) * fontHeight ); - - if ( y10 ) - { - QRect invalidRect = QRect( 0, y1, width(), y2-y1 ); - update( invalidRect ); - } - } - - d->m_bMyUpdate = false; - } - - if ( d->m_scrollDeltaX != 0 || d->m_scrollDeltaY != 0 ) - { - d->m_selection.end( d->m_selection.lastLine + d->m_scrollDeltaY, d->m_selection.lastPos + d->m_scrollDeltaX ); - emit scroll( d->m_scrollDeltaX, d->m_scrollDeltaY ); - killTimer(d->m_delayedDrawTimer); - d->m_delayedDrawTimer = startTimer(50); - } -} - -void DiffTextWindow::resetSelection() -{ - d->m_selection.reset(); - update(); -} - -void DiffTextWindow::convertToLinePos( int x, int y, int& line, int& pos ) -{ - const QFontMetrics& fm = fontMetrics(); - int fontHeight = fm.height(); - int fontWidth = fm.width('W'); - int xOffset = ( d->leftInfoWidth() - d->m_firstColumn ) * fontWidth; - - int yOffset = - d->m_firstLine * fontHeight; - - line = ( y - yOffset ) / fontHeight; - if ( ! d->m_pOptionDialog->m_bRightToLeftLanguage ) - pos = ( x - xOffset ) / fontWidth; - else - pos = ( (width() - 1 - x) - xOffset ) / fontWidth; -} - -int Selection::firstPosInLine(int l) -{ - assert( firstLine != -1 ); - - int l1 = firstLine; - int l2 = lastLine; - int p1 = firstPos; - int p2 = lastPos; - if ( l1>l2 ){ std::swap(l1,l2); std::swap(p1,p2); } - if ( l1==l2 && p1>p2 ){ std::swap(p1,p2); } - - if ( l==l1 ) - return p1; - return 0; -} - -int Selection::lastPosInLine(int l) -{ - assert( firstLine != -1 ); - - int l1 = firstLine; - int l2 = lastLine; - int p1 = firstPos; - int p2 = lastPos; - - if ( l1>l2 ){ std::swap(l1,l2); std::swap(p1,p2); } - if ( l1==l2 && p1>p2 ){ std::swap(p1,p2); } - - if ( l==l2 ) - return p2; - return INT_MAX; -} - -bool Selection::within( int l, int p ) -{ - if ( firstLine == -1 ) return false; - int l1 = firstLine; - int l2 = lastLine; - int p1 = firstPos; - int p2 = lastPos; - if ( l1>l2 ){ std::swap(l1,l2); std::swap(p1,p2); } - if ( l1==l2 && p1>p2 ){ std::swap(p1,p2); } - if( l1 <= l && l <= l2 ) - { - if ( l1==l2 ) - return p>=p1 && p=p1; - if ( l==l2 ) - return pl2 ){ std::swap(l1,l2); } - - return ( l1 <= l && l <= l2 ); -} - - -void DiffTextWindowData::writeLine( - MyPainter& p, - const LineData* pld, - const DiffList* pLineDiff1, - const DiffList* pLineDiff2, - int line, - int whatChanged, - int whatChanged2, - int srcLineIdx, - int wrapLineOffset, - int wrapLineLength, - bool bWrapLine, - const QRect& invalidRect, - int deviceWidth - ) -{ - QFont normalFont = p.font(); - QFont diffFont = normalFont; - diffFont.setItalic( m_pOptionDialog->m_bItalicForDeltas ); - const QFontMetrics& fm = p.fontMetrics(); - int fontHeight = fm.height(); - int fontAscent = fm.ascent(); - int fontDescent = fm.descent(); - int fontWidth = fm.width('W'); - - int xOffset = (leftInfoWidth() - m_firstColumn)*fontWidth; - int yOffset = (line-m_firstLine) * fontHeight; - - QRect lineRect( 0, yOffset, deviceWidth, fontHeight ); - if ( ! invalidRect.intersects( lineRect ) ) - { - return; - } - - int fastSelectorLine1 = m_pDiffTextWindow->convertDiff3LineIdxToLine(m_fastSelectorLine1); - int fastSelectorLine2 = m_pDiffTextWindow->convertDiff3LineIdxToLine(m_fastSelectorLine1+m_fastSelectorNofLines)-1; - - bool bFastSelectionRange = (line>=fastSelectorLine1 && line<= fastSelectorLine2 ); - QColor bgColor = m_pOptionDialog->m_bgColor; - QColor diffBgColor = m_pOptionDialog->m_diffBgColor; - - if ( bFastSelectionRange ) - { - bgColor = m_pOptionDialog->m_currentRangeBgColor; - diffBgColor = m_pOptionDialog->m_currentRangeDiffBgColor; - } - - if ( yOffset+fontHeightm_fgColor; - if ( changed == 2 ) { - c = m_cDiff2; - } else if ( changed == 1 ) { - c = m_cDiff1; - } else if ( changed == 3 ) { - c = m_cDiffBoth; - } - - p.fillRect( leftInfoWidth()*fontWidth, yOffset, deviceWidth, fontHeight, bgColor ); - - if (pld!=0) - { - // First calculate the "changed" information for each character. - int i=0; - std::vector charChanged( pld->size ); - if ( pLineDiff1!=0 || pLineDiff2 != 0 ) - { - Merger merger( pLineDiff1, pLineDiff2 ); - while( ! merger.isEndReached() && isize ) - { - if ( i < pld->size ) - { - charChanged[i] = merger.whatChanged(); - ++i; - } - merger.next(); - } - } - - QString s=" "; - // Convert tabs - int outPos = 0; - - QString lineString( pld->pLine, pld->size ); - int lineLength = m_bWordWrap ? wrapLineOffset+wrapLineLength : lineString.length(); - - for( i=wrapLineOffset; im_tabSize ); - s[0] = ' '; - } - else - { - s[0] = lineString[i]; - } - - QColor c = m_pOptionDialog->m_fgColor; - int cchanged = charChanged[i] | whatChanged; - - if ( cchanged == 2 ) { - c = m_cDiff2; - } else if ( cchanged == 1 ) { - c = m_cDiff1; - } else if ( cchanged == 3 ) { - c = m_cDiffBoth; - } - - if ( c!=m_pOptionDialog->m_fgColor && whatChanged2==0 && !m_pOptionDialog->m_bShowWhiteSpace ) - { - // The user doesn't want to see highlighted white space. - c = m_pOptionDialog->m_fgColor; - } - - QRect outRect( xOffset + fontWidth*outPos, yOffset, fontWidth*spaces, fontHeight ); - if ( m_pOptionDialog->m_bRightToLeftLanguage ) - outRect = QRect( deviceWidth-1-(xOffset + fontWidth*outPos), yOffset, -fontWidth*spaces, fontHeight ).normalize(); - if ( invalidRect.intersects( outRect ) ) - { - if( !m_selection.within( line, outPos ) ) - { - - if( c!=m_pOptionDialog->m_fgColor ) - { - QColor lightc = diffBgColor; - p.fillRect( xOffset + fontWidth*outPos, yOffset, - fontWidth*spaces, fontHeight, lightc ); - p.setFont(diffFont); - } - - p.setPen( c ); - if ( s[0]==' ' && c!=m_pOptionDialog->m_fgColor && charChanged[i]!=0 ) - { - if ( m_pOptionDialog->m_bShowWhiteSpaceCharacters && m_pOptionDialog->m_bShowWhiteSpace) - { - p.fillRect( xOffset + fontWidth*outPos, yOffset+fontAscent, - fontWidth*spaces-1, fontDescent, c ); // QT3 - //fontWidth*spaces-1, fontDescent, c ); // QT4 - } - } - else - { - p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, s ); - } - p.setFont(normalFont); - } - else - { - p.fillRect( xOffset + fontWidth*outPos, yOffset, - fontWidth*(spaces), fontHeight, m_pDiffTextWindow->colorGroup().highlight() ); - - p.setPen( m_pDiffTextWindow->colorGroup().highlightedText() ); - p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, s ); - - m_selection.bSelectionContainsData = true; - } - } - - outPos += spaces; - } - - if( m_selection.lineWithin( line ) && m_selection.lineWithin( line+1 ) ) - { - p.fillRect( xOffset + fontWidth*outPos, yOffset, - deviceWidth, fontHeight, m_pDiffTextWindow->colorGroup().highlight() ); - } - } - - p.fillRect( 0, yOffset, leftInfoWidth()*fontWidth, fontHeight, m_pOptionDialog->m_bgColor ); - - xOffset = (m_lineNumberWidth+2)*fontWidth; - int xLeft = m_lineNumberWidth*fontWidth; - p.setPen( m_pOptionDialog->m_fgColor ); - if ( pld!=0 ) - { - if ( m_pOptionDialog->m_bShowLineNumbers && !bWrapLine ) - { - QString num; - num.sprintf( "%0*d", m_lineNumberWidth, srcLineIdx+1); - p.drawText( 0, yOffset + fontAscent, num ); - //p.drawLine( xLeft -1, yOffset, xLeft -1, yOffset+fontHeight-1 ); - } - if ( !bWrapLine || wrapLineLength>0 ) - { - p.setPen( QPen( m_pOptionDialog->m_fgColor, 0, bWrapLine ? Qt::DotLine : Qt::SolidLine) ); - p.drawLine( xOffset +1, yOffset, xOffset +1, yOffset+fontHeight-1 ); - p.setPen( QPen( m_pOptionDialog->m_fgColor, 0, Qt::SolidLine) ); - } - } - if ( c!=m_pOptionDialog->m_fgColor && whatChanged2==0 )//&& whatChanged==0 ) - { - if ( m_pOptionDialog->m_bShowWhiteSpace ) - { - p.setBrushOrigin(0,0); - p.fillRect( xLeft, yOffset, fontWidth*2-1, fontHeight, QBrush(c,Qt::Dense5Pattern) ); - } - } - else - { - p.fillRect( xLeft, yOffset, fontWidth*2-1, fontHeight, c==m_pOptionDialog->m_fgColor ? bgColor : c ); - } - - if ( bFastSelectionRange ) - { - p.fillRect( xOffset + fontWidth-1, yOffset, 3, fontHeight, m_pOptionDialog->m_fgColor ); - } - - // Check if line needs a manual diff help mark - ManualDiffHelpList::const_iterator ci; - for( ci = m_pManualDiffHelpList->begin(); ci!=m_pManualDiffHelpList->end(); ++ci) - { - const ManualDiffHelpEntry& mdhe=*ci; - int rangeLine1 = -1; - int rangeLine2 = -1; - if (m_winIdx==1 ) { rangeLine1 = mdhe.lineA1; rangeLine2= mdhe.lineA2; } - if (m_winIdx==2 ) { rangeLine1 = mdhe.lineB1; rangeLine2= mdhe.lineB2; } - if (m_winIdx==3 ) { rangeLine1 = mdhe.lineC1; rangeLine2= mdhe.lineC2; } - if ( rangeLine1>=0 && rangeLine2>=0 && srcLineIdx >= rangeLine1 && srcLineIdx <= rangeLine2 ) - { - p.fillRect( xOffset - fontWidth, yOffset, fontWidth-1, fontHeight, m_pOptionDialog->m_manualHelpRangeColor ); - break; - } - } -} - -void DiffTextWindow::paintEvent( QPaintEvent* e ) -{ - if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || - ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) - return; - - QRect invalidRect = e->rect(); - if ( invalidRect.isEmpty() ) - return; - - bool bOldSelectionContainsData = d->m_selection.bSelectionContainsData; - d->m_selection.bSelectionContainsData = false; - - int endLine = min2( d->m_firstLine + getNofVisibleLines()+2, getNofLines() ); - - //if ( invalidRect.size()==size() ) - { // double buffering, obsolete with Qt4 - //QPainter painter(this); // Remove for Qt4 - //QPixmap pixmap( invalidRect.size() );// Remove for Qt4 - - 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.setFont( font() ); - p.QPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); - - d->draw( p, invalidRect, width(), d->m_firstLine, endLine ); - // 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 - } -// else -// { // no double buffering -// MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); -// p.setFont( font() ); -// p.QPainter::fillRect( invalidRect, d->m_pOptionDialog->m_bgColor ); -// d->draw( p, invalidRect, width(), d->m_firstLine, endLine ); -// } - - - d->m_oldFirstLine = d->m_firstLine; - d->m_oldFirstColumn = d->m_firstColumn; - d->m_selection.oldLastLine = -1; - if ( d->m_selection.oldFirstLine !=-1 ) - d->m_selection.oldFirstLine = -1; - - if( !bOldSelectionContainsData && d->m_selection.bSelectionContainsData ) - emit newSelection(); -} - -void DiffTextWindow::print( MyPainter& p, const QRect&, int firstLine, int nofLinesPerPage ) -{ - if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || - ( d->m_diff3WrapLineVector.empty() && d->m_bWordWrap ) ) - return; - resetSelection(); -// MyPainter p( this, d->m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); - int oldFirstLine = d->m_firstLine; - d->m_firstLine = firstLine; - QRect invalidRect = QRect(0,0,QCOORD_MAX,QCOORD_MAX); - QColor bgColor = d->m_pOptionDialog->m_bgColor; - d->m_pOptionDialog->m_bgColor = Qt::white; - d->draw( p, invalidRect, p.window().width(), firstLine, min2(firstLine+nofLinesPerPage,getNofLines()) ); - d->m_pOptionDialog->m_bgColor = bgColor; - d->m_firstLine = oldFirstLine; -} - -void DiffTextWindowData::draw( MyPainter& p, const QRect& invalidRect, int deviceWidth, int beginLine, int endLine ) -{ - m_lineNumberWidth = m_pOptionDialog->m_bShowLineNumbers ? (int)log10((double)m_size)+1 : 0; - - if ( m_winIdx==1 ) - { - m_cThis = m_pOptionDialog->m_colorA; - m_cDiff1 = m_pOptionDialog->m_colorB; - m_cDiff2 = m_pOptionDialog->m_colorC; - } - if ( m_winIdx==2 ) - { - m_cThis = m_pOptionDialog->m_colorB; - m_cDiff1 = m_pOptionDialog->m_colorC; - m_cDiff2 = m_pOptionDialog->m_colorA; - } - if ( m_winIdx==3 ) - { - m_cThis = m_pOptionDialog->m_colorC; - m_cDiff1 = m_pOptionDialog->m_colorA; - m_cDiff2 = m_pOptionDialog->m_colorB; - } - m_cDiffBoth = m_pOptionDialog->m_colorForConflict; // Conflict color - - p.setPen( m_cThis ); - - for ( int line = beginLine; line 0 && m_diff3WrapLineVector[line-1].pD3L == d3l; - } - else - { - d3l = (*m_pDiff3LineVector)[line]; - } - DiffList* pFineDiff1; - DiffList* pFineDiff2; - int changed=0; - int changed2=0; - - int srcLineIdx=-1; - getLineInfo( *d3l, srcLineIdx, pFineDiff1, pFineDiff2, changed, changed2 ); - - writeLine( - p, // QPainter - srcLineIdx == -1 ? 0 : &m_pLineData[srcLineIdx], // Text in this line - pFineDiff1, - pFineDiff2, - line, // Line on the screen - changed, - changed2, - srcLineIdx, - wrapLineOffset, - wrapLineLength, - bWrapLine, - invalidRect, - deviceWidth - ); - } -} - -QString DiffTextWindowData::getString( int d3lIdx ) -{ - const Diff3Line* d3l = (*m_pDiff3LineVector)[d3lIdx]; - DiffList* pFineDiff1; - DiffList* pFineDiff2; - int changed=0; - int changed2=0; - int lineIdx; - getLineInfo( *d3l, lineIdx, pFineDiff1, pFineDiff2, changed, changed2 ); - - if (lineIdx==-1) return QString(); - else - { - const LineData* ld = &m_pLineData[lineIdx]; - return QString( ld->pLine, ld->size ); - } - return QString(); -} - -QString DiffTextWindowData::getLineString( int line ) -{ - if ( m_bWordWrap ) - { - int d3LIdx = m_pDiffTextWindow->convertLineToDiff3LineIdx(line); - return getString( d3LIdx ).mid( m_diff3WrapLineVector[line].wrapLineOffset, m_diff3WrapLineVector[line].wrapLineLength ); - } - else - { - return getString( line ); - } -} - -void DiffTextWindowData::getLineInfo( - const Diff3Line& d3l, - int& lineIdx, - DiffList*& pFineDiff1, DiffList*& pFineDiff2, // return values - int& changed, int& changed2 - ) -{ - changed=0; - changed2=0; - bool bAEqB = d3l.bAEqB || ( d3l.bWhiteLineA && d3l.bWhiteLineB ); - bool bAEqC = d3l.bAEqC || ( d3l.bWhiteLineA && d3l.bWhiteLineC ); - bool bBEqC = d3l.bBEqC || ( d3l.bWhiteLineB && d3l.bWhiteLineC ); - if ( m_winIdx == 1 ) { - lineIdx=d3l.lineA; - pFineDiff1=d3l.pFineAB; - pFineDiff2=d3l.pFineCA; - changed |= ((d3l.lineB==-1)!=(lineIdx==-1) ? 1 : 0) + - ((d3l.lineC==-1)!=(lineIdx==-1) && m_bTriple ? 2 : 0); - changed2 |= ( bAEqB ? 0 : 1 ) + (bAEqC || !m_bTriple ? 0 : 2); - } - else if ( m_winIdx == 2 ) { - lineIdx=d3l.lineB; - pFineDiff1=d3l.pFineBC; - pFineDiff2=d3l.pFineAB; - changed |= ((d3l.lineC==-1)!=(lineIdx==-1) && m_bTriple ? 1 : 0) + - ((d3l.lineA==-1)!=(lineIdx==-1) ? 2 : 0); - changed2 |= ( bBEqC || !m_bTriple ? 0 : 1 ) + (bAEqB ? 0 : 2); - } - else if ( m_winIdx == 3 ) { - lineIdx=d3l.lineC; - pFineDiff1=d3l.pFineCA; - pFineDiff2=d3l.pFineBC; - changed |= ((d3l.lineA==-1)!=(lineIdx==-1) ? 1 : 0) + - ((d3l.lineB==-1)!=(lineIdx==-1) ? 2 : 0); - changed2 |= ( bAEqC ? 0 : 1 ) + (bBEqC ? 0 : 2); - } - else assert(false); -} - - - -void DiffTextWindow::resizeEvent( QResizeEvent* e ) -{ - QSize s = e->size(); - QFontMetrics fm = fontMetrics(); - int visibleLines = s.height()/fm.height()-2; - int visibleColumns = s.width()/fm.width('W') - d->leftInfoWidth(); - emit resizeSignal( visibleColumns, visibleLines ); - QWidget::resizeEvent(e); -} - -int DiffTextWindow::getNofVisibleLines() -{ - QFontMetrics fm = fontMetrics(); - int fmh = fm.height(); - int h = height(); - return h/fmh -1;//height()/fm.height()-2; -} - -int DiffTextWindow::getNofVisibleColumns() -{ - QFontMetrics fm = fontMetrics(); - return width()/fm.width('W') - d->leftInfoWidth(); -} - -QString DiffTextWindow::getSelection() -{ - QString selectionString; - - int line=0; - int lineIdx=0; - - int it; - int vectorSize = d->m_bWordWrap ? d->m_diff3WrapLineVector.size() : d->m_pDiff3LineVector->size(); - for( it=0; itm_bWordWrap ? d->m_diff3WrapLineVector[it].pD3L : (*d->m_pDiff3LineVector)[it]; - if ( d->m_winIdx == 1 ) { lineIdx=d3l->lineA; } - else if ( d->m_winIdx == 2 ) { lineIdx=d3l->lineB; } - else if ( d->m_winIdx == 3 ) { lineIdx=d3l->lineC; } - else assert(false); - - if( lineIdx != -1 ) - { - const QChar* pLine = d->m_pLineData[lineIdx].pLine; - int size = d->m_pLineData[lineIdx].size; - QString lineString = QString( pLine, size ); - - if ( d->m_bWordWrap ) - { - size = d->m_diff3WrapLineVector[it].wrapLineLength; - lineString = lineString.mid( d->m_diff3WrapLineVector[it].wrapLineOffset, size ); - } - - // Consider tabs - int outPos = 0; - for( int i=0; im_pOptionDialog->m_tabSize ); - } - - if( d->m_selection.within( line, outPos ) ) - { - selectionString += lineString[i]; - } - - outPos += spaces; - } - - if( d->m_selection.within( line, outPos ) && - !( d->m_bWordWrap && it+1m_diff3WrapLineVector[it+1].pD3L ) - ) - { - #ifdef _WIN32 - selectionString += '\r'; - #endif - selectionString += '\n'; - } - } - - ++line; - } - - return selectionString; -} - -bool DiffTextWindow::findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) -{ - int it = d3vLine; - int endIt = bDirDown ? (int)d->m_pDiff3LineVector->size() : -1; - int step = bDirDown ? 1 : -1; - int startPos = posInLine; - - for( ; it!=endIt; it+=step ) - { - QString line = d->getString( it ); - if ( !line.isEmpty() ) - { - int pos = line.find( s, startPos, bCaseSensitive ); - if ( pos != -1 ) - { - d3vLine = it; - posInLine = pos; - return true; - } - - startPos = 0; - } - } - return false; -} - -void DiffTextWindow::convertD3LCoordsToLineCoords( int d3LIdx, int d3LPos, int& line, int& pos ) -{ - if( d->m_bWordWrap ) - { - int wrapPos = d3LPos; - int wrapLine = convertDiff3LineIdxToLine(d3LIdx); - while ( wrapPos > d->m_diff3WrapLineVector[wrapLine].wrapLineLength ) - { - wrapPos -= d->m_diff3WrapLineVector[wrapLine].wrapLineLength; - ++wrapLine; - } - pos = wrapPos; - line = wrapLine; - } - else - { - pos = d3LPos; - line = d3LIdx; - } -} - -void DiffTextWindow::convertLineCoordsToD3LCoords( int line, int pos, int& d3LIdx, int& d3LPos ) -{ - if( d->m_bWordWrap ) - { - d3LPos = pos; - d3LIdx = convertLineToDiff3LineIdx( line ); - int wrapLine = convertDiff3LineIdxToLine(d3LIdx); // First wrap line belonging to this d3LIdx - while ( wrapLine < line ) - { - d3LPos += d->m_diff3WrapLineVector[wrapLine].wrapLineLength; - ++wrapLine; - } - } - else - { - d3LPos = pos; - d3LIdx = line; - } -} - - -void DiffTextWindow::setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p ) -{ - d->m_selection.reset(); - if ( lastLine >= getNofLines() ) - { - lastLine = getNofLines()-1; - - const Diff3Line* d3l = (*d->m_pDiff3LineVector)[convertLineToDiff3LineIdx(lastLine)]; - int line = -1; - if ( d->m_winIdx==1 ) line = d3l->lineA; - if ( d->m_winIdx==2 ) line = d3l->lineB; - if ( d->m_winIdx==3 ) line = d3l->lineC; - if (line>=0) - endPos = d->m_pLineData[line].width( d->m_pOptionDialog->m_tabSize); - } - - if ( d->m_bWordWrap && d->m_pDiff3LineVector!=0 ) - { - QString s1 = d->getString(firstLine); - int firstWrapLine = convertDiff3LineIdxToLine(firstLine); - int wrapStartPos = startPos; - while ( wrapStartPos > d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength ) - { - wrapStartPos -= d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength; - s1 = s1.mid(d->m_diff3WrapLineVector[firstWrapLine].wrapLineLength); - ++firstWrapLine; - } - - QString s2 = d->getString(lastLine); - int lastWrapLine = convertDiff3LineIdxToLine(lastLine); - int wrapEndPos = endPos; - while ( wrapEndPos > d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength ) - { - wrapEndPos -= d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength; - s2 = s2.mid(d->m_diff3WrapLineVector[lastWrapLine].wrapLineLength); - ++lastWrapLine; - } - - d->m_selection.start( firstWrapLine, convertToPosOnScreen( s1, wrapStartPos, d->m_pOptionDialog->m_tabSize ) ); - d->m_selection.end( lastWrapLine, convertToPosOnScreen( s2, wrapEndPos, d->m_pOptionDialog->m_tabSize ) ); - l=firstWrapLine; - p=wrapStartPos; - } - else - { - d->m_selection.start( firstLine, convertToPosOnScreen( d->getString(firstLine), startPos, d->m_pOptionDialog->m_tabSize ) ); - d->m_selection.end( lastLine, convertToPosOnScreen( d->getString(lastLine), endPos, d->m_pOptionDialog->m_tabSize ) ); - l=firstLine; - p=startPos; - } - update(); -} - -int DiffTextWindowData::convertLineOnScreenToLineInSource( int lineOnScreen, e_CoordType coordType, bool bFirstLine ) -{ - int line=-1; - if (lineOnScreen>=0) - { - if (coordType==eWrapCoords) return lineOnScreen; - int d3lIdx = m_pDiffTextWindow->convertLineToDiff3LineIdx( lineOnScreen ); - if ( !bFirstLine && d3lIdx >= (int)m_pDiff3LineVector->size() ) - d3lIdx = m_pDiff3LineVector->size()-1; - if (coordType==eD3LLineCoords) return d3lIdx; - while ( line<0 && d3lIdx<(int)m_pDiff3LineVector->size() && d3lIdx>=0 ) - { - const Diff3Line* d3l = (*m_pDiff3LineVector)[d3lIdx]; - if ( m_winIdx==1 ) line = d3l->lineA; - if ( m_winIdx==2 ) line = d3l->lineB; - if ( m_winIdx==3 ) line = d3l->lineC; - if ( bFirstLine ) - ++d3lIdx; - else - --d3lIdx; - } - if (coordType==eFileCoords) return line; - } - return line; -} - - -void DiffTextWindow::getSelectionRange( int* pFirstLine, int* pLastLine, e_CoordType coordType ) -{ - if (pFirstLine) - *pFirstLine = d->convertLineOnScreenToLineInSource( d->m_selection.beginLine(), coordType, true ); - if (pLastLine) - *pLastLine = d->convertLineOnScreenToLineInSource( d->m_selection.endLine(), coordType, false ); -} - -// Returns the number of wrapped lines -// if pWrappedLines != 0 then the stringlist will contain the wrapped lines. -int wordWrap( const QString& origLine, int nofColumns, Diff3WrapLine* pDiff3WrapLine ) -{ - if (nofColumns<=0) - nofColumns = 1; - - int nofNeededLines = 0; - int length = origLine.length(); - - if (length==0) - { - nofNeededLines = 1; - if( pDiff3WrapLine ) - { - pDiff3WrapLine->wrapLineOffset=0; - pDiff3WrapLine->wrapLineLength=0; - } - } - else - { - int pos = 0; - - while ( pos < length ) - { - int wrapPos = pos + nofColumns; - - if ( length-pos <= nofColumns ) - { - wrapPos = length; - } - else - { - int wsPos = max2( origLine.findRev( ' ', wrapPos ), origLine.findRev( '\t', wrapPos ) ); - - if ( wsPos > pos ) - { - // Wrap line at wsPos - wrapPos = wsPos; - } - } - - if ( pDiff3WrapLine ) - { - pDiff3WrapLine->wrapLineOffset = pos; - pDiff3WrapLine->wrapLineLength = wrapPos-pos; - ++pDiff3WrapLine; - } - - pos = wrapPos; - - ++nofNeededLines; - } - } - return nofNeededLines; -} - -void DiffTextWindow::convertSelectionToD3LCoords() -{ - if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || !isVisible() || d->m_selection.isEmpty() ) - { - return; - } - - // convert the d->m_selection to unwrapped coordinates: Later restore to new coords - int firstD3LIdx, firstD3LPos; - QString s = d->getLineString( d->m_selection.beginLine() ); - int firstPosInText = convertToPosInText( s, d->m_selection.beginPos(), d->m_pOptionDialog->m_tabSize ); - convertLineCoordsToD3LCoords( d->m_selection.beginLine(), firstPosInText, firstD3LIdx, firstD3LPos ); - - int lastD3LIdx, lastD3LPos; - s = d->getLineString( d->m_selection.endLine() ); - int lastPosInText = convertToPosInText( s, d->m_selection.endPos(), d->m_pOptionDialog->m_tabSize ); - convertLineCoordsToD3LCoords( d->m_selection.endLine(), lastPosInText, lastD3LIdx, lastD3LPos ); - - //d->m_selection.reset(); - d->m_selection.start( firstD3LIdx, firstD3LPos ); - d->m_selection.end( lastD3LIdx, lastD3LPos ); -} - -void DiffTextWindow::recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns ) -{ - if ( d->m_pDiff3LineVector==0 || ! d->m_bPaintingAllowed || !isVisible() ) - { - d->m_bWordWrap = bWordWrap; - if (!bWordWrap) d->m_diff3WrapLineVector.resize( 0 ); - return; - } - - d->m_bWordWrap = bWordWrap; - - if ( bWordWrap ) - { - d->m_diff3WrapLineVector.resize( wrapLineVectorSize ); - - if (nofVisibleColumns<0) - nofVisibleColumns = getNofVisibleColumns(); - else - nofVisibleColumns-= d->leftInfoWidth(); - int i; - int wrapLineIdx = 0; - int size = d->m_pDiff3LineVector->size(); - for( i=0; igetString( i ); - int linesNeeded = wordWrap( s, nofVisibleColumns, wrapLineVectorSize==0 ? 0 : &d->m_diff3WrapLineVector[wrapLineIdx] ); - Diff3Line& d3l = *(*d->m_pDiff3LineVector)[i]; - if ( d3l.linesNeededForDisplay0 ) - { - int j; - for( j=0; jm_diff3WrapLineVector[wrapLineIdx]; - d3wl.diff3LineIndex = i; - d3wl.pD3L = (*d->m_pDiff3LineVector)[i]; - if ( j>=linesNeeded ) - { - d3wl.wrapLineOffset=0; - d3wl.wrapLineLength=0; - } - } - } - } - - if ( wrapLineVectorSize>0 ) - { - d->m_firstLine = min2( d->m_firstLine, wrapLineVectorSize-1 ); - d->m_firstColumn = 0; - d->m_pDiffTextWindowFrame->setFirstLine( d->m_firstLine ); - } - } - else - { - d->m_diff3WrapLineVector.resize( 0 ); - } - - if ( !d->m_selection.isEmpty() && ( !d->m_bWordWrap || wrapLineVectorSize>0 ) ) - { - // Assume unwrapped coordinates - //( Why? ->Conversion to unwrapped coords happened a few lines above in this method. - // Also see KDiff3App::recalcWordWrap() on the role of wrapLineVectorSize) - - // Wrap them now. - - // convert the d->m_selection to unwrapped coordinates. - int firstLine, firstPos; - convertD3LCoordsToLineCoords( d->m_selection.beginLine(), d->m_selection.beginPos(), firstLine, firstPos ); - - int lastLine, lastPos; - convertD3LCoordsToLineCoords( d->m_selection.endLine(), d->m_selection.endPos(), lastLine, lastPos ); - - //d->m_selection.reset(); - d->m_selection.start( firstLine, convertToPosOnScreen( d->getLineString( firstLine ), firstPos, d->m_pOptionDialog->m_tabSize ) ); - d->m_selection.end( lastLine, convertToPosOnScreen( d->getLineString( lastLine ),lastPos, d->m_pOptionDialog->m_tabSize ) ); - } -} - - -class DiffTextWindowFrameData -{ -public: - DiffTextWindow* m_pDiffTextWindow; - QLineEdit* m_pFileSelection; - QPushButton* m_pBrowseButton; - OptionDialog* m_pOptionDialog; - QLabel* m_pLabel; - QLabel* m_pTopLine; - QWidget* m_pTopLineWidget; -}; - -DiffTextWindowFrame::DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ) - : QWidget( pParent ) -{ - d = new DiffTextWindowFrameData; - d->m_pOptionDialog = pOptionDialog; - d->m_pTopLineWidget = new QWidget(this); - d->m_pFileSelection = new QLineEdit(d->m_pTopLineWidget); - d->m_pBrowseButton = new QPushButton( "...",d->m_pTopLineWidget ); - d->m_pBrowseButton->setFixedWidth( 30 ); - connect(d->m_pBrowseButton,SIGNAL(clicked()), this, SLOT(slotBrowseButtonClicked())); - connect(d->m_pFileSelection,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); - - d->m_pLabel = new QLabel("A:",d->m_pTopLineWidget); - d->m_pTopLine = new QLabel(d->m_pTopLineWidget); - d->m_pDiffTextWindow = 0; - d->m_pDiffTextWindow = new DiffTextWindow( this, pStatusBar, pOptionDialog, winIdx ); - Q3HBoxLayout* pHL = new Q3HBoxLayout(d->m_pTopLineWidget); - pHL->setMargin(2); - pHL->setSpacing(2); - - pHL->addWidget( d->m_pLabel, 0 ); - pHL->addWidget( d->m_pFileSelection, 1 ); - pHL->addWidget( d->m_pBrowseButton, 0 ); - pHL->addWidget( d->m_pTopLine, 0 ); - - Q3VBoxLayout* pVL = new Q3VBoxLayout( this, 0, 0 ); - pVL->addWidget( d->m_pTopLineWidget, 0 ); - pVL->addWidget( d->m_pDiffTextWindow, 1 ); - - d->m_pDiffTextWindow->installEventFilter( this ); - d->m_pFileSelection->installEventFilter( this ); - d->m_pBrowseButton->installEventFilter( this ); - init(); -} - -DiffTextWindowFrame::~DiffTextWindowFrame() -{ - delete d; -} - -void DiffTextWindowFrame::init() -{ - DiffTextWindow* pDTW = d->m_pDiffTextWindow; - if ( pDTW ) - { - QString s = pDTW->d->m_filename ; - d->m_pFileSelection->setText( s ); - QString winId = pDTW->d->m_winIdx==1 ? - ( pDTW->d->m_bTriple?"A (Base)":"A") : - ( pDTW->d->m_winIdx==2 ? "B" : "C" ); - d->m_pLabel->setText( winId + ":" ); - } -} - -// Search for the first visible line (search loop needed when no line exist for this file.) -int DiffTextWindow::calcTopLineInFile( int firstLine ) -{ - int l=-1; - for ( int i = convertLineToDiff3LineIdx(firstLine); i<(int)d->m_pDiff3LineVector->size(); ++i ) - { - const Diff3Line* d3l = (*d->m_pDiff3LineVector)[i]; - l = d3l->getLineInFile(d->m_winIdx); - if (l!=-1) break; - } - return l; -} - -void DiffTextWindowFrame::setFirstLine( int firstLine ) -{ - DiffTextWindow* pDTW = d->m_pDiffTextWindow; - if ( pDTW && pDTW->d->m_pDiff3LineVector ) - { - QString s= i18n("Top line"); - int lineNumberWidth = (int)log10((double)pDTW->d->m_size)+1; - - int l=pDTW->calcTopLineInFile(firstLine); - - int w = d->m_pTopLine->fontMetrics().width( - s+" "+QString().fill('0',lineNumberWidth)); - d->m_pTopLine->setMinimumWidth( w ); - - if (l==-1) - s = i18n("End"); - else - s += " " + QString::number( l+1 ); - - d->m_pTopLine->setText( s ); - d->m_pTopLine->repaint(); - } -} - -DiffTextWindow* DiffTextWindowFrame::getDiffTextWindow() -{ - return d->m_pDiffTextWindow; -} - -bool DiffTextWindowFrame::eventFilter( QObject* o, QEvent* e ) -{ - DiffTextWindow* pDTW = d->m_pDiffTextWindow; - if ( e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut ) - { - QColor c1 = d->m_pOptionDialog->m_bgColor; - QColor c2 = pDTW->d->m_cThis; - QPalette p = d->m_pTopLineWidget->palette(); - if ( e->type()==QEvent::FocusOut ) - std::swap(c1,c2); - - p.setColor(QPalette::Window, c2); - setPalette( p ); - - p.setColor(QPalette::WindowText, c1); - d->m_pLabel->setPalette( p ); - d->m_pTopLine->setPalette( p ); - } - if (o == d->m_pFileSelection && e->type()==QEvent::Drop) - { - QDropEvent* d = static_cast(e); - - if ( Q3UriDrag::canDecode( d ) ) - { - QStringList lst; - Q3UriDrag::decodeLocalFiles( d, lst ); - - if ( lst.count() > 0 ) - { - static_cast(o)->setText( lst[0] ); - static_cast(o)->setFocus(); - emit fileNameChanged( lst[0], pDTW->d->m_winIdx ); - return true; - } - } - /* The following lines work for Qt>4.1 but not for 4.0.x*/ - /*if ( d->mimeData()->hasUrls() ) - { - QList lst = d->mimeData()->urls(); - if ( !lst.empty() ) - { - static_cast(o)->setText( lst[0].toLocalFile() ); - static_cast(o)->setFocus(); - emit fileNameChanged( lst[0], pDTW->d->m_winIdx ); - return true; - } - }*/ - } - return false; -} - -void DiffTextWindowFrame::paintEvent(QPaintEvent*) -{ - QPainter p(this); - p.fillRect( rect(), palette().window() ); -} - -void DiffTextWindowFrame::slotReturnPressed() -{ - DiffTextWindow* pDTW = d->m_pDiffTextWindow; - if ( pDTW->d->m_filename != d->m_pFileSelection->text() ) - { - emit fileNameChanged( d->m_pFileSelection->text(), pDTW->d->m_winIdx ); - } -} - -void DiffTextWindowFrame::slotBrowseButtonClicked() -{ - QString current = d->m_pFileSelection->text(); - - KURL newURL = KFileDialog::getOpenURL( current, 0, this); - if ( !newURL.isEmpty() ) - { - DiffTextWindow* pDTW = d->m_pDiffTextWindow; - emit fileNameChanged( newURL.url(), pDTW->d->m_winIdx ); - } -} - -Q3CString encodeString( const QString& s ) -{ - QTextCodec* c = QTextCodec::codecForLocale(); - if (c!=0) - return c->fromUnicode( s ); - else - return Q3CString( s.latin1() ); -} - -//#include "difftextwindow.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/difftextwindow.h --- a/kdiff3/src/difftextwindow.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/*************************************************************************** - difftextwindow.h - description - ------------------- - begin : Mon Mar 18 2002 - copyright : (C) 2002-2005 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DIFFTEXTWINDOW_H -#define DIFFTEXTWINDOW_H - -#include "diff.h" - -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include - -class QStatusBar; -class OptionDialog; -class DiffTextWindowData; -class DiffTextWindowFrame; - -class DiffTextWindow : public QWidget -{ - Q_OBJECT -public: - DiffTextWindow( - DiffTextWindowFrame* pParent, - QStatusBar* pStatusBar, - OptionDialog* pOptionDialog, - int winIdx - ); - ~DiffTextWindow(); - void init( - const QString& fileName, - const LineData* pLineData, - int size, - const Diff3LineVector* pDiff3LineVector, - const ManualDiffHelpList* pManualDiffHelpList, - bool bTriple - ); - void reset(); - void convertToLinePos( int x, int y, int& line, int& pos ); - - QString getSelection(); - int getFirstLine(); - int calcTopLineInFile( int firstLine ); - - int getNofColumns(); - int getNofLines(); - int getNofVisibleLines(); - int getNofVisibleColumns(); - - int convertLineToDiff3LineIdx( int line ); - int convertDiff3LineIdxToLine( int d3lIdx ); - - void convertD3LCoordsToLineCoords( int d3LIdx, int d3LPos, int& line, int& pos ); - void convertLineCoordsToD3LCoords( int line, int pos, int& d3LIdx, int& d3LPos ); - - void convertSelectionToD3LCoords(); - - bool findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); - void setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p ); - void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType ); - - void setPaintingAllowed( bool bAllowPainting ); - void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns ); - void print( MyPainter& painter, const QRect& r, int firstLine, int nofLinesPerPage ); -signals: - void resizeSignal( int nofVisibleColumns, int nofVisibleLines ); - void scroll( int deltaX, int deltaY ); - void newSelection(); - void selectionEnd(); - void setFastSelectorLine( int line ); - void gotFocus(); - void lineClicked( int winIdx, int line ); - -public slots: - void setFirstLine( int line ); - void setFirstColumn( int col ); - void resetSelection(); - void setFastSelectorRange( int line1, int nofLines ); - -protected: - virtual void mousePressEvent ( QMouseEvent * ); - virtual void mouseReleaseEvent ( QMouseEvent * ); - virtual void mouseMoveEvent ( QMouseEvent * ); - virtual void mouseDoubleClickEvent ( QMouseEvent * e ); - - virtual void paintEvent( QPaintEvent* ); - virtual void dragEnterEvent( QDragEnterEvent* e ); - virtual void focusInEvent( QFocusEvent* e ); - - virtual void resizeEvent( QResizeEvent* ); - virtual void timerEvent(QTimerEvent*); - -private: - DiffTextWindowData* d; - void showStatusLine( int line ); - friend class DiffTextWindowFrame; -}; - - -class DiffTextWindowFrameData; - -class DiffTextWindowFrame : public QWidget -{ - Q_OBJECT -public: - DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ); - ~DiffTextWindowFrame(); - DiffTextWindow* getDiffTextWindow(); - void init(); - void setFirstLine(int firstLine); -signals: - void fileNameChanged(const QString&, int); -protected: - bool eventFilter( QObject*, QEvent* ); - void paintEvent(QPaintEvent*); -private slots: - void slotReturnPressed(); - void slotBrowseButtonClicked(); -private: - DiffTextWindowFrameData* d; -}; - - -#endif - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/directorymergewindow.cpp --- a/kdiff3/src/directorymergewindow.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2989 +0,0 @@ -/*************************************************************************** - directorymergewindow.cpp - ----------------- - begin : Sat Oct 19 2002 - copyright : (C) 2002-2005 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "directorymergewindow.h" -#include "optiondialog.h" -#include -#include - -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include - -static bool conflictingFileTypes(MergeFileInfos& mfi); -/* -class StatusInfo : public QListView -{ -public: - StatusInfo(QWidget* pParent) : QListView( pParent, "StatusInfo", Qt::WShowModal ) - { - addColumn(""); - setSorting(-1); //disable sorting - } - - QListViewItem* m_pLast; - QListViewItem* last() - { - if (firstChild()==0) return 0; - else return m_pLast; - } - - void addText(const QString& s ) - { - if (firstChild()==0) m_pLast = new QListViewItem( this, s ); - else m_pLast = new QListViewItem( this, last(), s ); - } -}; -*/ -class StatusInfo : public Q3TextEdit -{ -public: - StatusInfo(QWidget* pParent) : Q3TextEdit( pParent, "StatusInfo" ) - { - setWindowFlags(Qt::Dialog); - setWordWrap(Q3TextEdit::NoWrap); - setReadOnly(true); - showMaximized(); - } - - bool isEmpty(){ return text().isEmpty(); } - - void addText(const QString& s ) - { - append(s); - } - - void show() - { - scrollToBottom(); - Q3TextEdit::show(); - } -}; - - -class TempRemover -{ -public: - TempRemover( const QString& origName, FileAccess& fa ); - ~TempRemover(); - QString name() { return m_name; } - bool success() { return m_bSuccess; } -private: - QString m_name; - bool m_bTemp; - bool m_bSuccess; -}; -TempRemover::TempRemover(const QString& origName, FileAccess& fa) -{ - if ( fa.isLocal() ) - { - m_name = origName; - m_bTemp = false; - m_bSuccess = true; - } - else - { - m_name = FileAccess::tempFileName(); - m_bSuccess = fa.copyFile( m_name ); - m_bTemp = m_bSuccess; - } -} -TempRemover::~TempRemover() -{ - if ( m_bTemp && ! m_name.isEmpty() ) - FileAccess::removeTempFile(m_name); -} - -void DirectoryMergeWindow::fastFileComparison( - FileAccess& fi1, FileAccess& fi2, - bool& bEqual, bool& bError, QString& status ) -{ - ProgressProxy pp; - status = ""; - bEqual = false; - bError = true; - - if ( !m_bFollowFileLinks ) - { - if ( fi1.isSymLink() != fi2.isSymLink() ) - { - status = i18n("Mix of links and normal files."); - return; - } - else if ( fi1.isSymLink() && fi2.isSymLink() ) - { - bError = false; - bEqual = fi1.readLink() == fi2.readLink(); - status = i18n("Link: "); - return; - } - } - - if ( fi1.size()!=fi2.size() ) - { - bEqual = false; - status = i18n("Size. "); - return; - } - else if ( m_pOptions->m_bDmTrustSize ) - { - bEqual = true; - return; - } - - if ( m_pOptions->m_bDmTrustDate ) - { - bEqual = ( fi1.lastModified() == fi2.lastModified() && fi1.size()==fi2.size() ); - bError = false; - status = i18n("Date & Size: "); - return; - } - - QString fileName1 = fi1.absFilePath(); - QString fileName2 = fi2.absFilePath(); - TempRemover tr1( fileName1, fi1 ); - if ( !tr1.success() ) - { - status = i18n("Creating temp copy of %1 failed.").arg(fileName1); - return; - } - TempRemover tr2( fileName2, fi2 ); - if ( !tr2.success() ) - { - status = i18n("Creating temp copy of %1 failed.").arg(fileName2); - return; - } - - std::vector buf1(100000); - std::vector buf2(buf1.size()); - - QFile file1( tr1.name() ); - - if ( ! file1.open(QIODevice::ReadOnly) ) - { - status = i18n("Opening %1 failed.").arg(fileName1); - return; - } - - QFile file2( tr2.name() ); - - if ( ! file2.open(QIODevice::ReadOnly) ) - { - status = i18n("Opening %1 failed.").arg(fileName2); - return; - } - - pp.setInformation( i18n("Comparing file..."), 0, false ); - typedef QFile::Offset t_FileSize; - t_FileSize fullSize = file1.size(); - t_FileSize sizeLeft = fullSize; - - while( sizeLeft>0 && ! pp.wasCancelled() ) - { - int len = min2( sizeLeft, (t_FileSize)buf1.size() ); - if( len != file1.readBlock( &buf1[0], len ) ) - { - status = i18n("Error reading from %1").arg(fileName1); - return; - } - - if( len != file2.readBlock( &buf2[0], len ) ) - { - status = i18n("Error reading from %1").arg(fileName2); - return; - } - - if ( memcmp( &buf1[0], &buf2[0], len ) != 0 ) - { - bError = false; - return; - } - sizeLeft-=len; - pp.setCurrent(double(fullSize-sizeLeft)/fullSize, false ); - } - - // If the program really arrives here, then the files are really equal. - bError = false; - bEqual = true; -} - - - - - -static int s_nameCol = 0; -static int s_ACol = 1; -static int s_BCol = 2; -static int s_CCol = 3; -static int s_OpCol = 4; -static int s_OpStatusCol = 5; -static int s_UnsolvedCol = 6; // Nr of unsolved conflicts (for 3 input files) -static int s_SolvedCol = 7; // Nr of auto-solvable conflicts (for 3 input files) -static int s_NonWhiteCol = 8; // Nr of nonwhite deltas (for 2 input files) -static int s_WhiteCol = 9; // Nr of white deltas (for 2 input files) -DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ) - : Q3ListView( pParent ) -{ - 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; - m_bAllowResizeEvents = true; - m_bSimulatedMergeStarted=false; - m_bRealMergeStarted=false; - m_bError = false; - m_bSyncMode = false; - m_pStatusInfo = new StatusInfo(0); - m_pStatusInfo->hide(); - m_bScanning = false; - m_pSelection1Item = 0; - m_pSelection2Item = 0; - m_pSelection3Item = 0; - m_bCaseSensitive = true; - - addColumn(i18n("Name")); - addColumn("A"); - addColumn("B"); - addColumn("C"); - addColumn(i18n("Operation")); - addColumn(i18n("Status")); - addColumn(i18n("Unsolved")); - addColumn(i18n("Solved")); - addColumn(i18n("Nonwhite")); - addColumn(i18n("White")); - - setColumnAlignment( s_UnsolvedCol, Qt::AlignRight ); - setColumnAlignment( s_SolvedCol, Qt::AlignRight ); - setColumnAlignment( s_NonWhiteCol, Qt::AlignRight ); - setColumnAlignment( s_WhiteCol, Qt::AlignRight ); -} - -DirectoryMergeWindow::~DirectoryMergeWindow() -{ -} - - -int DirectoryMergeWindow::totalColumnWidth() -{ - int w=0; - for (int i=0; iconvertToImage().convertDepth(32); - QImage img2 = pm2->convertToImage().convertDepth(32); - - for (int y = 0; y < img1.height(); y++) - { - Q_UINT32 *line1 = reinterpret_cast(img1.scanLine(y)); - Q_UINT32 *line2 = reinterpret_cast(img2.scanLine(y)); - for (int x = 0; x < img1.width(); x++) - { - if ( qAlpha( line2[x] ) >0 ) - line1[x] = (line2[x] | 0xff000000); - } - } - QPixmap pix; - pix.convertFromImage(img1); - return pix; -} - -// like pixCombiner but let the pm1 color shine through -static QPixmap pixCombiner2( const QPixmap* pm1, const QPixmap* pm2 ) -{ - QImage img1 = pm1->convertToImage().convertDepth(32); - QImage img2 = pm2->convertToImage().convertDepth(32); - - for (int y = 0; y < img1.height(); y++) - { - Q_UINT32 *line1 = reinterpret_cast(img1.scanLine(y)); - Q_UINT32 *line2 = reinterpret_cast(img2.scanLine(y)); - for (int x = 0; x < img1.width(); x++) - { - if ( qAlpha( line2[x] ) >0 ) - { - int r = ( qRed( line1[x] ) + qRed( line2[x] ))/2; - int g = ( qGreen( line1[x] ) + qGreen( line2[x] ))/2; - int b = ( qBlue( line1[x] ) + qBlue( line2[x] ))/2; - line1[x] = qRgba( r,g,b, 0xff ); - } - } - } - QPixmap pix; - pix.convertFromImage(img1); - return pix; -} - -static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles, - int& nofDirs, int& nofEqualFiles, int& nofManualMerges ) -{ - if ( i->m_pMFI->m_bDirA || i->m_pMFI->m_bDirB || i->m_pMFI->m_bDirC ) - { - ++nofDirs; - } - else - { - ++nofFiles; - if ( i->m_pMFI->m_bEqualAB && (!bThreeDirs || i->m_pMFI->m_bEqualAC )) - { - ++nofEqualFiles; - } - else - { - if ( i->m_pMFI->m_eMergeOperation==eMergeABCToDest || i->m_pMFI->m_eMergeOperation==eMergeABToDest ) - ++nofManualMerges; - } - } - for( Q3ListViewItem* p = i->firstChild(); p!=0; p = p->nextSibling() ) - calcDirStatus( bThreeDirs, static_cast(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); -} - -static QString sortString(const QString& s, bool bCaseSensitive) -{ - if (bCaseSensitive) - return s; - else - return s.upper(); -} - -bool DirectoryMergeWindow::init - ( - FileAccess& dirA, - FileAccess& dirB, - FileAccess& dirC, - FileAccess& dirDest, - bool bDirectoryMerge - ) -{ - if ( m_pOptions->m_bDmFullAnalysis ) - { - // 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; - m_bFollowDirLinks = m_pOptions->m_bDmFollowDirLinks; - m_bFollowFileLinks = m_pOptions->m_bDmFollowFileLinks; - m_bSimulatedMergeStarted=false; - m_bRealMergeStarted=false; - m_bError=false; - m_bDirectoryMerge = bDirectoryMerge; - m_pSelection1Item = 0; - m_pSelection2Item = 0; - m_pSelection3Item = 0; - m_bCaseSensitive = m_pOptions->m_bDmCaseSensitiveFilenameComparison; - - clear(); - - m_mergeItemList.clear(); - m_currentItemForOperation = m_mergeItemList.end(); - - m_dirA = dirA; - m_dirB = dirB; - m_dirC = dirC; - m_dirDest = dirDest; - - m_pDirShowIdenticalFiles->setChecked(true); - m_pDirShowDifferentFiles->setChecked(true); - m_pDirShowFilesOnlyInA->setChecked(true); - m_pDirShowFilesOnlyInB->setChecked(true); - m_pDirShowFilesOnlyInC->setChecked(true); - - // Check if all input directories exist and are valid. The dest dir is not tested now. - // The test will happen only when we are going to write to it. - if ( !m_dirA.isDir() || !m_dirB.isDir() || - (m_dirC.isValid() && !m_dirC.isDir()) ) - { - QString text( i18n("Opening of directories failed:") ); - text += "\n\n"; - if ( !dirA.isDir() ) - { text += i18n("Dir A \"%1\" does not exist or is not a directory.\n").arg(m_dirA.prettyAbsPath()); } - - if ( !dirB.isDir() ) - { text += i18n("Dir B \"%1\" does not exist or is not a directory.\n").arg(m_dirB.prettyAbsPath()); } - - if ( m_dirC.isValid() && !m_dirC.isDir() ) - { text += i18n("Dir C \"%1\" does not exist or is not a directory.\n").arg(m_dirC.prettyAbsPath()); } - - KMessageBox::sorry( this, text, i18n("Directory Open Error") ); - return false; - } - - if ( m_dirC.isValid() && - (m_dirDest.prettyAbsPath() == m_dirA.prettyAbsPath() || m_dirDest.prettyAbsPath()==m_dirB.prettyAbsPath() ) ) - { - KMessageBox::error(this, - i18n( "The destination directory must not be the same as A or B when " - "three directories are merged.\nCheck again before continuing."), - i18n("Parameter Warning")); - return false; - } - - m_bScanning = true; - statusBarMessage(i18n("Scanning directories...")); - - m_bSyncMode = m_pOptions->m_bDmSyncMode && !m_dirC.isValid() && !m_dirDest.isValid(); - - if ( m_dirDest.isValid() ) - m_dirDestInternal = m_dirDest; - else - m_dirDestInternal = m_dirC.isValid() ? m_dirC : m_dirB; - - QString origCurrentDirectory = QDir::currentDirPath(); - - m_fileMergeMap.clear(); - t_DirectoryList::iterator i; - - // calc how many directories will be read: - double nofScans = ( m_dirA.isValid() ? 1 : 0 )+( m_dirB.isValid() ? 1 : 0 )+( m_dirC.isValid() ? 1 : 0 ); - int currentScan = 0; - - 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 ); - setColumnWidth( s_NonWhiteCol, 0 ); - setColumnWidth( s_UnsolvedCol, 0 ); - setColumnWidth( s_SolvedCol, 0 ); - } - else if ( m_dirC.isValid() ) - { - setColumnWidth(s_WhiteCol, 50 ); - setColumnWidth(s_NonWhiteCol, 50 ); - setColumnWidth(s_UnsolvedCol, 50 ); - setColumnWidth(s_SolvedCol, 50 ); - } - else - { - setColumnWidth(s_WhiteCol, 50 ); - setColumnWidth(s_NonWhiteCol, 50 ); - setColumnWidth(s_UnsolvedCol, 50 ); - setColumnWidth(s_SolvedCol, 0 ); - } - - bool bListDirSuccessA = true; - bool bListDirSuccessB = true; - bool bListDirSuccessC = true; - if ( m_dirA.isValid() ) - { - pp.setInformation(i18n("Reading Directory A")); - pp.setSubRangeTransformation(currentScan/nofScans, (currentScan+1)/nofScans); - ++currentScan; - - t_DirectoryList dirListA; - bListDirSuccessA = m_dirA.listDir( &dirListA, - m_pOptions->m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, - m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, - m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, - m_pOptions->m_bDmUseCvsIgnore); - - for (i=dirListA.begin(); i!=dirListA.end();++i ) - { - MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(), m_bCaseSensitive)]; - //std::cout <filePath()<m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, - m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, - m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, - m_pOptions->m_bDmUseCvsIgnore); - - for (i=dirListB.begin(); i!=dirListB.end();++i ) - { - MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(), m_bCaseSensitive)]; - mfi.m_bExistsInB = true; - mfi.m_fileInfoB = *i; - } - } - - e_MergeOperation eDefaultMergeOp; - if ( m_dirC.isValid() ) - { - pp.setInformation(i18n("Reading Directory C")); - pp.setSubRangeTransformation(currentScan/nofScans, (currentScan+1)/nofScans); - ++currentScan; - - t_DirectoryList dirListC; - bListDirSuccessC = m_dirC.listDir( &dirListC, - m_pOptions->m_bDmRecursiveDirs, m_pOptions->m_bDmFindHidden, - m_pOptions->m_DmFilePattern, m_pOptions->m_DmFileAntiPattern, - m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks, - m_pOptions->m_bDmUseCvsIgnore); - - for (i=dirListC.begin(); i!=dirListC.end();++i ) - { - MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath(),m_bCaseSensitive)]; - mfi.m_bExistsInC = true; - mfi.m_fileInfoC = *i; - } - - eDefaultMergeOp = eMergeABCToDest; - } - else - eDefaultMergeOp = m_bSyncMode ? eMergeToAB : eMergeABToDest; - - bool bContinue = true; - if ( !bListDirSuccessA || !bListDirSuccessB || !bListDirSuccessC ) - { - QString s = i18n("Some subdirectories were not readable in"); - if ( !bListDirSuccessA ) s += "\nA: " + m_dirA.prettyAbsPath(); - if ( !bListDirSuccessB ) s += "\nB: " + m_dirB.prettyAbsPath(); - if ( !bListDirSuccessC ) s += "\nC: " + m_dirC.prettyAbsPath(); - s+="\n"; - s+= i18n("Check the permissions of the subdirectories."); - bContinue = KMessageBox::Continue == KMessageBox::warningContinueCancel( this, s ); - } - - if ( bContinue ) - { - prepareListView(pp); - - for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) - { - DirMergeItem* pDMI = static_cast( p ); - calcSuggestedOperation( *pDMI->m_pMFI, eDefaultMergeOp ); - } - } - else - { - setSelected( 0, true ); - } - - QDir::setCurrent(origCurrentDirectory); - - // Try to improve the view a little bit. - QWidget* pParent = parentWidget(); - QSplitter* pSplitter = static_cast(pParent); - if (pSplitter!=0) - { - Q3ValueList sizes = pSplitter->sizes(); - int total = sizes[0] + sizes[1]; - sizes[0]=total*6/10; - sizes[1]=total - sizes[0]; - pSplitter->setSizes( sizes ); - } - - m_bScanning = false; - statusBarMessage(i18n("Ready.")); - - if ( bContinue ) - { - // Generate a status report - int nofFiles=0; - int nofDirs=0; - int nofEqualFiles=0; - int nofManualMerges=0; - for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) - calcDirStatus( m_dirC.isValid(), static_cast(p), - nofFiles, nofDirs, nofEqualFiles, nofManualMerges ); - - QString s; - s = i18n("Directory Comparison Status") + "\n\n" + - i18n("Number of subdirectories:") +" "+ QString::number(nofDirs) + "\n"+ - i18n("Number of equal files:") +" "+ QString::number(nofEqualFiles) + "\n"+ - i18n("Number of different files:") +" "+ QString::number(nofFiles-nofEqualFiles); - - if ( m_dirC.isValid() ) - s += "\n" + i18n("Number of manual merges:") +" "+ QString::number(nofManualMerges); - KMessageBox::information( this, s ); - setSelected( firstChild(), true ); - } - - return true; -} - - - -void DirectoryMergeWindow::slotChooseAEverywhere(){ setAllMergeOperations( eCopyAToDest ); } - -void DirectoryMergeWindow::slotChooseBEverywhere(){ setAllMergeOperations( eCopyBToDest ); } - -void DirectoryMergeWindow::slotChooseCEverywhere(){ setAllMergeOperations( eCopyCToDest ); } - -void DirectoryMergeWindow::slotAutoChooseEverywhere() -{ - e_MergeOperation eDefaultMergeOp = m_dirC.isValid() ? eMergeABCToDest : - m_bSyncMode ? eMergeToAB : eMergeABToDest; - setAllMergeOperations(eDefaultMergeOp ); -} - -void DirectoryMergeWindow::slotNoOpEverywhere(){ setAllMergeOperations(eNoOperation); } - -static void setListViewItemOpen( Q3ListViewItem* p, bool bOpen ) -{ - for( Q3ListViewItem* pChild = p->firstChild(); pChild!=0; pChild = pChild->nextSibling() ) - setListViewItemOpen( pChild, bOpen ); - - p->setOpen( bOpen ); -} - -void DirectoryMergeWindow::slotFoldAllSubdirs() -{ - for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) - setListViewItemOpen( p, false ); -} - -void DirectoryMergeWindow::slotUnfoldAllSubdirs() -{ - for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) - setListViewItemOpen( p, true ); -} - -static void setMergeOperation( Q3ListViewItem* pLVI, e_MergeOperation eMergeOp ) -{ - if ( pLVI==0 ) return; - - DirMergeItem* pDMI = static_cast(pLVI); - MergeFileInfos& mfi = *pDMI->m_pMFI; - - mfi.setMergeOperation(eMergeOp ); -} - -// Merge current item (merge mode) -void DirectoryMergeWindow::slotCurrentDoNothing() { setMergeOperation(currentItem(), eNoOperation ); } -void DirectoryMergeWindow::slotCurrentChooseA() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyAToB : eCopyAToDest ); } -void DirectoryMergeWindow::slotCurrentChooseB() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyBToA : eCopyBToDest ); } -void DirectoryMergeWindow::slotCurrentChooseC() { setMergeOperation(currentItem(), eCopyCToDest ); } -void DirectoryMergeWindow::slotCurrentMerge() -{ - bool bThreeDirs = m_dirC.isValid(); - setMergeOperation(currentItem(), bThreeDirs ? eMergeABCToDest : eMergeABToDest ); -} -void DirectoryMergeWindow::slotCurrentDelete() { setMergeOperation(currentItem(), eDeleteFromDest ); } -// Sync current item -void DirectoryMergeWindow::slotCurrentCopyAToB() { setMergeOperation(currentItem(), eCopyAToB ); } -void DirectoryMergeWindow::slotCurrentCopyBToA() { setMergeOperation(currentItem(), eCopyBToA ); } -void DirectoryMergeWindow::slotCurrentDeleteA() { setMergeOperation(currentItem(), eDeleteA ); } -void DirectoryMergeWindow::slotCurrentDeleteB() { setMergeOperation(currentItem(), eDeleteB ); } -void DirectoryMergeWindow::slotCurrentDeleteAAndB() { setMergeOperation(currentItem(), eDeleteAB ); } -void DirectoryMergeWindow::slotCurrentMergeToA() { setMergeOperation(currentItem(), eMergeToA ); } -void DirectoryMergeWindow::slotCurrentMergeToB() { setMergeOperation(currentItem(), eMergeToB ); } -void DirectoryMergeWindow::slotCurrentMergeToAAndB() { setMergeOperation(currentItem(), eMergeToAB ); } - - -void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e ) -{ - if ( (e->state() & Qt::ControlModifier)!=0 ) - { - bool bThreeDirs = m_dirC.isValid(); - - Q3ListViewItem* lvi = currentItem(); - DirMergeItem* pDMI = lvi==0 ? 0 : static_cast(lvi); - MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; - - if ( pMFI==0 ) return; - bool bMergeMode = bThreeDirs || !m_bSyncMode; - bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI); - - if ( bMergeMode ) - { - switch(e->key()) - { - 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; - } - } - else - { - switch(e->key()) - { - 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; - default: break; - } - } - } - - Q3ListView::keyPressEvent(e); -} - -void DirectoryMergeWindow::focusInEvent(QFocusEvent*) -{ - updateAvailabilities(); -} -void DirectoryMergeWindow::focusOutEvent(QFocusEvent*) -{ - updateAvailabilities(); -} - -void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOperation ) -{ - if ( KMessageBox::Yes == KMessageBox::warningYesNo(this, - i18n("This affects all merge operations."), - i18n("Changing All Merge Operations"),i18n("C&ontinue"), i18n("&Cancel") ) ) - { - for( Q3ListViewItem* p = firstChild(); p!=0; p = p->nextSibling() ) - { - DirMergeItem* pDMI = static_cast( p ); - calcSuggestedOperation( *pDMI->m_pMFI, eDefaultOperation ); - } - } -} - - -void DirectoryMergeWindow::compareFilesAndCalcAges( MergeFileInfos& mfi ) -{ - std::map dateMap; - - if( mfi.m_bExistsInA ) - { - mfi.m_bLinkA = mfi.m_fileInfoA.isSymLink(); - mfi.m_bDirA = mfi.m_fileInfoA.isDir(); - dateMap[ mfi.m_fileInfoA.lastModified() ] = 0; - } - if( mfi.m_bExistsInB ) - { - mfi.m_bLinkB = mfi.m_fileInfoB.isSymLink(); - mfi.m_bDirB = mfi.m_fileInfoB.isDir(); - dateMap[ mfi.m_fileInfoB.lastModified() ] = 1; - } - if( mfi.m_bExistsInC ) - { - mfi.m_bLinkC = mfi.m_fileInfoC.isSymLink(); - mfi.m_bDirC = mfi.m_fileInfoC.isDir(); - dateMap[ mfi.m_fileInfoC.lastModified() ] = 2; - } - - if ( m_pOptions->m_bDmFullAnalysis ) - { - if( mfi.m_bExistsInA && mfi.m_bDirA || mfi.m_bExistsInB && mfi.m_bDirB || mfi.m_bExistsInC && mfi.m_bDirC ) - { - // If any input is a directory, don't start any comparison. - mfi.m_bEqualAB=mfi.m_bExistsInA && mfi.m_bExistsInB; - mfi.m_bEqualAC=mfi.m_bExistsInA && mfi.m_bExistsInC; - mfi.m_bEqualBC=mfi.m_bExistsInB && mfi.m_bExistsInC; - } - else - { - emit startDiffMerge( - mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), - mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), - mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), - "", - "","","",&mfi.m_totalDiffStatus - ); - 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 ) - { - if( mfi.m_bDirA ) mfi.m_bEqualAB=true; - else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoB, mfi.m_bEqualAB, bError, eqStatus ); - } - if( mfi.m_bExistsInA && mfi.m_bExistsInC ) - { - if( mfi.m_bDirA ) mfi.m_bEqualAC=true; - else fastFileComparison( mfi.m_fileInfoA, mfi.m_fileInfoC, mfi.m_bEqualAC, bError, eqStatus ); - } - if( mfi.m_bExistsInB && mfi.m_bExistsInC ) - { - if (mfi.m_bEqualAB && mfi.m_bEqualAC) - mfi.m_bEqualBC = true; - else - { - if( mfi.m_bDirB ) mfi.m_bEqualBC=true; - else fastFileComparison( mfi.m_fileInfoB, mfi.m_fileInfoC, mfi.m_bEqualBC, bError, eqStatus ); - } - } - } - - if (mfi.m_bLinkA!=mfi.m_bLinkB) mfi.m_bEqualAB=false; - if (mfi.m_bLinkA!=mfi.m_bLinkC) mfi.m_bEqualAC=false; - if (mfi.m_bLinkB!=mfi.m_bLinkC) mfi.m_bEqualBC=false; - - if (mfi.m_bDirA!=mfi.m_bDirB) mfi.m_bEqualAB=false; - if (mfi.m_bDirA!=mfi.m_bDirC) mfi.m_bEqualAC=false; - if (mfi.m_bDirB!=mfi.m_bDirC) mfi.m_bEqualBC=false; - - assert(eNew==0 && eMiddle==1 && eOld==2); - - // The map automatically sorts the keys. - int age = eNew; - std::map::reverse_iterator i; - for( i=dateMap.rbegin(); i!=dateMap.rend(); ++i ) - { - int n = i->second; - if ( n==0 && mfi.m_ageA==eNotThere ) - { - mfi.m_ageA = (e_Age)age; ++age; - if ( mfi.m_bEqualAB ) { mfi.m_ageB = mfi.m_ageA; ++age; } - if ( mfi.m_bEqualAC ) { mfi.m_ageC = mfi.m_ageA; ++age; } - } - else if ( n==1 && mfi.m_ageB==eNotThere ) - { - mfi.m_ageB = (e_Age)age; ++age; - if ( mfi.m_bEqualAB ) { mfi.m_ageA = mfi.m_ageB; ++age; } - if ( mfi.m_bEqualBC ) { mfi.m_ageC = mfi.m_ageB; ++age; } - } - else if ( n==2 && mfi.m_ageC==eNotThere) - { - mfi.m_ageC = (e_Age)age; ++age; - if ( mfi.m_bEqualAC ) { mfi.m_ageA = mfi.m_ageC; ++age; } - if ( mfi.m_bEqualBC ) { mfi.m_ageB = mfi.m_ageC; ++age; } - } - } - - // The checks below are necessary when the dates of the file are equal but the - // files are not. One wouldn't expect this to happen, yet it happens sometimes. - if ( mfi.m_bExistsInC && mfi.m_ageC==eNotThere ) - { - mfi.m_ageC = (e_Age)age; ++age; - mfi.m_bConflictingAges = true; - } - if ( mfi.m_bExistsInB && mfi.m_ageB==eNotThere ) - { - mfi.m_ageB = (e_Age)age; ++age; - mfi.m_bConflictingAges = true; - } - if ( mfi.m_bExistsInA && mfi.m_ageA==eNotThere ) - { - mfi.m_ageA = (e_Age)age; ++age; - mfi.m_bConflictingAges = true; - } - - if ( mfi.m_ageA != eOld && mfi.m_ageB != eOld && mfi.m_ageC != eOld ) - { - if (mfi.m_ageA == eMiddle) mfi.m_ageA = eOld; - if (mfi.m_ageB == eMiddle) mfi.m_ageB = eOld; - if (mfi.m_ageC == eMiddle) mfi.m_ageC = eOld; - } -} - -static QPixmap* s_pm_dir; -static QPixmap* s_pm_file; - -static QPixmap* pmNotThere; -static QPixmap* pmNew; -static QPixmap* pmOld; -static QPixmap* pmMiddle; - -static QPixmap* pmLink; - -static QPixmap* pmDirLink; -static QPixmap* pmFileLink; - -static QPixmap* pmNewLink; -static QPixmap* pmOldLink; -static QPixmap* pmMiddleLink; - -static QPixmap* pmNewDir; -static QPixmap* pmMiddleDir; -static QPixmap* pmOldDir; - -static QPixmap* pmNewDirLink; -static QPixmap* pmMiddleDirLink; -static QPixmap* pmOldDirLink; - - -static QPixmap colorToPixmap(QColor c) -{ - QPixmap pm(16,16); - QPainter p(&pm); - p.setPen( Qt::black ); - p.setBrush( c ); - p.drawRect(0,0,pm.width(),pm.height()); - return pm; -} - -static void initPixmaps( QColor newest, QColor oldest, QColor middle, QColor notThere ) -{ - if (pmNew==0) - { - pmNotThere = new QPixmap; - pmNew = new QPixmap; - pmOld = new QPixmap; - pmMiddle = new QPixmap; - - #include "xpm/link_arrow.xpm" - pmLink = new QPixmap(link_arrow); - - pmDirLink = new QPixmap; - pmFileLink = new QPixmap; - - pmNewLink = new QPixmap; - pmOldLink = new QPixmap; - pmMiddleLink = new QPixmap; - - pmNewDir = new QPixmap; - pmMiddleDir = new QPixmap; - pmOldDir = new QPixmap; - - pmNewDirLink = new QPixmap; - pmMiddleDirLink = new QPixmap; - pmOldDirLink = new QPixmap; - } - - - *pmNotThere = colorToPixmap(notThere); - *pmNew = colorToPixmap(newest); - *pmOld = colorToPixmap(oldest); - *pmMiddle = colorToPixmap(middle); - - *pmDirLink = pixCombiner( s_pm_dir, pmLink); - *pmFileLink = pixCombiner( s_pm_file, pmLink ); - - *pmNewLink = pixCombiner( pmNew, pmLink); - *pmOldLink = pixCombiner( pmOld, pmLink); - *pmMiddleLink = pixCombiner( pmMiddle, pmLink); - - *pmNewDir = pixCombiner2( pmNew, s_pm_dir); - *pmMiddleDir = pixCombiner2( pmMiddle, s_pm_dir); - *pmOldDir = pixCombiner2( pmOld, s_pm_dir); - - *pmNewDirLink = pixCombiner( pmNewDir, pmLink); - *pmMiddleDirLink = pixCombiner( pmMiddleDir, pmLink); - *pmOldDirLink = pixCombiner( pmOldDir, pmLink); -} - - -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 }; - static QPixmap* ageToPmDir[]= { pmNewDir, pmMiddleDir, pmOldDir, pmNotThere, s_pm_dir }; - static QPixmap* ageToPmDirLink[]={ pmNewDirLink, pmMiddleDirLink, pmOldDirLink, pmNotThere, pmDirLink }; - - QPixmap** ppPm = bDir ? ( bLink ? ageToPmDirLink : ageToPmDir ): - ( bLink ? ageToPmLink : ageToPm ); - - pLVI->setPixmap( col, *ppPm[eAge] ); -} - -static void setPixmaps( MergeFileInfos& mfi, bool bCheckC ) -{ - setOnePixmap( mfi.m_pDMI, s_nameCol, eAgeEnd, - mfi.m_bLinkA || mfi.m_bLinkB || mfi.m_bLinkC, - mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC - ); - - if ( mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC ) - { - mfi.m_ageA=eNotThere; - mfi.m_ageB=eNotThere; - mfi.m_ageC=eNotThere; - int age = eNew; - if ( mfi.m_bExistsInC ) - { - mfi.m_ageC = (e_Age)age; - if (mfi.m_bEqualAC) mfi.m_ageA = (e_Age)age; - if (mfi.m_bEqualBC) mfi.m_ageB = (e_Age)age; - ++age; - } - if ( mfi.m_bExistsInB && mfi.m_ageB==eNotThere ) - { - mfi.m_ageB = (e_Age)age; - if (mfi.m_bEqualAB) mfi.m_ageA = (e_Age)age; - ++age; - } - if ( mfi.m_bExistsInA && mfi.m_ageA==eNotThere ) - { - mfi.m_ageA = (e_Age)age; - } - if ( mfi.m_ageA != eOld && mfi.m_ageB != eOld && mfi.m_ageC != eOld ) - { - if (mfi.m_ageA == eMiddle) mfi.m_ageA = eOld; - if (mfi.m_ageB == eMiddle) mfi.m_ageB = eOld; - if (mfi.m_ageC == eMiddle) mfi.m_ageC = eOld; - } - } - - setOnePixmap( mfi.m_pDMI, s_ACol, mfi.m_ageA, mfi.m_bLinkA, mfi.m_bDirA ); - setOnePixmap( mfi.m_pDMI, s_BCol, mfi.m_ageB, mfi.m_bLinkB, mfi.m_bDirB ); - if ( bCheckC ) - setOnePixmap( mfi.m_pDMI, s_CCol, mfi.m_ageC, mfi.m_bLinkC, mfi.m_bDirC ); -} - -// Iterate through the complete tree. Start by specifying QListView::firstChild(). -static Q3ListViewItem* treeIterator( Q3ListViewItem* p, bool bVisitChildren=true, bool bFindInvisible=false ) -{ - if( p!=0 ) - { - do - { - if ( bVisitChildren && p->firstChild() != 0 ) p = p->firstChild(); - else if ( p->nextSibling() !=0 ) p = p->nextSibling(); - else - { - p = p->parent(); - while ( p!=0 ) - { - if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; } - else { p = p->parent(); } - } - } - } - while( p && !(p->isVisible() || bFindInvisible) ); - } - return p; -} - -void DirectoryMergeWindow::prepareListView( ProgressProxy& pp ) -{ - static bool bFirstTime = true; - if (bFirstTime) - { - #include "xpm/file.xpm" - #include "xpm/folder.xpm" - s_pm_dir = new QPixmap( m_pIconLoader->loadIcon("folder", KIcon::Small ) ); - if (s_pm_dir->size()!=QSize(16,16)) - { - delete s_pm_dir; - s_pm_dir = new QPixmap( folder_pm ); - } - s_pm_file= new QPixmap( file_pm ); - bFirstTime=false; - } - - clear(); - initPixmaps( m_pOptions->m_newestFileColor, m_pOptions->m_oldestFileColor, - m_pOptions->m_midAgeFileColor, m_pOptions->m_missingFileColor ); - - setRootIsDecorated( true ); - - bool bCheckC = m_dirC.isValid(); - - std::map::iterator j; - int nrOfFiles = m_fileMergeMap.size(); - int currentIdx = 1; - QTime t; - t.start(); - for( j=m_fileMergeMap.begin(); j!=m_fileMergeMap.end(); ++j ) - { - MergeFileInfos& mfi = j->second; - - mfi.m_subPath = mfi.m_fileInfoA.exists() ? mfi.m_fileInfoA.filePath() : - mfi.m_fileInfoB.exists() ? mfi.m_fileInfoB.filePath() : - mfi.m_fileInfoC.exists() ? mfi.m_fileInfoC.filePath() : - QString(""); - - // const QString& fileName = j->first; - const QString& fileName = mfi.m_subPath; - - pp.setInformation( - i18n("Processing ") + QString::number(currentIdx) +" / "+ QString::number(nrOfFiles) - +"\n" + fileName, double(currentIdx) / nrOfFiles, false ); - if ( pp.wasCancelled() ) break; - ++currentIdx; - - - // The comparisons and calculations for each file take place here. - compareFilesAndCalcAges( mfi ); - - bool bEqual = bCheckC ? mfi.m_bEqualAB && mfi.m_bEqualAC : mfi.m_bEqualAB; - //bool bDir = mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC; - - //if ( m_pOptions->m_bDmShowOnlyDeltas && !bDir && bEqual ) - // continue; - - // Get dirname from fileName: Search for "/" from end: - int pos = fileName.findRev('/'); - QString dirPart; - QString filePart; - if (pos==-1) - { - // Top dir - filePart = fileName; - } - else - { - dirPart = fileName.left(pos); - filePart = fileName.mid(pos+1); - } - - if ( dirPart.isEmpty() ) // Top level - { - new DirMergeItem( this, filePart, &mfi ); - } - else - { - MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart, m_bCaseSensitive)]; // parent - assert(dirMfi.m_pDMI!=0); - new DirMergeItem( dirMfi.m_pDMI, filePart, &mfi ); - mfi.m_pParent = &dirMfi; - - if ( !bEqual ) // Set all parents to "not equal" - { - MergeFileInfos* p = mfi.m_pParent; - while(p!=0) - { - bool bChange = false; - if ( !mfi.m_bEqualAB && p->m_bEqualAB ){ p->m_bEqualAB = false; bChange=true; } - if ( !mfi.m_bEqualAC && p->m_bEqualAC ){ p->m_bEqualAC = false; bChange=true; } - if ( !mfi.m_bEqualBC && p->m_bEqualBC ){ p->m_bEqualBC = false; bChange=true; } - - if ( bChange ) - setPixmaps( *p, bCheckC ); - else - break; - - p = p->m_pParent; - } - } - } - - setPixmaps( mfi, bCheckC ); - } - - /*if ( m_pOptions->m_bDmShowOnlyDeltas ) - { - // Remove all equals. (Search tree depth first) - QListViewItem* p = firstChild(); - while( p!=0 && firstChild() != 0 ) - { - QListViewItem* pParent = p->parent(); - QListViewItem* pNextSibling = p->nextSibling(); - - DirMergeItem* pDMI = static_cast(p); - bool bDirEqual = bCheckC ? pDMI->m_pMFI->m_bEqualAB && pDMI->m_pMFI->m_bEqualAC - : pDMI->m_pMFI->m_bEqualAB; - if ( pDMI!=0 && pDMI->m_pMFI->m_bDirA && bDirEqual ) - { - delete p; - p=0; - } - - if ( p!=0 && p->firstChild() != 0 ) p = p->firstChild(); - else if ( pNextSibling!=0 ) p = pNextSibling; - else - { - p=pParent; - while ( p!=0 ) - { - if( p->nextSibling()!=0 ) { p = p->nextSibling(); break; } - else { p = p->parent(); } - } - } - } - }*/ -} - -static bool conflictingFileTypes(MergeFileInfos& mfi) -{ - // Now check if file/dir-types fit. - if ( mfi.m_bLinkA || mfi.m_bLinkB || mfi.m_bLinkC ) - { - if ( mfi.m_bExistsInA && ! mfi.m_bLinkA || - mfi.m_bExistsInB && ! mfi.m_bLinkB || - mfi.m_bExistsInC && ! mfi.m_bLinkC ) - { - return true; - } - } - - if ( mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC ) - { - if ( mfi.m_bExistsInA && ! mfi.m_bDirA || - mfi.m_bExistsInB && ! mfi.m_bDirB || - mfi.m_bExistsInC && ! mfi.m_bDirC ) - { - return true; - } - } - return false; -} - -void DirectoryMergeWindow::calcSuggestedOperation( MergeFileInfos& mfi, e_MergeOperation eDefaultMergeOp ) -{ - bool bCheckC = m_dirC.isValid(); - bool bCopyNewer = m_pOptions->m_bDmCopyNewer; - - if ( eDefaultMergeOp == eMergeABCToDest && !bCheckC ) { eDefaultMergeOp = eMergeABToDest; } - if ( eDefaultMergeOp == eMergeToAB && bCheckC ) { assert(false); } - - if ( eDefaultMergeOp == eMergeToA || eDefaultMergeOp == eMergeToB || - eDefaultMergeOp == eMergeABCToDest || eDefaultMergeOp == eMergeABToDest || eDefaultMergeOp == eMergeToAB ) - { - if ( !bCheckC ) - { - if ( mfi.m_bEqualAB ) - { - mfi.setMergeOperation( eNoOperation ); // All is well, nothing to do. - } - else if ( mfi.m_bExistsInA && mfi.m_bExistsInB ) - { - if ( !bCopyNewer || mfi.m_bDirA ) - mfi.setMergeOperation( eDefaultMergeOp ); - else if ( bCopyNewer && mfi.m_bConflictingAges ) - { - mfi.setMergeOperation( eConflictingAges ); - } - else - { - if ( mfi.m_ageA == eNew ) - mfi.setMergeOperation( eDefaultMergeOp == eMergeToAB ? eCopyAToB : eCopyAToDest ); - else - mfi.setMergeOperation( eDefaultMergeOp == eMergeToAB ? eCopyBToA : eCopyBToDest ); - } - } - else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB ) - { - if ( eDefaultMergeOp==eMergeABToDest ) mfi.setMergeOperation( eCopyBToDest ); - else if ( eDefaultMergeOp==eMergeToB ) mfi.setMergeOperation( eNoOperation ); - else mfi.setMergeOperation( eCopyBToA ); - } - else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB ) - { - if ( eDefaultMergeOp==eMergeABToDest ) mfi.setMergeOperation( eCopyAToDest ); - else if ( eDefaultMergeOp==eMergeToA ) mfi.setMergeOperation( eNoOperation ); - else mfi.setMergeOperation( eCopyAToB ); - } - else //if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB ) - { - mfi.setMergeOperation( eNoOperation ); assert(false); - } - } - else - { - if ( mfi.m_bEqualAB && mfi.m_bEqualAC ) - { - mfi.setMergeOperation( eCopyCToDest ); - } - else if ( mfi.m_bExistsInA && mfi.m_bExistsInB && mfi.m_bExistsInC) - { - if ( mfi.m_bEqualAB ) - mfi.setMergeOperation( eCopyCToDest ); - else if ( mfi.m_bEqualAC ) - mfi.setMergeOperation( eCopyBToDest ); - else if ( mfi.m_bEqualBC ) - mfi.setMergeOperation( eCopyCToDest ); - else - mfi.setMergeOperation( eMergeABCToDest ); - } - else if ( mfi.m_bExistsInA && mfi.m_bExistsInB && !mfi.m_bExistsInC ) - { - if ( mfi.m_bEqualAB ) - mfi.setMergeOperation( eDeleteFromDest ); - else - mfi.setMergeOperation( eCopyBToDest ); - } - else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB && mfi.m_bExistsInC ) - { - if ( mfi.m_bEqualAC ) - mfi.setMergeOperation( eDeleteFromDest ); - else - mfi.setMergeOperation( eCopyCToDest ); - } - else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB && mfi.m_bExistsInC ) - { - if ( mfi.m_bEqualBC ) - mfi.setMergeOperation( eCopyCToDest ); - else - mfi.setMergeOperation( eMergeABCToDest ); - } - else if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB && mfi.m_bExistsInC ) - { - mfi.setMergeOperation( eCopyCToDest ); - } - else if ( !mfi.m_bExistsInA && mfi.m_bExistsInB && !mfi.m_bExistsInC ) - { - mfi.setMergeOperation( eCopyBToDest ); - } - else if ( mfi.m_bExistsInA && !mfi.m_bExistsInB && !mfi.m_bExistsInC) - { - mfi.setMergeOperation( eDeleteFromDest ); - } - else //if ( !mfi.m_bExistsInA && !mfi.m_bExistsInB && !mfi.m_bExistsInC ) - { - mfi.setMergeOperation( eNoOperation ); assert(false); - } - } - - // Now check if file/dir-types fit. - if ( conflictingFileTypes(mfi) ) - { - mfi.setMergeOperation( eConflictingFileTypes ); - } - } - else - { - e_MergeOperation eMO = eDefaultMergeOp; - switch ( eDefaultMergeOp ) - { - case eConflictingFileTypes: - case eConflictingAges: - case eDeleteA: - case eDeleteB: - case eDeleteAB: - case eDeleteFromDest: - case eNoOperation: break; - case eCopyAToB: if ( !mfi.m_bExistsInA ) { eMO = eDeleteB; } break; - case eCopyBToA: if ( !mfi.m_bExistsInB ) { eMO = eDeleteA; } break; - case eCopyAToDest: if ( !mfi.m_bExistsInA ) { eMO = eDeleteFromDest; } break; - case eCopyBToDest: if ( !mfi.m_bExistsInB ) { eMO = eDeleteFromDest; } break; - case eCopyCToDest: if ( !mfi.m_bExistsInC ) { eMO = eDeleteFromDest; } break; - - case eMergeToA: - case eMergeToB: - case eMergeToAB: - case eMergeABCToDest: - case eMergeABToDest: - default: - assert(false); - } - mfi.setMergeOperation( eMO ); - } -} - -void DirectoryMergeWindow::onDoubleClick( Q3ListViewItem* lvi ) -{ - if (lvi==0) return; - - if ( m_bDirectoryMerge ) - mergeCurrentFile(); - else - compareCurrentFile(); -} - -void DirectoryMergeWindow::onSelectionChanged( Q3ListViewItem* lvi ) -{ - if ( lvi==0 ) return; - - DirMergeItem* pDMI = static_cast(lvi); - - MergeFileInfos& mfi = *pDMI->m_pMFI; - assert( mfi.m_pDMI==pDMI ); - - m_pDirectoryMergeInfo->setInfo( m_dirA, m_dirB, m_dirC, m_dirDestInternal, mfi ); -} - -void DirectoryMergeWindow::onClick( int button, Q3ListViewItem* lvi, const QPoint& p, int c ) -{ - if ( lvi==0 ) return; - - DirMergeItem* pDMI = static_cast(lvi); - - MergeFileInfos& mfi = *pDMI->m_pMFI; - assert( mfi.m_pDMI==pDMI ); - - if ( c==s_OpCol ) - { - bool bThreeDirs = m_dirC.isValid(); - - KPopupMenu m(this); - if ( bThreeDirs ) - { - m_pDirCurrentDoNothing->plug(&m); - int count=0; - if ( mfi.m_bExistsInA ) { m_pDirCurrentChooseA->plug(&m); ++count; } - if ( mfi.m_bExistsInB ) { m_pDirCurrentChooseB->plug(&m); ++count; } - if ( mfi.m_bExistsInC ) { m_pDirCurrentChooseC->plug(&m); ++count; } - if ( !conflictingFileTypes(mfi) && count>1 ) m_pDirCurrentMerge->plug(&m); - m_pDirCurrentDelete->plug(&m); - } - else if ( m_bSyncMode ) - { - m_pDirCurrentSyncDoNothing->plug(&m); - if ( mfi.m_bExistsInA ) m_pDirCurrentSyncCopyAToB->plug(&m); - if ( mfi.m_bExistsInB ) m_pDirCurrentSyncCopyBToA->plug(&m); - if ( mfi.m_bExistsInA ) m_pDirCurrentSyncDeleteA->plug(&m); - if ( mfi.m_bExistsInB ) m_pDirCurrentSyncDeleteB->plug(&m); - if ( mfi.m_bExistsInA && mfi.m_bExistsInB ) - { - m_pDirCurrentSyncDeleteAAndB->plug(&m); - if ( !conflictingFileTypes(mfi)) - { - m_pDirCurrentSyncMergeToA->plug(&m); - m_pDirCurrentSyncMergeToB->plug(&m); - m_pDirCurrentSyncMergeToAAndB->plug(&m); - } - } - } - else - { - m_pDirCurrentDoNothing->plug(&m); - if ( mfi.m_bExistsInA ) { m_pDirCurrentChooseA->plug(&m); } - if ( mfi.m_bExistsInB ) { m_pDirCurrentChooseB->plug(&m); } - if ( !conflictingFileTypes(mfi) && mfi.m_bExistsInA && mfi.m_bExistsInB ) m_pDirCurrentMerge->plug(&m); - m_pDirCurrentDelete->plug(&m); - } - - m.exec( p ); - } - else if ( c == s_ACol || c==s_BCol || c==s_CCol ) - { - QString itemPath; - if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } - else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } - else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } - - if (!itemPath.isEmpty()) - { - selectItemAndColumn( pDMI, c, button==Qt::RightButton ); - } - } -} - -void DirectoryMergeWindow::slotShowContextMenu(Q3ListViewItem* lvi,const QPoint & p,int c) -{ - if ( lvi==0 ) return; - - DirMergeItem* pDMI = static_cast(lvi); - - MergeFileInfos& mfi = *pDMI->m_pMFI; - assert( mfi.m_pDMI==pDMI ); - if ( c == s_ACol || c==s_BCol || c==s_CCol ) - { - QString itemPath; - if ( c == s_ACol && mfi.m_bExistsInA ){ itemPath = fullNameA(mfi); } - else if ( c == s_BCol && mfi.m_bExistsInB ){ itemPath = fullNameB(mfi); } - else if ( c == s_CCol && mfi.m_bExistsInC ){ itemPath = fullNameC(mfi); } - - if (!itemPath.isEmpty()) - { - selectItemAndColumn(pDMI, c, true); - KPopupMenu m(this); - m_pDirCompareExplicit->plug(&m); - m_pDirMergeExplicit->plug(&m); - -#ifndef _WIN32 - m.exec( p ); -#else - void showShellContextMenu( const QString&, QPoint, QWidget*, QMenu* ); - showShellContextMenu( itemPath, p, this, &m ); -#endif - } - } -} - -static QString getFileName( DirMergeItem* pDMI, int column ) -{ - if ( pDMI != 0 ) - { - MergeFileInfos& mfi = *pDMI->m_pMFI; - return column == s_ACol ? mfi.m_fileInfoA.absFilePath() : - column == s_BCol ? mfi.m_fileInfoB.absFilePath() : - column == s_CCol ? mfi.m_fileInfoC.absFilePath() : - QString(""); - } - return ""; -} - -static bool isDir( DirMergeItem* pDMI, int column ) -{ - if ( pDMI != 0 ) - { - MergeFileInfos& mfi = *pDMI->m_pMFI; - return column == s_ACol ? mfi.m_bDirA : - column == s_BCol ? mfi.m_bDirB : - mfi.m_bDirC; - } - return false; -} - - -void DirectoryMergeWindow::selectItemAndColumn(DirMergeItem* pDMI, int c, bool bContextMenu) -{ - if ( bContextMenu && ( - pDMI==m_pSelection1Item && c==m_selection1Column && m_pSelection2Item==0 || - pDMI==m_pSelection2Item && c==m_selection2Column && m_pSelection3Item==0 || - pDMI==m_pSelection3Item && c==m_selection3Column ) ) - return; - - DirMergeItem* pOld1=m_pSelection1Item; - DirMergeItem* pOld2=m_pSelection2Item; - DirMergeItem* pOld3=m_pSelection3Item; - - bool bReset = false; - - if ( m_pSelection1Item ) - { - if (isDir( m_pSelection1Item, m_selection1Column )!=isDir( pDMI, c )) - bReset = true; - } - - if ( bReset || m_pSelection3Item!=0 || - pDMI==m_pSelection1Item && c==m_selection1Column || - pDMI==m_pSelection2Item && c==m_selection2Column || - pDMI==m_pSelection3Item && c==m_selection3Column) - { - m_pSelection1Item = 0; - m_pSelection2Item = 0; - m_pSelection3Item = 0; - } - else if ( m_pSelection1Item==0 ) - { - m_pSelection1Item = pDMI; - m_selection1Column = c; - m_pSelection2Item = 0; - m_pSelection3Item = 0; - } - else if ( m_pSelection2Item==0 ) - { - m_pSelection2Item = pDMI; - m_selection2Column = c; - m_pSelection3Item = 0; - } - else if ( m_pSelection3Item==0 ) - { - m_pSelection3Item = pDMI; - m_selection3Column = c; - } - if (pOld1) repaintItem( pOld1 ); - if (pOld2) repaintItem( pOld2 ); - if (pOld3) repaintItem( pOld3 ); - if (m_pSelection1Item) repaintItem( m_pSelection1Item ); - if (m_pSelection2Item) repaintItem( m_pSelection2Item ); - if (m_pSelection3Item) repaintItem( m_pSelection3Item ); - emit updateAvailabilities(); -} - -// Since Qt 2.3.0 doesn't allow the specification of a compare operator, this trick emulates it. -#if QT_VERSION==230 -#define DIRSORT(x) ( pMFI->m_bDirA ? " " : "" )+x -#else -#define DIRSORT(x) x -#endif - -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 ) -: Q3ListViewItem( pParent, DIRSORT( fileName ), "","","", i18n("To do."), "" ) -{ - init(pMFI); -} - - -void DirMergeItem::init(MergeFileInfos* pMFI) -{ - pMFI->m_pDMI = this; - m_pMFI = pMFI; - TotalDiffStatus& tds = pMFI->m_totalDiffStatus; - if ( m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC ) - { - } - else - { - setText( s_UnsolvedCol, QString::number( tds.nofUnsolvedConflicts ) ); - setText( s_SolvedCol, QString::number( tds.nofSolvedConflicts ) ); - setText( s_NonWhiteCol, QString::number( tds.nofUnsolvedConflicts + tds.nofSolvedConflicts - tds.nofWhitespaceConflicts ) ); - setText( s_WhiteCol, QString::number( tds.nofWhitespaceConflicts ) ); - } -} - -int DirMergeItem::compare(Q3ListViewItem *i, int col, bool ascending) const -{ - DirMergeItem* pDMI = static_cast(i); - bool bDir1 = m_pMFI->m_bDirA || m_pMFI->m_bDirB || m_pMFI->m_bDirC; - bool bDir2 = pDMI->m_pMFI->m_bDirA || pDMI->m_pMFI->m_bDirB || pDMI->m_pMFI->m_bDirC; - if ( m_pMFI==0 || pDMI->m_pMFI==0 || bDir1 == bDir2 ) - { - 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 Q3ListViewItem::compare( i, col, ascending ); - } - else - return bDir1 ? -1 : 1; -} - -void DirMergeItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ) -{ - if (column == s_ACol || column == s_BCol || column == s_CCol ) - { - const QPixmap* icon = pixmap(column); - if ( icon ) - { - int yOffset = (height() - icon->height()) / 2; - p->drawPixmap( 2, yOffset, *icon ); - if ( listView() ) - { - DirectoryMergeWindow* pDMW = static_cast(listView()); - int i = this==pDMW->m_pSelection1Item && column == pDMW->m_selection1Column ? 1 : - this==pDMW->m_pSelection2Item && column == pDMW->m_selection2Column ? 2 : - this==pDMW->m_pSelection3Item && column == pDMW->m_selection3Column ? 3 : - 0; - if ( i!=0 ) - { - OptionDialog* pOD = pDMW->m_pOptions; - QColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC ); - p->setPen( c );// highlight() ); - p->drawRect( 2, yOffset, icon->width(), icon->height()); - p->setPen( QPen( c, 0, Qt::DotLine) ); - p->drawRect( 1, yOffset-1, icon->width()+2, icon->height()+2); - p->setPen( cg.background() ); - QString s( QChar('A'+i-1) ); - p->drawText( 2 + (icon->width() - p->fontMetrics().width(s))/2, - yOffset + (icon->height() + p->fontMetrics().ascent())/2-1, - s ); - } - else - { - p->setPen( cg.background() ); - p->drawRect( 1, yOffset-1, icon->width()+2, icon->height()+2); - } - } - return; - } - } - Q3ListViewItem::paintCell(p,cg,column,width,align); -} - -DirMergeItem::~DirMergeItem() -{ - m_pMFI->m_pDMI = 0; -} - -void MergeFileInfos::setMergeOperation( e_MergeOperation eMOp ) -{ - if ( eMOp != m_eMergeOperation ) - { - m_bOperationComplete = false; - m_pDMI->setText( s_OpStatusCol, "" ); - } - - m_eMergeOperation = eMOp; - QString s; - bool bDir = m_bDirA || m_bDirB || m_bDirC; - if( m_pDMI!=0 ) - { - switch( m_eMergeOperation ) - { - case eNoOperation: s=""; m_pDMI->setText(s_OpCol,""); break; - case eCopyAToB: s=i18n("Copy A to B"); break; - case eCopyBToA: s=i18n("Copy B to A"); break; - case eDeleteA: s=i18n("Delete A"); break; - case eDeleteB: s=i18n("Delete B"); break; - case eDeleteAB: s=i18n("Delete A & B"); break; - case eMergeToA: s=i18n("Merge to A"); break; - case eMergeToB: s=i18n("Merge to B"); break; - case eMergeToAB: s=i18n("Merge to A & B"); break; - case eCopyAToDest: s="A"; break; - case eCopyBToDest: s="B"; break; - case eCopyCToDest: s="C"; break; - case eDeleteFromDest: s=i18n("Delete (if exists)"); break; - case eMergeABCToDest: s= bDir ? i18n("Merge") : i18n("Merge (manual)"); break; - case eMergeABToDest: s= bDir ? i18n("Merge") : i18n("Merge (manual)"); break; - case eConflictingFileTypes: s=i18n("Error: Conflicting File Types"); break; - case eConflictingAges: s=i18n("Error: Dates are equal but files are not."); break; - default: assert(false); break; - } - m_pDMI->setText(s_OpCol,s); - - e_MergeOperation eChildrenMergeOp = m_eMergeOperation; - if ( eChildrenMergeOp == eConflictingFileTypes ) eChildrenMergeOp = eMergeABCToDest; - Q3ListViewItem* p = m_pDMI->firstChild(); - while ( p!=0 ) - { - DirMergeItem* pDMI = static_cast( p ); - DirectoryMergeWindow* pDMW = static_cast( p->listView() ); - pDMW->calcSuggestedOperation( *pDMI->m_pMFI, eChildrenMergeOp ); - p = p->nextSibling(); - } - } -} - -void DirectoryMergeWindow::compareCurrentFile() -{ - if (!canContinue()) return; - - if ( m_bRealMergeStarted ) - { - KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); - return; - } - - DirMergeItem* pDMI = static_cast( selectedItem() ); - if ( pDMI != 0 ) - { - MergeFileInfos& mfi = *pDMI->m_pMFI; - if ( !(mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC) ) - { - emit startDiffMerge( - mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), - mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), - mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), - "", - "","","",0 - ); - } - } - emit updateAvailabilities(); -} - - -void DirectoryMergeWindow::slotCompareExplicitlySelectedFiles() -{ - if ( ! isDir(m_pSelection1Item,m_selection1Column) && !canContinue() ) return; - - if ( m_bRealMergeStarted ) - { - KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); - return; - } - - emit startDiffMerge( - getFileName( m_pSelection1Item, m_selection1Column ), - getFileName( m_pSelection2Item, m_selection2Column ), - getFileName( m_pSelection3Item, m_selection3Column ), - "", - "","","",0 - ); - m_pSelection1Item=0; - m_pSelection2Item=0; - m_pSelection3Item=0; - - emit updateAvailabilities(); - triggerUpdate(); -} - -void DirectoryMergeWindow::slotMergeExplicitlySelectedFiles() -{ - if ( ! isDir(m_pSelection1Item,m_selection1Column) && !canContinue() ) return; - - if ( m_bRealMergeStarted ) - { - KMessageBox::sorry(this,i18n("This operation is currently not possible."),i18n("Operation Not Possible")); - return; - } - - QString fn1 = getFileName( m_pSelection1Item, m_selection1Column ); - QString fn2 = getFileName( m_pSelection2Item, m_selection2Column ); - QString fn3 = getFileName( m_pSelection3Item, m_selection3Column ); - - emit startDiffMerge( fn1, fn2, fn3, - fn3.isEmpty() ? fn2 : fn3, - "","","",0 - ); - m_pSelection1Item=0; - m_pSelection2Item=0; - m_pSelection3Item=0; - - emit updateAvailabilities(); - triggerUpdate(); -} - -bool DirectoryMergeWindow::isFileSelected() -{ - DirMergeItem* pDMI = static_cast( selectedItem() ); - if ( pDMI != 0 ) - { - MergeFileInfos& mfi = *pDMI->m_pMFI; - return ! (mfi.m_bDirA || mfi.m_bDirB || mfi.m_bDirC || conflictingFileTypes(mfi) ); - } - return false; -} - -void DirectoryMergeWindow::mergeResultSaved(const QString& fileName) -{ - DirMergeItem* pCurrentItemForOperation = (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) - ? 0 - : *m_currentItemForOperation; - - if ( pCurrentItemForOperation!=0 && pCurrentItemForOperation->m_pMFI==0 ) - { - KMessageBox::error( this, i18n("This should never happen: \n\nmergeResultSaved: m_pMFI=0\n\nIf you know how to reproduce this, please contact the program author."),i18n("Program Error") ); - return; - } - if ( pCurrentItemForOperation!=0 && fileName == fullNameDest(*pCurrentItemForOperation->m_pMFI) ) - { - if ( pCurrentItemForOperation->m_pMFI->m_eMergeOperation==eMergeToAB ) - { - MergeFileInfos& mfi = *pCurrentItemForOperation->m_pMFI; - bool bSuccess = copyFLD( fullNameB(mfi), fullNameA(mfi) ); - if (!bSuccess) - { - KMessageBox::error(this, i18n("An error occurred while copying.\n"), i18n("Error") ); - m_pStatusInfo->setCaption(i18n("Merge Error")); - m_pStatusInfo->show(); - //if ( m_pStatusInfo->firstChild()!=0 ) - // m_pStatusInfo->ensureItemVisible( m_pStatusInfo->last() ); - m_bError = true; - pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Error.") ); - mfi.m_eMergeOperation = eCopyBToA; - return; - } - } - pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Done.") ); - pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; - if ( m_mergeItemList.size()==1 ) - { - m_mergeItemList.clear(); - m_bRealMergeStarted=false; - } - } - - emit updateAvailabilities(); -} - -bool DirectoryMergeWindow::canContinue() -{ - bool bCanContinue=false; - checkIfCanContinue( &bCanContinue ); - if ( bCanContinue && !m_bError ) - { - DirMergeItem* pCurrentItemForOperation = - (m_mergeItemList.empty() || m_currentItemForOperation==m_mergeItemList.end() ) ? 0 : *m_currentItemForOperation; - - if ( pCurrentItemForOperation!=0 && ! pCurrentItemForOperation->m_pMFI->m_bOperationComplete ) - { - pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Not saved.") ); - pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; - if ( m_mergeItemList.size()==1 ) - { - m_mergeItemList.clear(); - m_bRealMergeStarted=false; - } - } - } - return bCanContinue; -} - -bool DirectoryMergeWindow::executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ) -{ - bool bCreateBackups = m_pOptions->m_bDmCreateBakFiles; - // First decide destname - QString destName; - switch( mfi.m_eMergeOperation ) - { - case eNoOperation: break; - case eDeleteAB: break; - case eMergeToAB: // let the user save in B. In mergeResultSaved() the file will be copied to A. - case eMergeToB: - case eDeleteB: - case eCopyAToB: destName = fullNameB(mfi); break; - case eMergeToA: - case eDeleteA: - case eCopyBToA: destName = fullNameA(mfi); break; - case eMergeABToDest: - case eMergeABCToDest: - case eCopyAToDest: - case eCopyBToDest: - case eCopyCToDest: - case eDeleteFromDest: destName = fullNameDest(mfi); break; - default: - KMessageBox::error( this, i18n("Unknown merge operation. (This must never happen!)"), i18n("Error") ); - assert(false); - } - - bool bSuccess = false; - bSingleFileMerge = false; - switch( mfi.m_eMergeOperation ) - { - case eNoOperation: bSuccess = true; break; - case eCopyAToDest: - case eCopyAToB: bSuccess = copyFLD( fullNameA(mfi), destName ); break; - case eCopyBToDest: - case eCopyBToA: bSuccess = copyFLD( fullNameB(mfi), destName ); break; - case eCopyCToDest: bSuccess = copyFLD( fullNameC(mfi), destName ); break; - case eDeleteFromDest: - case eDeleteA: - case eDeleteB: bSuccess = deleteFLD( destName, bCreateBackups ); break; - case eDeleteAB: bSuccess = deleteFLD( fullNameA(mfi), bCreateBackups ) && - deleteFLD( fullNameB(mfi), bCreateBackups ); break; - case eMergeABToDest: - case eMergeToA: - case eMergeToAB: - case eMergeToB: bSuccess = mergeFLD( fullNameA(mfi), fullNameB(mfi), "", - destName, bSingleFileMerge ); - break; - case eMergeABCToDest:bSuccess = mergeFLD( - mfi.m_bExistsInA ? fullNameA(mfi) : QString(""), - mfi.m_bExistsInB ? fullNameB(mfi) : QString(""), - mfi.m_bExistsInC ? fullNameC(mfi) : QString(""), - destName, bSingleFileMerge ); - break; - default: - KMessageBox::error( this, i18n("Unknown merge operation."), i18n("Error") ); - assert(false); - } - - return bSuccess; -} - - -// Check if the merge can start, and prepare the m_mergeItemList which then contains all -// items that must be merged. -void DirectoryMergeWindow::prepareMergeStart( Q3ListViewItem* pBegin, Q3ListViewItem* pEnd, bool bVerbose ) -{ - if ( bVerbose ) - { - int status = KMessageBox::warningYesNoCancel(this, - i18n("The merge is about to begin.\n\n" - "Choose \"Do it\" if you have read the instructions and know what you are doing.\n" - "Choosing \"Simulate it\" will tell you what would happen.\n\n" - "Be aware that this program still has beta status " - "and there is NO WARRANTY whatsoever! Make backups of your vital data!"), - i18n("Starting Merge"), i18n("Do It"), i18n("Simulate It") ); - if (status==KMessageBox::Yes) m_bRealMergeStarted = true; - else if (status==KMessageBox::No ) m_bSimulatedMergeStarted = true; - else return; - } - else - { - m_bRealMergeStarted = true; - } - - m_mergeItemList.clear(); - if (pBegin == 0) - return; - - for( Q3ListViewItem* p = pBegin; p!= pEnd; p = treeIterator( p ) ) - { - DirMergeItem* pDMI = static_cast(p); - - if ( pDMI && ! pDMI->m_pMFI->m_bOperationComplete ) - { - m_mergeItemList.push_back(pDMI); - - if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingFileTypes ) - { - ensureItemVisible( pDMI ); - setSelected( pDMI, true ); - KMessageBox::error(this, i18n("The highlighted item has a different type in the different directories. Select what to do."), i18n("Error")); - m_mergeItemList.clear(); - m_bRealMergeStarted=false; - return; - } - if (pDMI!=0 && pDMI->m_pMFI->m_eMergeOperation == eConflictingAges ) - { - ensureItemVisible( pDMI ); - setSelected( pDMI, true ); - KMessageBox::error(this, i18n("The modification dates of the file are equal but the files are not. Select what to do."), i18n("Error")); - m_mergeItemList.clear(); - m_bRealMergeStarted=false; - return; - } - } - } - - m_currentItemForOperation = m_mergeItemList.begin(); - return; -} - -void DirectoryMergeWindow::slotRunOperationForCurrentItem() -{ - if ( ! canContinue() ) return; - - bool bVerbose = false; - if ( m_mergeItemList.empty() ) - { - Q3ListViewItem* pBegin = currentItem(); - Q3ListViewItem* pEnd = treeIterator(pBegin,false,false); // find next visible sibling (no children) - - prepareMergeStart( pBegin, pEnd, bVerbose ); - mergeContinue(true, bVerbose); - } - else - mergeContinue(false, bVerbose); -} - -void DirectoryMergeWindow::slotRunOperationForAllItems() -{ - if ( ! canContinue() ) return; - - bool bVerbose = true; - if ( m_mergeItemList.empty() ) - { - Q3ListViewItem* pBegin = firstChild(); - - prepareMergeStart( pBegin, 0, bVerbose ); - mergeContinue(true, bVerbose); - } - else - mergeContinue(false, bVerbose); -} - -void DirectoryMergeWindow::mergeCurrentFile() -{ - if (!canContinue()) return; - - if ( m_bRealMergeStarted ) - { - KMessageBox::sorry(this,i18n("This operation is currently not possible because directory merge is currently running."),i18n("Operation Not Possible")); - return; - } - - if ( isFileSelected() ) - { - DirMergeItem* pDMI = static_cast( selectedItem() ); - if ( pDMI != 0 ) - { - MergeFileInfos& mfi = *pDMI->m_pMFI; - m_mergeItemList.clear(); - m_mergeItemList.push_back( pDMI ); - m_currentItemForOperation=m_mergeItemList.begin(); - bool bDummy=false; - mergeFLD( - mfi.m_bExistsInA ? mfi.m_fileInfoA.absFilePath() : QString(""), - mfi.m_bExistsInB ? mfi.m_fileInfoB.absFilePath() : QString(""), - mfi.m_bExistsInC ? mfi.m_fileInfoC.absFilePath() : QString(""), - fullNameDest(mfi), - bDummy - ); - } - } - emit updateAvailabilities(); -} - - -// When bStart is true then m_currentItemForOperation must still be processed. -// When bVerbose is true then a messagebox will tell when the merge is complete. -void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose) -{ - ProgressProxy pp; - if ( m_mergeItemList.empty() ) - return; - - int nrOfItems = 0; - int nrOfCompletedItems = 0; - int nrOfCompletedSimItems = 0; - - // Count the number of completed items (for the progress bar). - for( MergeItemList::iterator i = m_mergeItemList.begin(); i!=m_mergeItemList.end(); ++i ) - { - DirMergeItem* pDMI = *i; - ++nrOfItems; - if ( pDMI->m_pMFI->m_bOperationComplete ) - ++nrOfCompletedItems; - if ( pDMI->m_pMFI->m_bSimOpComplete ) - ++nrOfCompletedSimItems; - } - - m_pStatusInfo->hide(); - m_pStatusInfo->clear(); - - DirMergeItem* pCurrentItemForOperation = m_currentItemForOperation==m_mergeItemList.end() ? 0 : *m_currentItemForOperation; - - bool bContinueWithCurrentItem = bStart; // true for first item, else false - bool bSkipItem = false; - if ( !bStart && m_bError && pCurrentItemForOperation!=0 ) - { - int status = KMessageBox::warningYesNoCancel(this, - i18n("There was an error in the last step.\n" - "Do you want to continue with the item that caused the error or do you want to skip this item?"), - i18n("Continue merge after an error"), i18n("Continue With Last Item"), i18n("Skip Item") ); - if (status==KMessageBox::Yes) bContinueWithCurrentItem = true; - else if (status==KMessageBox::No ) bSkipItem = true; - else return; - m_bError = false; - } - - bool bSuccess = true; - bool bSingleFileMerge = false; - bool bSim = m_bSimulatedMergeStarted; - while( bSuccess ) - { - if ( pCurrentItemForOperation==0 ) - { - m_mergeItemList.clear(); - m_bRealMergeStarted=false; - break; - } - - if ( pCurrentItemForOperation!=0 && !bContinueWithCurrentItem ) - { - if ( bSim ) - { - if( pCurrentItemForOperation->firstChild()==0 ) - { - pCurrentItemForOperation->m_pMFI->m_bSimOpComplete = true; - } - } - else - { - if( pCurrentItemForOperation->firstChild()==0 ) - { - if( !pCurrentItemForOperation->m_pMFI->m_bOperationComplete ) - { - pCurrentItemForOperation->setText( s_OpStatusCol, bSkipItem ? i18n("Skipped.") : i18n("Done.") ); - pCurrentItemForOperation->m_pMFI->m_bOperationComplete = true; - bSkipItem = false; - } - } - else - { - pCurrentItemForOperation->setText( s_OpStatusCol, i18n("In progress...") ); - } - } - } - - if ( ! bContinueWithCurrentItem ) - { - // Depth first - 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" - Q3ListViewItem* pParent = pPrevItem->parent(); - bool bDone = true; - while ( bDone && pParent!=0 ) - { - for( Q3ListViewItem* p = pParent->firstChild(); p!=0; p=p->nextSibling() ) - { - DirMergeItem* pDMI = static_cast(p); - if ( !bSim && ! pDMI->m_pMFI->m_bOperationComplete || bSim && pDMI->m_pMFI->m_bSimOpComplete ) - { - bDone=false; - break; - } - } - if ( bDone ) - { - if (bSim) - static_cast(pParent)->m_pMFI->m_bSimOpComplete = bDone; - else - { - pParent->setText( s_OpStatusCol, i18n("Done.") ); - static_cast(pParent)->m_pMFI->m_bOperationComplete = bDone; - } - } - pParent = pParent->parent(); - } - } - } - - if ( pCurrentItemForOperation == 0 ) // end? - { - if ( m_bRealMergeStarted ) - { - if (bVerbose) - { - KMessageBox::information( this, i18n("Merge operation complete."), i18n("Merge Complete") ); - } - m_bRealMergeStarted = false; - m_pStatusInfo->setCaption(i18n("Merge Complete")); - } - if ( m_bSimulatedMergeStarted ) - { - m_bSimulatedMergeStarted = false; - for( Q3ListViewItem* p=firstChild(); p!=0; p=treeIterator(p) ) - { - static_cast(p)->m_pMFI->m_bSimOpComplete = false; - } - m_pStatusInfo->setCaption(i18n("Simulated merge complete: Check if you agree with the proposed operations.")); - m_pStatusInfo->show(); - } - //g_pProgressDialog->hide(); - m_mergeItemList.clear(); - m_bRealMergeStarted=false; - return; - } - - MergeFileInfos& mfi = *pCurrentItemForOperation->m_pMFI; - - pp.setInformation( mfi.m_subPath, - bSim ? double(nrOfCompletedSimItems)/nrOfItems : double(nrOfCompletedItems)/nrOfItems, - false // bRedrawUpdate - ); - //g_pProgressDialog->show(); - - bSuccess = executeMergeOperation( mfi, bSingleFileMerge ); // Here the real operation happens. - - if ( bSuccess ) - { - if(bSim) ++nrOfCompletedSimItems; - else ++nrOfCompletedItems; - bContinueWithCurrentItem = false; - } - - if( pp.wasCancelled() ) - break; - } // end while - - //g_pProgressDialog->hide(); - - setCurrentItem( pCurrentItemForOperation ); - ensureItemVisible( pCurrentItemForOperation ); - if ( !bSuccess && !bSingleFileMerge ) - { - KMessageBox::error(this, i18n("An error occurred. Press OK to see detailed information.\n"), i18n("Error") ); - m_pStatusInfo->setCaption(i18n("Merge Error")); - m_pStatusInfo->show(); - //if ( m_pStatusInfo->firstChild()!=0 ) - // m_pStatusInfo->ensureItemVisible( m_pStatusInfo->last() ); - m_bError = true; - pCurrentItemForOperation->setText( s_OpStatusCol, i18n("Error.") ); - } - else - { - m_bError = false; - } - emit updateAvailabilities(); - - if ( m_currentItemForOperation==m_mergeItemList.end() ) - { - m_mergeItemList.clear(); - m_bRealMergeStarted=false; - } -} - -void DirectoryMergeWindow::allowResizeEvents(bool bAllowResizeEvents ) -{ - m_bAllowResizeEvents = bAllowResizeEvents; -} - -void DirectoryMergeWindow::resizeEvent( QResizeEvent* e ) -{ - if (m_bAllowResizeEvents) - Q3ListView::resizeEvent(e); -} - -bool DirectoryMergeWindow::deleteFLD( const QString& name, bool bCreateBackup ) -{ - FileAccess fi(name, true); - if ( !fi.exists() ) - return true; - - if ( bCreateBackup ) - { - bool bSuccess = renameFLD( name, name+".orig" ); - if (!bSuccess) - { - m_pStatusInfo->addText( i18n("Error: While deleting %1: Creating backup failed.").arg(name) ); - return false; - } - } - else - { - if ( fi.isDir() && !fi.isSymLink() ) - m_pStatusInfo->addText(i18n("delete directory recursively( %1 )").arg(name)); - else - m_pStatusInfo->addText(i18n("delete( %1 )").arg(name)); - - if ( m_bSimulatedMergeStarted ) - { - return true; - } - - if ( fi.isDir() && !fi.isSymLink() )// recursive directory delete only for real dirs, not symlinks - { - t_DirectoryList dirList; - bool bSuccess = fi.listDir( &dirList, false, true, "*", "", "", false, false ); // not recursive, find hidden files - - if ( !bSuccess ) - { - // No Permission to read directory or other error. - m_pStatusInfo->addText( i18n("Error: delete dir operation failed while trying to read the directory.") ); - return false; - } - - t_DirectoryList::iterator it; // create list iterator - - for ( it=dirList.begin(); it!=dirList.end(); ++it ) // for each file... - { - FileAccess& fi2 = *it; - if ( fi2.fileName() == "." || fi2.fileName()==".." ) - continue; - bSuccess = deleteFLD( fi2.absFilePath(), false ); - if (!bSuccess) break; - } - if (bSuccess) - { - bSuccess = FileAccess::removeDir( name ); - if ( !bSuccess ) - { - m_pStatusInfo->addText( i18n("Error: rmdir( %1 ) operation failed.").arg(name)); - return false; - } - } - } - else - { - bool bSuccess = FileAccess::removeFile( name ); - if ( !bSuccess ) - { - m_pStatusInfo->addText( i18n("Error: delete operation failed.") ); - return false; - } - } - } - return true; -} - -bool DirectoryMergeWindow::mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC,const QString& nameDest, bool& bSingleFileMerge ) -{ - FileAccess fi(nameA); - if (fi.isDir()) - { - return makeDir(nameDest); - } - - // Make sure that the dir exists, into which we will save the file later. - int pos=nameDest.findRev('/'); - if ( pos>0 ) - { - QString parentName = nameDest.left(pos); - bool bSuccess = makeDir(parentName, true /*quiet*/); - if (!bSuccess) - return false; - } - - m_pStatusInfo->addText(i18n("manual merge( %1, %2, %3 -> %4)").arg(nameA).arg(nameB).arg(nameC).arg(nameDest)); - if ( m_bSimulatedMergeStarted ) - { - m_pStatusInfo->addText(i18n(" Note: After a manual merge the user should continue by pressing F7.") ); - return true; - } - - bSingleFileMerge = true; - (*m_currentItemForOperation)->setText( s_OpStatusCol, i18n("In progress...") ); - ensureItemVisible( *m_currentItemForOperation ); - - emit startDiffMerge( nameA, nameB, nameC, nameDest, "","","",0 ); - - return false; -} - -bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destName ) -{ - if ( srcName == destName ) - return true; - - if ( FileAccess(destName, true).exists() ) - { - bool bSuccess = deleteFLD( destName, m_pOptions->m_bDmCreateBakFiles ); - if ( !bSuccess ) - { - m_pStatusInfo->addText(i18n("Error: copy( %1 -> %2 ) failed." - "Deleting existing destination failed.").arg(srcName).arg(destName)); - return false; - } - } - - FileAccess fi( srcName ); - - if ( fi.isSymLink() && (fi.isDir() && !m_bFollowDirLinks || !fi.isDir() && !m_bFollowFileLinks) ) - { - m_pStatusInfo->addText(i18n("copyLink( %1 -> %2 )").arg(srcName).arg(destName)); -#ifdef _WIN32 - // What are links? -#else - if ( m_bSimulatedMergeStarted ) - { - return true; - } - FileAccess destFi(destName); - if ( !destFi.isLocal() || !fi.isLocal() ) - { - m_pStatusInfo->addText(i18n("Error: copyLink failed: Remote links are not yet supported.")); - return false; - } - QString linkTarget = fi.readLink(); - bool bSuccess = FileAccess::symLink( linkTarget, destName ); - if (!bSuccess) - m_pStatusInfo->addText(i18n("Error: copyLink failed.")); - return bSuccess; -#endif - } - - if ( fi.isDir() ) - { - bool bSuccess = makeDir( destName ); - return bSuccess; - } - - int pos=destName.findRev('/'); - if ( pos>0 ) - { - QString parentName = destName.left(pos); - bool bSuccess = makeDir(parentName, true /*quiet*/); - if (!bSuccess) - return false; - } - - m_pStatusInfo->addText(i18n("copy( %1 -> %2 )").arg(srcName).arg(destName)); - - if ( m_bSimulatedMergeStarted ) - { - return true; - } - - FileAccess faSrc ( srcName ); - bool bSuccess = faSrc.copyFile( destName ); - if (! bSuccess ) m_pStatusInfo->addText( faSrc.getStatusText() ); - return bSuccess; -} - -// Rename is not an operation that can be selected by the user. -// It will only be used to create backups. -// Hence it will delete an existing destination without making a backup (of the old backup.) -bool DirectoryMergeWindow::renameFLD( const QString& srcName, const QString& destName ) -{ - if ( srcName == destName ) - return true; - - if ( FileAccess(destName, true).exists() ) - { - bool bSuccess = deleteFLD( destName, false /*no backup*/ ); - if (!bSuccess) - { - m_pStatusInfo->addText( i18n("Error during rename( %1 -> %2 ): " - "Cannot delete existing destination." ).arg(srcName).arg(destName)); - return false; - } - } - - m_pStatusInfo->addText(i18n("rename( %1 -> %2 )").arg(srcName).arg(destName)); - if ( m_bSimulatedMergeStarted ) - { - return true; - } - - bool bSuccess = FileAccess( srcName ).rename( destName ); - if (!bSuccess) - { - m_pStatusInfo->addText( i18n("Error: Rename failed.") ); - return false; - } - - return true; -} - -bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet ) -{ - FileAccess fi(name, true); - if( fi.exists() && fi.isDir() ) - return true; - - if( fi.exists() && !fi.isDir() ) - { - bool bSuccess = deleteFLD( name, true ); - if (!bSuccess) - { - m_pStatusInfo->addText( i18n("Error during makeDir of %1. " - "Cannot delete existing file." ).arg(name)); - return false; - } - } - - int pos=name.findRev('/'); - if ( pos>0 ) - { - QString parentName = name.left(pos); - bool bSuccess = makeDir(parentName,true); - if (!bSuccess) - return false; - } - - if ( ! bQuiet ) - m_pStatusInfo->addText(i18n("makeDir( %1 )").arg(name)); - - if ( m_bSimulatedMergeStarted ) - { - return true; - } - - bool bSuccess = FileAccess::makeDir( name ); - if ( bSuccess == false ) - { - m_pStatusInfo->addText( i18n("Error while creating directory.") ); - return false; - } - return true; -} - - -DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent ) -: Q3Frame(pParent) -{ - Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); - - Q3GridLayout *grid = new Q3GridLayout( topLayout ); - grid->setColStretch(1,10); - - int line=0; - - m_pA = new QLabel("A",this); grid->addWidget( m_pA,line, 0 ); - m_pInfoA = new QLabel(this); grid->addWidget( m_pInfoA,line,1 ); ++line; - m_pB = new QLabel("B",this); grid->addWidget( m_pB,line, 0 ); - m_pInfoB = new QLabel(this); grid->addWidget( m_pInfoB,line,1 ); ++line; - m_pC = new QLabel("C",this); grid->addWidget( m_pC,line, 0 ); - m_pInfoC = new QLabel(this); grid->addWidget( m_pInfoC,line,1 ); ++line; - m_pDest = new QLabel(i18n("Dest"),this); grid->addWidget( m_pDest,line, 0 ); - m_pInfoDest = new QLabel(this); grid->addWidget( m_pInfoDest,line,1 ); ++line; - - m_pInfoList = new Q3ListView(this); topLayout->addWidget( m_pInfoList ); - m_pInfoList->addColumn(i18n("Dir")); - m_pInfoList->addColumn(i18n("Type")); - m_pInfoList->addColumn(i18n("Size")); - m_pInfoList->addColumn(i18n("Attr")); - m_pInfoList->addColumn(i18n("Last Modification")); - m_pInfoList->addColumn(i18n("Link-Destination")); - setMinimumSize( 100,100 ); - - m_pInfoList->installEventFilter(this); -} - -bool DirectoryMergeInfo::eventFilter(QObject*o, QEvent* e) -{ - if ( e->type()==QEvent::FocusIn && o==m_pInfoList ) - emit gotFocus(); - return false; -} - -static void addListViewItem( Q3ListView* pListView, const QString& dir, - const QString& basePath, FileAccess& fi ) -{ - if ( basePath.isEmpty() ) - { - return; - } - else - { - if ( fi.exists() ) - { -#if QT_VERSION==230 - QString dateString = fi.lastModified().toString(); -#else - QString dateString = fi.lastModified().toString("yyyy-MM-dd hh:mm:ss"); -#endif - - new Q3ListViewItem( - pListView, - dir, - QString( fi.isDir() ? i18n("Dir") : i18n("File") ) + (fi.isSymLink() ? "-Link" : ""), - QString::number(fi.size()), - QString(fi.isReadable() ? "r" : " ") + (fi.isWritable()?"w" : " ") -#ifdef _WIN32 - /*Future: Use GetFileAttributes()*/, -#else - + (fi.isExecutable()?"x" : " "), -#endif - dateString, - QString(fi.isSymLink() ? (" -> " + fi.readLink()) : QString("")) - ); - } - else - { - new Q3ListViewItem( - pListView, - dir, - i18n("not available"), - "", - "", - "", - "" - ); - } - } -} - -void DirectoryMergeInfo::setInfo( - const FileAccess& dirA, - const FileAccess& dirB, - const FileAccess& dirC, - const FileAccess& dirDest, - MergeFileInfos& mfi ) -{ - bool bHideDest = false; - if ( dirA.absFilePath()==dirDest.absFilePath() ) - { - m_pA->setText( i18n("A (Dest): ") ); bHideDest=true; - } - else - m_pA->setText( !dirC.isValid() ? QString("A: ") : i18n("A (Base): ")); - - m_pInfoA->setText( dirA.prettyAbsPath() ); - - if ( dirB.absFilePath()==dirDest.absFilePath() ) - { - m_pB->setText( i18n("B (Dest): ") ); bHideDest=true; - } - else - m_pB->setText( "B: " ); - m_pInfoB->setText( dirB.prettyAbsPath() ); - - if ( dirC.absFilePath()==dirDest.absFilePath() ) - { - m_pC->setText( i18n("C (Dest): ") ); bHideDest=true; - } - else - m_pC->setText( "C: " ); - m_pInfoC->setText( dirC.prettyAbsPath() ); - - m_pDest->setText( i18n("Dest: ") ); m_pInfoDest->setText( dirDest.prettyAbsPath() ); - - if (!dirC.isValid()) { m_pC->hide(); m_pInfoC->hide(); } - else { m_pC->show(); m_pInfoC->show(); } - - if (!dirDest.isValid()||bHideDest) { m_pDest->hide(); m_pInfoDest->hide(); } - else { m_pDest->show(); m_pInfoDest->show(); } - - m_pInfoList->clear(); - addListViewItem( m_pInfoList, "A", dirA.prettyAbsPath(), mfi.m_fileInfoA ); - addListViewItem( m_pInfoList, "B", dirB.prettyAbsPath(), mfi.m_fileInfoB ); - addListViewItem( m_pInfoList, "C", dirC.prettyAbsPath(), mfi.m_fileInfoC ); - if (!bHideDest) - { - FileAccess fiDest( dirDest.prettyAbsPath() + "/" + mfi.m_subPath, true ); - addListViewItem( m_pInfoList, i18n("Dest"), dirDest.prettyAbsPath(), fiDest ); - } -} - -QTextStream& operator<<( QTextStream& ts, MergeFileInfos& mfi ) -{ - ts << "{\n"; - ValueMap vm; - vm.writeEntry( "SubPath", mfi.m_subPath ); - vm.writeEntry( "ExistsInA", mfi.m_bExistsInA ); - vm.writeEntry( "ExistsInB", mfi.m_bExistsInB ); - vm.writeEntry( "ExistsInC", mfi.m_bExistsInC ); - vm.writeEntry( "EqualAB", mfi.m_bEqualAB ); - vm.writeEntry( "EqualAC", mfi.m_bEqualAC ); - vm.writeEntry( "EqualBC", mfi.m_bEqualBC ); - //DirMergeItem* m_pDMI; - //MergeFileInfos* m_pParent; - vm.writeEntry( "MergeOperation", (int) mfi.m_eMergeOperation ); - vm.writeEntry( "DirA", mfi.m_bDirA ); - vm.writeEntry( "DirB", mfi.m_bDirB ); - vm.writeEntry( "DirC", mfi.m_bDirC ); - vm.writeEntry( "LinkA", mfi.m_bLinkA ); - vm.writeEntry( "LinkB", mfi.m_bLinkB ); - vm.writeEntry( "LinkC", mfi.m_bLinkC ); - vm.writeEntry( "OperationComplete", mfi.m_bOperationComplete ); - //bool m_bSimOpComplete ); - - vm.writeEntry( "AgeA", (int) mfi.m_ageA ); - vm.writeEntry( "AgeB", (int) mfi.m_ageB ); - vm.writeEntry( "AgeC", (int) mfi.m_ageC ); - vm.writeEntry( "ConflictingAges", mfi.m_bConflictingAges ); // Equal age but files are not! - - //FileAccess m_fileInfoA; - //FileAccess m_fileInfoB; - //FileAccess m_fileInfoC; - - //TotalDiffStatus m_totalDiffStatus; - - vm.save(ts); - - ts << "}\n"; - - return ts; -} - -void DirectoryMergeWindow::slotSaveMergeState() -{ - //slotStatusMsg(i18n("Saving Directory Merge State ...")); - - //QString s = KFileDialog::getSaveURL( QDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); - QString s = KFileDialog::getSaveFileName( QDir::currentDirPath(), 0, this, i18n("Save Directory Merge State As...") ); - if(!s.isEmpty()) - { - m_dirMergeStateFilename = s; - - - QFile file(m_dirMergeStateFilename); - bool bSuccess = file.open( QIODevice::WriteOnly ); - if ( bSuccess ) - { - QTextStream ts( &file ); - - Q3ListViewItemIterator it( this ); - while ( it.current() ) { - DirMergeItem* item = static_cast(it.current()); - MergeFileInfos* pMFI = item->m_pMFI; - ts << *pMFI; - ++it; - } - } - } - - //slotStatusMsg(i18n("Ready.")); - -} - -void DirectoryMergeWindow::slotLoadMergeState() -{ -} - -void DirectoryMergeWindow::updateFileVisibilities() -{ - bool bShowIdentical = m_pDirShowIdenticalFiles->isChecked(); - bool bShowDifferent = m_pDirShowDifferentFiles->isChecked(); - bool bShowOnlyInA = m_pDirShowFilesOnlyInA->isChecked(); - bool bShowOnlyInB = m_pDirShowFilesOnlyInB->isChecked(); - bool bShowOnlyInC = m_pDirShowFilesOnlyInC->isChecked(); - bool bThreeDirs = m_dirC.isValid(); - m_pSelection1Item = 0; - m_pSelection2Item = 0; - m_pSelection3Item = 0; - - Q3ListViewItem* p = firstChild(); - while(p) - { - DirMergeItem* pDMI = static_cast(p); - MergeFileInfos* pMFI = pDMI->m_pMFI; - bool bDir = pMFI->m_bDirA || pMFI->m_bDirB || pMFI->m_bDirC; - bool bExistsEverywhere = pMFI->m_bExistsInA && pMFI->m_bExistsInB && (pMFI->m_bExistsInC || !bThreeDirs); - int existCount = int(pMFI->m_bExistsInA) + int(pMFI->m_bExistsInB) + int(pMFI->m_bExistsInC); - bool bVisible = - ( bShowIdentical && bExistsEverywhere && pMFI->m_bEqualAB && (pMFI->m_bEqualAC || !bThreeDirs) ) - || ( (bShowDifferent||bDir) && existCount>=2 && (!pMFI->m_bEqualAB || !(pMFI->m_bEqualAC || !bThreeDirs))) - || ( bShowOnlyInA && pMFI->m_bExistsInA && !pMFI->m_bExistsInB && !pMFI->m_bExistsInC ) - || ( bShowOnlyInB && !pMFI->m_bExistsInA && pMFI->m_bExistsInB && !pMFI->m_bExistsInC ) - || ( bShowOnlyInC && !pMFI->m_bExistsInA && !pMFI->m_bExistsInB && pMFI->m_bExistsInC ); - - QString fileName = pMFI->m_subPath.section( '/', -1 ); - bVisible = bVisible && ( - bDir && ! wildcardMultiMatch( m_pOptions->m_DmDirAntiPattern, fileName, m_bCaseSensitive ) - || wildcardMultiMatch( m_pOptions->m_DmFilePattern, fileName, m_bCaseSensitive ) - && !wildcardMultiMatch( m_pOptions->m_DmFileAntiPattern, fileName, m_bCaseSensitive ) ); - - p->setVisible(bVisible); - p = treeIterator( p, true, true ); - } -} - -void DirectoryMergeWindow::slotShowIdenticalFiles() { m_pOptions->m_bDmShowIdenticalFiles=m_pDirShowIdenticalFiles->isChecked(); - updateFileVisibilities(); } -void DirectoryMergeWindow::slotShowDifferentFiles() { updateFileVisibilities(); } -void DirectoryMergeWindow::slotShowFilesOnlyInA() { updateFileVisibilities(); } -void DirectoryMergeWindow::slotShowFilesOnlyInB() { updateFileVisibilities(); } -void DirectoryMergeWindow::slotShowFilesOnlyInC() { updateFileVisibilities(); } - -void DirectoryMergeWindow::slotSynchronizeDirectories() { } -void DirectoryMergeWindow::slotChooseNewerFiles() { } - -void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ) -{ -#include "xpm/startmerge.xpm" -#include "xpm/showequalfiles.xpm" -#include "xpm/showfilesonlyina.xpm" -#include "xpm/showfilesonlyinb.xpm" -#include "xpm/showfilesonlyinc.xpm" - DirectoryMergeWindow* p = this; - - m_pDirStartOperation = new KAction(i18n("Start/Continue Directory Merge"), Qt::Key_F7, p, SLOT(slotRunOperationForAllItems()), ac, "dir_start_operation"); - m_pDirRunOperationForCurrentItem = new KAction(i18n("Run Operation for Current Item"), Qt::Key_F6, p, SLOT(slotRunOperationForCurrentItem()), ac, "dir_run_operation_for_current_item"); - m_pDirCompareCurrent = new KAction(i18n("Compare Selected File"), 0, p, SLOT(compareCurrentFile()), ac, "dir_compare_current"); - m_pDirMergeCurrent = new KAction(i18n("Merge Current File"), 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"); - m_pDirSaveMergeState = 0; //new KAction(i18n("Save Directory Merge State ..."), 0, p, SLOT(slotSaveMergeState()), ac, "dir_save_merge_state"); - m_pDirLoadMergeState = 0; //new KAction(i18n("Load Directory Merge State ..."), 0, p, SLOT(slotLoadMergeState()), ac, "dir_load_merge_state"); - m_pDirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, p, SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere"); - m_pDirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, p, SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere"); - m_pDirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, p, SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere"); - m_pDirAutoChoiceEverywhere = new KAction(i18n("Auto-Choose Operation for All Items"), 0, p, SLOT(slotAutoChooseEverywhere()), ac, "dir_autochoose_everywhere"); - m_pDirDoNothingEverywhere = new KAction(i18n("No Operation for All Items"), 0, p, SLOT(slotNoOpEverywhere()), ac, "dir_nothing_everywhere"); - -// m_pDirSynchronizeDirectories = new KToggleAction(i18n("Synchronize Directories"), 0, this, SLOT(slotSynchronizeDirectories()), ac, "dir_synchronize_directories"); -// m_pDirChooseNewerFiles = new KToggleAction(i18n("Copy Newer Files Instead of Merging"), 0, this, SLOT(slotChooseNewerFiles()), ac, "dir_choose_newer_files"); - - m_pDirShowIdenticalFiles = new KToggleAction(i18n("Show Identical Files"), 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"), 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 ); - - m_pDirCompareExplicit = new KAction(i18n("Compare Explicitly Selected Files"), 0, p, SLOT(slotCompareExplicitlySelectedFiles()), ac, "dir_compare_explicitly_selected_files"); - m_pDirMergeExplicit = new KAction(i18n("Merge Explicitly Selected Files"), 0, p, SLOT(slotMergeExplicitlySelectedFiles()), ac, "dir_merge_explicitly_selected_files"); - - m_pDirCurrentDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_do_nothing"); - m_pDirCurrentChooseA = new KAction(i18n("A"), 0, p, SLOT(slotCurrentChooseA()), ac, "dir_current_choose_a"); - m_pDirCurrentChooseB = new KAction(i18n("B"), 0, p, SLOT(slotCurrentChooseB()), ac, "dir_current_choose_b"); - m_pDirCurrentChooseC = new KAction(i18n("C"), 0, p, SLOT(slotCurrentChooseC()), ac, "dir_current_choose_c"); - m_pDirCurrentMerge = new KAction(i18n("Merge"), 0, p, SLOT(slotCurrentMerge()), ac, "dir_current_merge"); - m_pDirCurrentDelete = new KAction(i18n("Delete (if exists)"), 0, p, SLOT(slotCurrentDelete()), ac, "dir_current_delete"); - - m_pDirCurrentSyncDoNothing = new KAction(i18n("Do Nothing"), 0, p, SLOT(slotCurrentDoNothing()), ac, "dir_current_sync_do_nothing"); - m_pDirCurrentSyncCopyAToB = new KAction(i18n("Copy A to B"), 0, p, SLOT(slotCurrentCopyAToB()), ac, "dir_current_sync_copy_a_to_b" ); - m_pDirCurrentSyncCopyBToA = new KAction(i18n("Copy B to A"), 0, p, SLOT(slotCurrentCopyBToA()), ac, "dir_current_sync_copy_b_to_a" ); - m_pDirCurrentSyncDeleteA = new KAction(i18n("Delete A"), 0, p, SLOT(slotCurrentDeleteA()), ac,"dir_current_sync_delete_a"); - m_pDirCurrentSyncDeleteB = new KAction(i18n("Delete B"), 0, p, SLOT(slotCurrentDeleteB()), ac,"dir_current_sync_delete_b"); - m_pDirCurrentSyncDeleteAAndB = new KAction(i18n("Delete A && B"), 0, p, SLOT(slotCurrentDeleteAAndB()), ac,"dir_current_sync_delete_a_and_b"); - m_pDirCurrentSyncMergeToA = new KAction(i18n("Merge to A"), 0, p, SLOT(slotCurrentMergeToA()), ac,"dir_current_sync_merge_to_a"); - m_pDirCurrentSyncMergeToB = new KAction(i18n("Merge to B"), 0, p, SLOT(slotCurrentMergeToB()), ac,"dir_current_sync_merge_to_b"); - m_pDirCurrentSyncMergeToAAndB = new KAction(i18n("Merge to A && B"), 0, p, SLOT(slotCurrentMergeToAAndB()), ac,"dir_current_sync_merge_to_a_and_b"); - - -} - - -void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, - KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ) -{ - m_pDirStartOperation->setEnabled( bDirCompare ); - m_pDirRunOperationForCurrentItem->setEnabled( bDirCompare ); - m_pDirFoldAll->setEnabled( bDirCompare ); - m_pDirUnfoldAll->setEnabled( bDirCompare ); - - m_pDirCompareCurrent->setEnabled( bDirCompare && isVisible() && isFileSelected() ); - - m_pDirMergeCurrent->setEnabled( bDirCompare && isVisible() && isFileSelected() - || bDiffWindowVisible ); - - m_pDirRescan->setEnabled( bDirCompare ); - - m_pDirAutoChoiceEverywhere->setEnabled( bDirCompare && isVisible() ); - m_pDirDoNothingEverywhere->setEnabled( bDirCompare && isVisible() ); - m_pDirChooseAEverywhere->setEnabled( bDirCompare && isVisible() ); - m_pDirChooseBEverywhere->setEnabled( bDirCompare && isVisible() ); - m_pDirChooseCEverywhere->setEnabled( bDirCompare && isVisible() ); - - bool bThreeDirs = m_dirC.isValid(); - - Q3ListViewItem* lvi = currentItem(); - DirMergeItem* pDMI = lvi==0 ? 0 : static_cast(lvi); - MergeFileInfos* pMFI = pDMI==0 ? 0 : pDMI->m_pMFI; - - bool bItemActive = bDirCompare && isVisible() && pMFI!=0;// && hasFocus(); - bool bMergeMode = bThreeDirs || !m_bSyncMode; - bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI); - - bool bDirWindowHasFocus = isVisible() && hasFocus(); - - m_pDirShowIdenticalFiles->setEnabled( bDirCompare && isVisible() ); - m_pDirShowDifferentFiles->setEnabled( bDirCompare && isVisible() ); - m_pDirShowFilesOnlyInA->setEnabled( bDirCompare && isVisible() ); - m_pDirShowFilesOnlyInB->setEnabled( bDirCompare && isVisible() ); - m_pDirShowFilesOnlyInC->setEnabled( bDirCompare && isVisible() && bThreeDirs ); - - m_pDirCompareExplicit->setEnabled( bDirCompare && isVisible() && m_pSelection2Item!=0 ); - m_pDirMergeExplicit->setEnabled( bDirCompare && isVisible() && m_pSelection2Item!=0 ); - - m_pDirCurrentDoNothing->setEnabled( bItemActive && bMergeMode ); - m_pDirCurrentChooseA->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInA ); - m_pDirCurrentChooseB->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInB ); - m_pDirCurrentChooseC->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInC ); - m_pDirCurrentMerge->setEnabled( bItemActive && bMergeMode && !bFTConflict ); - m_pDirCurrentDelete->setEnabled( bItemActive && bMergeMode ); - if ( bDirWindowHasFocus ) - { - chooseA->setEnabled( bItemActive && pMFI->m_bExistsInA ); - chooseB->setEnabled( bItemActive && pMFI->m_bExistsInB ); - chooseC->setEnabled( bItemActive && pMFI->m_bExistsInC ); - chooseA->setChecked( false ); - chooseB->setChecked( false ); - chooseC->setChecked( false ); - } - - m_pDirCurrentSyncDoNothing->setEnabled( bItemActive && !bMergeMode ); - m_pDirCurrentSyncCopyAToB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA ); - m_pDirCurrentSyncCopyBToA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB ); - m_pDirCurrentSyncDeleteA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA ); - m_pDirCurrentSyncDeleteB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB ); - m_pDirCurrentSyncDeleteAAndB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB && pMFI->m_bExistsInB ); - m_pDirCurrentSyncMergeToA->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); - m_pDirCurrentSyncMergeToB->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); - m_pDirCurrentSyncMergeToAAndB->setEnabled( bItemActive && !bMergeMode && !bFTConflict ); -} - - -//#include "directorymergewindow.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/directorymergewindow.h --- a/kdiff3/src/directorymergewindow.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,360 +0,0 @@ -/*************************************************************************** - directorymergewindow.h - ------------------- - begin : Sat Oct 19 2002 - copyright : (C) 2002-2005 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef DIRECTORY_MERGE_WINDOW_H -#define DIRECTORY_MERGE_WINDOW_H - -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include -#include -#include "common.h" -#include "fileaccess.h" -#include "diff.h" //TotalDiffStatus - -class OptionDialog; -class KIconLoader; -class StatusInfo; -class DirectoryMergeInfo; -class OneDirectoryInfo; -class QLabel; -class KAction; -class KToggleAction; -class KActionCollection; -class TotalDiffStatus; - -enum e_MergeOperation -{ - eTitleId, - eNoOperation, - // Operations in sync mode (with only two directories): - eCopyAToB, eCopyBToA, eDeleteA, eDeleteB, eDeleteAB, eMergeToA, eMergeToB, eMergeToAB, - - // Operations in merge mode (with two or three directories) - eCopyAToDest, eCopyBToDest, eCopyCToDest, eDeleteFromDest, eMergeABCToDest, - eMergeABToDest, - eConflictingFileTypes, // Error - eConflictingAges // Equal age but files are not! -}; - -class DirMergeItem; - -enum e_Age { eNew, eMiddle, eOld, eNotThere, eAgeEnd }; - -class MergeFileInfos -{ -public: - MergeFileInfos(){ m_bEqualAB=false; m_bEqualAC=false; m_bEqualBC=false; - m_pDMI=0; m_pParent=0; - m_bExistsInA=false;m_bExistsInB=false;m_bExistsInC=false; - m_bDirA=false; m_bDirB=false; m_bDirC=false; - m_bLinkA=false; m_bLinkB=false; m_bLinkC=false; - m_bOperationComplete=false; m_bSimOpComplete = false; - m_eMergeOperation=eNoOperation; - m_ageA = eNotThere; m_ageB=eNotThere; m_ageC=eNotThere; - m_bConflictingAges=false; } - bool operator>( const MergeFileInfos& ); - QString m_subPath; - - bool m_bExistsInA; - bool m_bExistsInB; - bool m_bExistsInC; - bool m_bEqualAB; - bool m_bEqualAC; - bool m_bEqualBC; - DirMergeItem* m_pDMI; - MergeFileInfos* m_pParent; - e_MergeOperation m_eMergeOperation; - void setMergeOperation( e_MergeOperation eMOp ); - bool m_bDirA; - bool m_bDirB; - bool m_bDirC; - bool m_bLinkA; - bool m_bLinkB; - bool m_bLinkC; - bool m_bOperationComplete; - bool m_bSimOpComplete; - e_Age m_ageA; - e_Age m_ageB; - e_Age m_ageC; - bool m_bConflictingAges; // Equal age but files are not! - - FileAccess m_fileInfoA; - FileAccess m_fileInfoB; - FileAccess m_fileInfoC; - - TotalDiffStatus m_totalDiffStatus; -}; - -class DirMergeItem : public Q3ListViewItem -{ -public: - DirMergeItem( Q3ListView* pParent, const QString&, MergeFileInfos*); - DirMergeItem( DirMergeItem* pParent, const QString&, MergeFileInfos*); - ~DirMergeItem(); - MergeFileInfos* m_pMFI; - 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 Q3ListView -{ - Q_OBJECT -public: - DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader ); - ~DirectoryMergeWindow(); - void setDirectoryMergeInfo(DirectoryMergeInfo* p){ m_pDirectoryMergeInfo=p; } - bool init( - FileAccess& dirA, - FileAccess& dirB, - FileAccess& dirC, - FileAccess& dirDest, - bool bDirectoryMerge - ); - bool isFileSelected(); - void allowResizeEvents(bool bAllowResizeEvents); - bool isDirectoryMergeInProgress() { return m_bRealMergeStarted; } - int totalColumnWidth(); - bool isSyncMode() { return m_bSyncMode; } - bool isScanning() { return m_bScanning; } - void initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac ); - void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible, - KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC ); - void updateFileVisibilities(); - - virtual void keyPressEvent( QKeyEvent* e ); - virtual void focusInEvent( QFocusEvent* e ); - virtual void focusOutEvent( QFocusEvent* e ); - -public slots: - void reload(); - void mergeCurrentFile(); - void compareCurrentFile(); - void slotRunOperationForAllItems(); - void slotRunOperationForCurrentItem(); - void mergeResultSaved(const QString& fileName); - void slotChooseAEverywhere(); - void slotChooseBEverywhere(); - void slotChooseCEverywhere(); - void slotAutoChooseEverywhere(); - void slotNoOpEverywhere(); - void slotFoldAllSubdirs(); - void slotUnfoldAllSubdirs(); - void slotShowIdenticalFiles(); - void slotShowDifferentFiles(); - void slotShowFilesOnlyInA(); - void slotShowFilesOnlyInB(); - void slotShowFilesOnlyInC(); - - void slotSynchronizeDirectories(); - void slotChooseNewerFiles(); - - void slotCompareExplicitlySelectedFiles(); - void slotMergeExplicitlySelectedFiles(); - - // Merge current item (merge mode) - void slotCurrentDoNothing(); - void slotCurrentChooseA(); - void slotCurrentChooseB(); - void slotCurrentChooseC(); - void slotCurrentMerge(); - void slotCurrentDelete(); - // Sync current item - void slotCurrentCopyAToB(); - void slotCurrentCopyBToA(); - void slotCurrentDeleteA(); - void slotCurrentDeleteB(); - void slotCurrentDeleteAAndB(); - void slotCurrentMergeToA(); - void slotCurrentMergeToB(); - void slotCurrentMergeToAAndB(); - - void slotSaveMergeState(); - void slotLoadMergeState(); - -protected: - void mergeContinue( bool bStart, bool bVerbose ); - void resizeEvent(QResizeEvent* e); - bool m_bAllowResizeEvents; - - void prepareListView(ProgressProxy& pp); - void calcSuggestedOperation( MergeFileInfos& mfi, e_MergeOperation eDefaultOperation ); - void setAllMergeOperations( e_MergeOperation eDefaultOperation ); - friend class MergeFileInfos; - - bool canContinue(); - void prepareMergeStart( Q3ListViewItem* pBegin, Q3ListViewItem* pEnd, bool bVerbose ); - bool executeMergeOperation( MergeFileInfos& mfi, bool& bSingleFileMerge ); - - void scanDirectory( const QString& dirName, t_DirectoryList& dirList ); - void scanLocalDirectory( const QString& dirName, t_DirectoryList& dirList ); - void fastFileComparison( FileAccess& fi1, FileAccess& fi2, - bool& bEqual, bool& bError, QString& status ); - void compareFilesAndCalcAges( MergeFileInfos& mfi ); - - QString fullNameA( const MergeFileInfos& mfi ) - { return m_dirA.absFilePath() + "/" + mfi.m_subPath; } - QString fullNameB( const MergeFileInfos& mfi ) - { return m_dirB.absFilePath() + "/" + mfi.m_subPath; } - QString fullNameC( const MergeFileInfos& mfi ) - { return m_dirC.absFilePath() + "/" + mfi.m_subPath; } - QString fullNameDest( const MergeFileInfos& mfi ) - { return m_dirDestInternal.absFilePath() + "/" + mfi.m_subPath; } - - bool copyFLD( const QString& srcName, const QString& destName ); - bool deleteFLD( const QString& name, bool bCreateBackup ); - bool makeDir( const QString& name, bool bQuiet=false ); - bool renameFLD( const QString& srcName, const QString& destName ); - bool mergeFLD( const QString& nameA,const QString& nameB,const QString& nameC, - const QString& nameDest, bool& bSingleFileMerge ); - - FileAccess m_dirA; - FileAccess m_dirB; - FileAccess m_dirC; - FileAccess m_dirDest; - FileAccess m_dirDestInternal; - - QString m_dirMergeStateFilename; - - std::map m_fileMergeMap; - - bool m_bFollowDirLinks; - bool m_bFollowFileLinks; - bool m_bSimulatedMergeStarted; - bool m_bRealMergeStarted; - bool m_bError; - bool m_bSyncMode; - bool m_bDirectoryMerge; // if true, then merge is the default operation, otherwise it's diff. - bool m_bCaseSensitive; - - bool m_bScanning; // true while in init() - - OptionDialog* m_pOptions; - KIconLoader* m_pIconLoader; - DirectoryMergeInfo* m_pDirectoryMergeInfo; - StatusInfo* m_pStatusInfo; - - typedef std::list MergeItemList; - MergeItemList m_mergeItemList; - MergeItemList::iterator m_currentItemForOperation; - - DirMergeItem* m_pSelection1Item; - int m_selection1Column; - DirMergeItem* m_pSelection2Item; - int m_selection2Column; - DirMergeItem* m_pSelection3Item; - int m_selection3Column; - void selectItemAndColumn(DirMergeItem* pDMI, int c, bool bContextMenu); - friend class DirMergeItem; - - KAction* m_pDirStartOperation; - KAction* m_pDirRunOperationForCurrentItem; - KAction* m_pDirCompareCurrent; - KAction* m_pDirMergeCurrent; - KAction* m_pDirRescan; - KAction* m_pDirChooseAEverywhere; - KAction* m_pDirChooseBEverywhere; - KAction* m_pDirChooseCEverywhere; - KAction* m_pDirAutoChoiceEverywhere; - KAction* m_pDirDoNothingEverywhere; - KAction* m_pDirFoldAll; - KAction* m_pDirUnfoldAll; - - KToggleAction* m_pDirShowIdenticalFiles; - KToggleAction* m_pDirShowDifferentFiles; - KToggleAction* m_pDirShowFilesOnlyInA; - KToggleAction* m_pDirShowFilesOnlyInB; - KToggleAction* m_pDirShowFilesOnlyInC; - - KToggleAction* m_pDirSynchronizeDirectories; - KToggleAction* m_pDirChooseNewerFiles; - - KAction* m_pDirCompareExplicit; - KAction* m_pDirMergeExplicit; - - KAction* m_pDirCurrentDoNothing; - KAction* m_pDirCurrentChooseA; - KAction* m_pDirCurrentChooseB; - KAction* m_pDirCurrentChooseC; - KAction* m_pDirCurrentMerge; - KAction* m_pDirCurrentDelete; - - KAction* m_pDirCurrentSyncDoNothing; - KAction* m_pDirCurrentSyncCopyAToB; - KAction* m_pDirCurrentSyncCopyBToA; - KAction* m_pDirCurrentSyncDeleteA; - KAction* m_pDirCurrentSyncDeleteB; - KAction* m_pDirCurrentSyncDeleteAAndB; - KAction* m_pDirCurrentSyncMergeToA; - KAction* m_pDirCurrentSyncMergeToB; - KAction* m_pDirCurrentSyncMergeToAAndB; - - KAction* m_pDirSaveMergeState; - KAction* m_pDirLoadMergeState; -signals: - void startDiffMerge(QString fn1,QString fn2, QString fn3, QString ofn, QString,QString,QString,TotalDiffStatus*); - void checkIfCanContinue( bool* pbContinue ); - void updateAvailabilities(); - void statusBarMessage( const QString& msg ); -protected slots: - 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 Q3Frame -{ - Q_OBJECT -public: - DirectoryMergeInfo( QWidget* pParent ); - void setInfo( - const FileAccess& APath, - const FileAccess& BPath, - const FileAccess& CPath, - const FileAccess& DestPath, - MergeFileInfos& mfi ); - Q3ListView* getInfoList() {return m_pInfoList;} - virtual bool eventFilter( QObject* o, QEvent* e ); -signals: - void gotFocus(); -private: - QLabel* m_pInfoA; - QLabel* m_pInfoB; - QLabel* m_pInfoC; - QLabel* m_pInfoDest; - - QLabel* m_pA; - QLabel* m_pB; - QLabel* m_pC; - QLabel* m_pDest; - - Q3ListView* m_pInfoList; -}; - - -#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/fileaccess.cpp --- a/kdiff3/src/fileaccess.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1782 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2003 by Joachim Eibl * - * joachim.eibl at gmx.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - ***************************************************************************/ - -#include "fileaccess.h" -#include -#include -#include -#include "optiondialog.h" -#include -#include -#include -#include - -#include -//Added by qt3to4: -#include -#include -#include - -#include "common.h" -#include -#include -#include -#include -#include -#include - -#include -#include - -#ifdef _WIN32 -#include -#include -#include -#else -#include // Needed for creating symbolic links via symlink(). -#include -#endif - - -ProgressDialog* g_pProgressDialog=0; - - -FileAccess::FileAccess( const QString& name, bool bWantToWrite ) -{ - setFile( name, bWantToWrite ); -} - -FileAccess::FileAccess() -{ - m_bValidData = false; - m_size = 0; - m_creationTime = QDateTime(); - m_accessTime = QDateTime(); - m_modificationTime = QDateTime(); - m_bReadable = false; - m_bWritable = false; - m_bExecutable = false; - m_bLocal = false; - m_bHidden = false; - m_bExists = false; - m_bFile = false; - m_bDir = false; - m_bSymLink = false; -} - -FileAccess::~FileAccess() -{ - if( !m_localCopy.isEmpty() ) - { - removeTempFile( m_localCopy ); - } -} - -void FileAccess::setFile( const QString& name, bool bWantToWrite ) -{ - m_url = KURL::fromPathOrURL( name ); - m_bValidData = false; - - m_size = 0; - m_creationTime = QDateTime(); - m_accessTime = QDateTime(); - m_modificationTime = QDateTime(); - m_bReadable = false; - m_bWritable = false; - m_bExecutable = false; - m_bHidden = false; - m_bExists = false; - m_bFile = false; - m_bDir = false; - m_bSymLink = false; - m_linkTarget = ""; - m_fileType = -1; - m_bLocal = true; - - // Note: Checking if the filename-string is empty is necessary for Win95/98/ME. - // The isFile() / isDir() queries would cause the program to crash. - // (This is a Win95-bug which has been corrected only in WinNT/2000/XP.) - if ( !name.isEmpty() ) - { - // FileAccess tries to detect if the given name is an URL or a local file. - // This is a problem if the filename looks like an URL (i.e. contains a colon ':'). - // e.g. "file:f.txt" is a valid filename. - // Most of the time it is sufficient to check if the file exists locally. - // 2 Problems remain: - // 1. When the local file exists and the remote location is wanted nevertheless. (unlikely) - // 2. When the local file doesn't exist and should be written to. - - bool bExistsLocal = QDir().exists(name); - if ( m_url.isLocalFile() || !m_url.isValid() || bExistsLocal ) // assuming that invalid means relative - { - QString localName = name; - if ( !bExistsLocal && m_url.isLocalFile() && name.left(5).lower()=="file:" ) - { - localName = m_url.path(); // I want the path without preceding "file:" - } - QFileInfo fi( localName ); - m_bReadable = fi.isReadable(); - m_bWritable = fi.isWritable(); - m_bExecutable = fi.isExecutable(); - m_creationTime = fi.created(); - m_bHidden = fi.isHidden(); - m_modificationTime = fi.lastModified(); - m_accessTime = fi.lastRead(); - m_size = fi.size(); - m_bSymLink = fi.isSymLink(); - m_bFile = fi.isFile(); - m_bDir = fi.isDir(); - m_bExists = fi.exists(); - m_name = fi.fileName(); - m_path = fi.filePath(); - m_absFilePath= fi.absFilePath(); - if ( m_bSymLink ) m_linkTarget = fi.readLink(); - m_bLocal = true; - m_bValidData = true; - if ( ! m_url.isValid() ) - { - m_url.setPath( m_absFilePath ); - } - - if ( !m_bExists && m_absFilePath.contains("@@") ) - { - // Try reading a clearcase file - m_localCopy = FileAccess::tempFileName(); - QString cmd = "cleartool get -to \"" + m_localCopy + "\" \"" + m_absFilePath + "\""; - ::system( cmd.local8Bit() ); - - QFileInfo fi( m_localCopy ); - m_bReadable = fi.isReadable(); - m_bWritable = fi.isWritable(); - m_bExecutable = fi.isExecutable(); - m_creationTime = fi.created(); - m_bHidden = fi.isHidden(); - m_modificationTime = fi.lastModified(); - m_accessTime = fi.lastRead(); - m_size = fi.size(); - m_bSymLink = fi.isSymLink(); - m_bFile = fi.isFile(); - m_bDir = fi.isDir(); - m_bExists = fi.exists(); - } - } - else - { - m_absFilePath = name; - m_name = m_url.fileName(); - m_bLocal = false; - - FileAccessJobHandler jh( this ); // A friend, which writes to the parameters of this class! - jh.stat(2/*all details*/, bWantToWrite); // returns bSuccess, ignored - - m_path = name; - m_bValidData = true; // After running stat() the variables are initialised - // and valid even if the file doesn't exist and the stat - // query failed. - } - } -} - -void FileAccess::addPath( const QString& txt ) -{ - if ( m_url.isValid() ) - { - m_url.addPath( txt ); - setFile( m_url.url() ); // reinitialise - } - else - { - QString slash = (txt.isEmpty() || txt[0]=='/') ? "" : "/"; - setFile( absFilePath() + slash + txt ); - } -} - -/* Filetype: - S_IFMT 0170000 bitmask for the file type bitfields - S_IFSOCK 0140000 socket - S_IFLNK 0120000 symbolic link - S_IFREG 0100000 regular file - S_IFBLK 0060000 block device - S_IFDIR 0040000 directory - S_IFCHR 0020000 character device - S_IFIFO 0010000 fifo - S_ISUID 0004000 set UID bit - S_ISGID 0002000 set GID bit (see below) - S_ISVTX 0001000 sticky bit (see below) - - Access: - S_IRWXU 00700 mask for file owner permissions - S_IRUSR 00400 owner has read permission - S_IWUSR 00200 owner has write permission - S_IXUSR 00100 owner has execute permission - S_IRWXG 00070 mask for group permissions - S_IRGRP 00040 group has read permission - S_IWGRP 00020 group has write permission - S_IXGRP 00010 group has execute permission - S_IRWXO 00007 mask for permissions for others (not in group) - S_IROTH 00004 others have read permission - S_IWOTH 00002 others have write permisson - S_IXOTH 00001 others have execute permission -*/ - -#ifdef KREPLACEMENTS_H -void FileAccess::setUdsEntry( const KIO::UDSEntry& ){} // not needed if KDE is not available -#else -void FileAccess::setUdsEntry( const KIO::UDSEntry& e ) -{ - KIO::UDSEntry::const_iterator ei; - long acc = 0; - long fileType = 0; - for( ei=e.begin(); ei!=e.end(); ++ei ) - { - const KIO::UDSAtom& a = *ei; - switch( a.m_uds ) - { - case KIO::UDS_SIZE : m_size = a.m_long; break; - case KIO::UDS_USER : m_user = a.m_str; break; - case KIO::UDS_GROUP : m_group = a.m_str; break; - case KIO::UDS_NAME : m_path = a.m_str; break; // During listDir the relative path is given here. - case KIO::UDS_MODIFICATION_TIME : m_modificationTime.setTime_t( a.m_long ); break; - case KIO::UDS_ACCESS_TIME : m_accessTime.setTime_t( a.m_long ); break; - case KIO::UDS_CREATION_TIME : m_creationTime.setTime_t( a.m_long ); break; - case KIO::UDS_LINK_DEST : m_linkTarget = a.m_str; break; - case KIO::UDS_ACCESS : - { - acc = a.m_long; - m_bReadable = (acc & S_IRUSR)!=0; - m_bWritable = (acc & S_IWUSR)!=0; - m_bExecutable = (acc & S_IXUSR)!=0; - break; - } - case KIO::UDS_FILE_TYPE : - { - fileType = a.m_long; - m_bDir = ( fileType & S_IFMT ) == S_IFDIR; - m_bFile = ( fileType & S_IFMT ) == S_IFREG; - m_bSymLink = ( fileType & S_IFMT ) == S_IFLNK; - m_bExists = fileType != 0; - m_fileType = fileType; - break; - } - - case KIO::UDS_URL : // m_url = KURL( a.str ); - break; - case KIO::UDS_MIME_TYPE : break; - case KIO::UDS_GUESSED_MIME_TYPE : break; - case KIO::UDS_XML_PROPERTIES : break; - default: break; - } - } - - m_bExists = acc!=0 || fileType!=0; - - m_bLocal = false; - m_bValidData = true; - m_bSymLink = !m_linkTarget.isEmpty(); - if ( m_name.isEmpty() ) - { - int pos = m_path.findRev('/') + 1; - m_name = m_path.mid( pos ); - } - m_bHidden = m_name[0]=='.'; -} -#endif - - -bool FileAccess::isValid() const { return m_bValidData; } -bool FileAccess::isFile() const { return m_bFile; } -bool FileAccess::isDir() const { return m_bDir; } -bool FileAccess::isSymLink() const { return m_bSymLink; } -bool FileAccess::exists() const { return m_bExists; } -long FileAccess::size() const { return m_size; } -KURL FileAccess::url() const { return m_url; } -bool FileAccess::isLocal() const { return m_bLocal; } -bool FileAccess::isReadable() const { return m_bReadable; } -bool FileAccess::isWritable() const { return m_bWritable; } -bool FileAccess::isExecutable() const { return m_bExecutable; } -bool FileAccess::isHidden() const { return m_bHidden; } -QString FileAccess::readLink() const { return m_linkTarget; } -QString FileAccess::absFilePath() const{ return m_absFilePath; } // Full abs path -QString FileAccess::fileName() const { return m_name; } // Just the name-part of the path, without parent directories -QString FileAccess::filePath() const { return m_path; } // The path-string that was used during construction -QString FileAccess::prettyAbsPath() const { return isLocal() ? m_absFilePath : m_url.prettyURL(); } - -QDateTime FileAccess::created() const -{ - return ( m_creationTime.isValid() ? m_creationTime : m_modificationTime ); -} - -QDateTime FileAccess::lastModified() const -{ - return m_modificationTime; -} - -QDateTime FileAccess::lastRead() const -{ - return ( m_accessTime.isValid() ? m_accessTime : m_modificationTime ); -} - -static bool interruptableReadFile( QFile& f, void* pDestBuffer, unsigned long maxLength ) -{ - ProgressProxy pp; - const unsigned long maxChunkSize = 100000; - unsigned long i=0; - while( i " + bakName; - return false; - } - } - return true; -} - -FileAccessJobHandler::FileAccessJobHandler( FileAccess* pFileAccess ) -{ - m_pFileAccess = pFileAccess; - m_bSuccess = false; -} - -bool FileAccessJobHandler::stat( int detail, bool bWantToWrite ) -{ - m_bSuccess = false; - m_pFileAccess->m_statusText = QString(); - KIO::StatJob* pStatJob = KIO::stat( m_pFileAccess->m_url, ! bWantToWrite, detail, false ); - - connect( pStatJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotStatResult(KIO::Job*))); - - g_pProgressDialog->enterEventLoop( pStatJob, i18n("Getting file status: %1").arg(m_pFileAccess->prettyAbsPath()) ); - - return m_bSuccess; -} - -void FileAccessJobHandler::slotStatResult(KIO::Job* pJob) -{ - if ( pJob->error() ) - { - //pJob->showErrorDialog(g_pProgressDialog); - m_pFileAccess->m_bExists = false; - m_bSuccess = true; - } - else - { - m_bSuccess = true; - - m_pFileAccess->m_bValidData = true; - const KIO::UDSEntry e = static_cast(pJob)->statResult(); - - m_pFileAccess->setUdsEntry( e ); - } - - g_pProgressDialog->exitEventLoop(); -} - - -bool FileAccessJobHandler::get(void* pDestBuffer, long maxLength ) -{ - ProgressProxy pp; // Implicitly used in slotPercent() - if ( maxLength>0 && !pp.wasCancelled() ) - { - KIO::TransferJob* pJob = KIO::get( m_pFileAccess->m_url, false /*reload*/, false ); - m_transferredBytes = 0; - m_pTransferBuffer = (char*)pDestBuffer; - m_maxLength = maxLength; - m_bSuccess = false; - m_pFileAccess->m_statusText = QString(); - - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); - connect( pJob, SIGNAL(data(KIO::Job*,const QByteArray &)), this, SLOT(slotGetData(KIO::Job*, const QByteArray&))); - connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); - - g_pProgressDialog->enterEventLoop( pJob, i18n("Reading file: %1").arg(m_pFileAccess->prettyAbsPath()) ); - return m_bSuccess; - } - else - return true; -} - -void FileAccessJobHandler::slotGetData( KIO::Job* pJob, const QByteArray& newData ) -{ - if ( pJob->error() ) - { - pJob->showErrorDialog(g_pProgressDialog); - } - else - { - long length = min2( long(newData.size()), m_maxLength - m_transferredBytes ); - ::memcpy( m_pTransferBuffer + m_transferredBytes, newData.data(), newData.size() ); - m_transferredBytes += length; - } -} - -bool FileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume, int permissions ) -{ - if ( maxLength>0 ) - { - KIO::TransferJob* pJob = KIO::put( m_pFileAccess->m_url, permissions, bOverwrite, bResume, false ); - m_transferredBytes = 0; - m_pTransferBuffer = (char*)pSrcBuffer; - m_maxLength = maxLength; - m_bSuccess = false; - m_pFileAccess->m_statusText = QString(); - - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotPutJobResult(KIO::Job*))); - connect( pJob, SIGNAL(dataReq(KIO::Job*, QByteArray&)), this, SLOT(slotPutData(KIO::Job*, QByteArray&))); - connect( pJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); - - g_pProgressDialog->enterEventLoop( pJob, i18n("Writing file: %1").arg(m_pFileAccess->prettyAbsPath()) ); - return m_bSuccess; - } - else - return true; -} - -void FileAccessJobHandler::slotPutData( KIO::Job* pJob, QByteArray& data ) -{ - if ( pJob->error() ) - { - pJob->showErrorDialog(g_pProgressDialog); - } - else - { - long maxChunkSize = 100000; - long length = min2( maxChunkSize, m_maxLength - m_transferredBytes ); - data.resize( length ); - if ( data.size()==length ) - { - if ( length>0 ) - { - ::memcpy( data.data(), m_pTransferBuffer + m_transferredBytes, data.size() ); - m_transferredBytes += length; - } - } - else - { - KMessageBox::error( g_pProgressDialog, i18n("Out of memory") ); - data.resize(0); - m_bSuccess = false; - } - } -} - -void FileAccessJobHandler::slotPutJobResult(KIO::Job* pJob) -{ - if ( pJob->error() ) - { - pJob->showErrorDialog(g_pProgressDialog); - } - else - { - m_bSuccess = (m_transferredBytes == m_maxLength); // Special success condition - } - g_pProgressDialog->exitEventLoop(); // Close the dialog, return from exec() -} - -bool FileAccessJobHandler::mkDir( const QString& dirName ) -{ - KURL dirURL = KURL::fromPathOrURL( dirName ); - if ( dirName.isEmpty() ) - return false; - else if ( dirURL.isLocalFile() ) - { - return QDir().mkdir( dirURL.path() ); - } - else - { - m_bSuccess = false; - KIO::SimpleJob* pJob = KIO::mkdir( dirURL ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); - - g_pProgressDialog->enterEventLoop( pJob, i18n("Making directory: %1").arg(dirName) ); - return m_bSuccess; - } -} - -bool FileAccessJobHandler::rmDir( const QString& dirName ) -{ - KURL dirURL = KURL::fromPathOrURL( dirName ); - if ( dirName.isEmpty() ) - return false; - else if ( dirURL.isLocalFile() ) - { - return QDir().rmdir( dirURL.path() ); - } - else - { - m_bSuccess = false; - KIO::SimpleJob* pJob = KIO::rmdir( dirURL ); - connect( pJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotSimpleJobResult(KIO::Job*))); - - g_pProgressDialog->enterEventLoop(pJob, i18n("Removing directory: %1").arg(dirName)); - return m_bSuccess; - } -} - -bool FileAccessJobHandler::removeFile( const QString& fileName ) -{ - if ( fileName.isEmpty() ) - return false; - else - { - m_bSuccess = 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) ); - return m_bSuccess; - } -} - -bool FileAccessJobHandler::symLink( const QString& linkTarget, const QString& linkLocation ) -{ - if ( linkTarget.isEmpty() || linkLocation.isEmpty() ) - return false; - else - { - m_bSuccess = 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, - i18n("Creating symbolic link: %1 -> %2").arg(linkLocation).arg(linkTarget) ); - return m_bSuccess; - } -} - -bool FileAccessJobHandler::rename( const QString& dest ) -{ - KURL kurl = KURL::fromPathOrURL( dest ); - if ( dest.isEmpty() ) - return false; - else if ( m_pFileAccess->isLocal() && kurl.isLocalFile() ) - { - return QDir().rename( m_pFileAccess->absFilePath(), kurl.path() ); - } - else - { - bool bOverwrite = false; - bool bResume = false; - bool bShowProgress = false; - int permissions=-1; - m_bSuccess = false; - 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))); - - g_pProgressDialog->enterEventLoop( pJob, - i18n("Renaming file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) ); - return m_bSuccess; - } -} - -void FileAccessJobHandler::slotSimpleJobResult(KIO::Job* pJob) -{ - if ( pJob->error() ) - { - pJob->showErrorDialog(g_pProgressDialog); - } - else - { - m_bSuccess = true; - } - g_pProgressDialog->exitEventLoop(); // Close the dialog, return from exec() -} - - -// Copy local or remote files. -bool FileAccessJobHandler::copyFile( const QString& dest ) -{ - ProgressProxy pp; - KURL destUrl = KURL::fromPathOrURL( dest ); - m_pFileAccess->m_statusText = QString(); - if ( ! m_pFileAccess->isLocal() || ! destUrl.isLocalFile() ) // if either url is nonlocal - { - bool bOverwrite = false; - bool bResume = false; - 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, 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, - i18n("Copying file: %1 -> %2").arg(m_pFileAccess->prettyAbsPath()).arg(dest) ); - - return m_bSuccess; - // Note that the KIO-slave preserves the original date, if this is supported. - } - - // Both files are local: - QString srcName = m_pFileAccess->absFilePath(); - QString destName = dest; - QFile srcFile( srcName ); - QFile destFile( destName ); - 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( QIODevice::WriteOnly ); - if ( bWriteSuccess == false ) - { - m_pFileAccess->m_statusText = i18n("Error during file copy operation: Opening file for writing failed. Filename: %1").arg(destName); - return false; - } - -#if QT_VERSION==230 - typedef long Q_LONG; -#endif - std::vector buffer(100000); - Q_LONG bufSize = buffer.size(); - Q_LONG srcSize = srcFile.size(); - while ( srcSize > 0 && !pp.wasCancelled() ) - { - Q_LONG readSize = srcFile.readBlock( &buffer[0], min2( srcSize, bufSize ) ); - if ( readSize==-1 || readSize==0 ) - { - m_pFileAccess->m_statusText = i18n("Error during file copy operation: Reading failed. Filename: %1").arg(srcName); - return false; - } - srcSize -= readSize; - while ( readSize > 0 ) - { - Q_LONG writeSize = destFile.writeBlock( &buffer[0], readSize ); - if ( writeSize==-1 || writeSize==0 ) - { - m_pFileAccess->m_statusText = i18n("Error during file copy operation: Writing failed. Filename: %1").arg(destName); - return false; - } - readSize -= writeSize; - } - destFile.flush(); - pp.setCurrent( (double)(srcFile.size()-srcSize)/srcFile.size(), false ); - } - srcFile.close(); - destFile.close(); - - // Update the times of the destFile -#ifdef _WIN32 - struct _stat srcFileStatus; - int statResult = ::_stat( srcName.ascii(), &srcFileStatus ); - if (statResult==0) - { - _utimbuf destTimes; - destTimes.actime = srcFileStatus.st_atime;/* time of last access */ - destTimes.modtime = srcFileStatus.st_mtime;/* time of last modification */ - - _utime ( destName.ascii(), &destTimes ); - _chmod ( destName.ascii(), srcFileStatus.st_mode ); - } -#else - struct stat srcFileStatus; - int statResult = ::stat( srcName.ascii(), &srcFileStatus ); - if (statResult==0) - { - utimbuf destTimes; - destTimes.actime = srcFileStatus.st_atime;/* time of last access */ - destTimes.modtime = srcFileStatus.st_mtime;/* time of last modification */ - - utime ( destName.ascii(), &destTimes ); - chmod ( destName.ascii(), srcFileStatus.st_mode ); - } -#endif - return true; -} - -bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive ) -{ - QStringList sl = QStringList::split( ";", wildcard ); - - for ( QStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) - { - QRegExp pattern( *it, bCaseSensitive, true /*wildcard mode*/); - if ( pattern.exactMatch( testString ) ) - return true; - } - - return false; -} - - -// class CvsIgnoreList from Cervisia cvsdir.cpp -// Copyright (C) 1999-2002 Bernd Gehrmann -// with elements from class StringMatcher -// Copyright (c) 2003 Andr�Woebeking -// Modifications for KDiff3 by Joachim Eibl -class CvsIgnoreList -{ -public: - CvsIgnoreList(){} - void init(FileAccess& dir, bool bUseLocalCvsIgnore ); - bool matches(const QString& fileName, bool bCaseSensitive ) const; - -private: - void addEntriesFromString(const QString& str); - void addEntriesFromFile(const QString& name); - void addEntry(const QString& entry); - - QStringList m_exactPatterns; - QStringList m_startPatterns; - QStringList m_endPatterns; - QStringList m_generalPatterns; -}; - - -void CvsIgnoreList::init( FileAccess& dir, bool bUseLocalCvsIgnore ) -{ - static const char *ignorestr = ". .. core RCSLOG tags TAGS RCS SCCS .make.state " - ".nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj " - "*.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$"; - - addEntriesFromString(QString::fromLatin1(ignorestr)); - addEntriesFromFile(QDir::homeDirPath() + "/.cvsignore"); - addEntriesFromString(QString::fromLocal8Bit(::getenv("CVSIGNORE"))); - - if (bUseLocalCvsIgnore) - { - FileAccess file(dir); - file.addPath( ".cvsignore" ); - int size = file.exists() ? file.sizeForReading() : 0; - if ( size>0 ) - { - char* buf=new char[size]; - if (buf!=0) - { - file.readFile( buf, size ); - int pos1 = 0; - for ( int pos = 0; pos<=size; ++pos ) - { - if( pos==size || buf[pos]==' ' || buf[pos]=='\t' || buf[pos]=='\n' || buf[pos]=='\r' ) - { - if (pos>pos1) - { - addEntry( QString::fromLatin1( &buf[pos1], pos-pos1 ) ); - } - ++pos1; - } - } - delete buf; - } - } - } -} - - -void CvsIgnoreList::addEntriesFromString(const QString& str) -{ - int posLast(0); - int pos; - while ((pos = str.find(' ', posLast)) >= 0) - { - if (pos > posLast) - addEntry(str.mid(posLast, pos - posLast)); - posLast = pos + 1; - } - - if (posLast < static_cast(str.length())) - addEntry(str.mid(posLast)); -} - - -void CvsIgnoreList::addEntriesFromFile(const QString &name) -{ - QFile file(name); - - if( file.open(QIODevice::ReadOnly) ) - { - QTextStream stream(&file); - while( !stream.atEnd() ) - { - addEntriesFromString(stream.readLine()); - } - } -} - -void CvsIgnoreList::addEntry(const QString& pattern) -{ - if (pattern != QString("!")) - { - if (pattern.isEmpty()) return; - - // The general match is general but slow. - // Special tests for '*' and '?' at the beginning or end of a pattern - // allow fast checks. - - // Count number of '*' and '?' - unsigned int nofMetaCharacters = 0; - - const QChar* pos; - pos = pattern.unicode(); - const QChar* posEnd; - posEnd=pos + pattern.length(); - while (pos < posEnd) - { - if( *pos==QChar('*') || *pos==QChar('?') ) ++nofMetaCharacters; - ++pos; - } - - if ( nofMetaCharacters==0 ) - { - m_exactPatterns.append(pattern); - } - else if ( nofMetaCharacters==1 ) - { - if ( pattern.constref(0) == QChar('*') ) - { - m_endPatterns.append( pattern.right( pattern.length() - 1) ); - } - else if (pattern.constref(pattern.length() - 1) == QChar('*')) - { - m_startPatterns.append( pattern.left( pattern.length() - 1) ); - } - else - { - m_generalPatterns.append(pattern.local8Bit()); - } - } - else - { - m_generalPatterns.append(pattern.local8Bit()); - } - } - else - { - m_exactPatterns.clear(); - m_startPatterns.clear(); - m_endPatterns.clear(); - m_generalPatterns.clear(); - } -} - -bool CvsIgnoreList::matches(const QString& text, bool bCaseSensitive ) const -{ - if (m_exactPatterns.find(text) != m_exactPatterns.end()) - { - return true; - } - - QStringList::ConstIterator it; - QStringList::ConstIterator itEnd; - for ( it=m_startPatterns.begin(), itEnd=m_startPatterns.end(); it != itEnd; ++it) - { - if (text.startsWith(*it)) - { - return true; - } - } - - for ( it = m_endPatterns.begin(), itEnd=m_endPatterns.end(); it != itEnd; ++it) - { - if (text.mid( text.length() - (*it).length() )==*it) //(text.endsWith(*it)) - { - return true; - } - } - - /* - for (QValueList::const_iterator it(m_generalPatterns.begin()), - itEnd(m_generalPatterns.end()); - it != itEnd; ++it) - { - if (::fnmatch(*it, text.local8Bit(), FNM_PATHNAME) == 0) - { - return true; - } - } - */ - - - for ( it = m_generalPatterns.begin(); it != m_generalPatterns.end(); ++it ) - { - QRegExp pattern( *it, bCaseSensitive, true /*wildcard mode*/); -#if QT_VERSION==230 - int len=0; - if ( pattern.match( text, 0, &len )!=-1 && len==text.length()) - return true; -#else - if ( pattern.exactMatch( text ) ) - return true; -#endif - } - - return false; -} - -static QString nicePath( const QFileInfo& fi ) -{ - QString fp = fi.filePath(); - if ( fp.length()>2 && fp[0] == '.' && fp[1] == '/' ) - { - return fp.mid(2); - } - return fp; -} - -static bool cvsIgnoreExists( t_DirectoryList* pDirList ) -{ - t_DirectoryList::iterator i; - for( i = pDirList->begin(); i!=pDirList->end(); ++i ) - { - if ( i->fileName()==".cvsignore" ) - return true; - } - return false; -} - -bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, const QString& filePattern, - const QString& fileAntiPattern, const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ) -{ - ProgressProxy pp; - m_pDirList = pDirList; - m_pDirList->clear(); - m_bFindHidden = bFindHidden; - m_bRecursive = bRecursive; - m_bFollowDirLinks = bFollowDirLinks; // Only relevant if bRecursive==true. - m_fileAntiPattern = fileAntiPattern; - m_filePattern = filePattern; - m_dirAntiPattern = dirAntiPattern; - - if ( pp.wasCancelled() ) - return true; // Cancelled is not an error. - - pp.setInformation( i18n("Reading directory: ") + m_pFileAccess->absFilePath(), 0, false ); - - if( m_pFileAccess->isLocal() ) - { - QString currentPath = QDir::currentDirPath(); - m_bSuccess = QDir::setCurrent( m_pFileAccess->absFilePath() ); - if ( m_bSuccess ) - { -#ifndef _WIN32 - m_bSuccess = true; - QDir dir( "." ); - - dir.setSorting( QDir::Name | QDir::DirsFirst ); - dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); - dir.setMatchAllDirs( true ); - - QFileInfoList fiList = dir.entryInfoList(); - if ( fiList.isEmpty() ) - { - // No Permission to read directory or other error. - m_bSuccess = false; - } - else - { - foreach ( QFileInfo fi, fiList ) // for each file... - { - if ( fi.fileName() == "." || fi.fileName()==".." ) - continue; - - pDirList->push_back( FileAccess( nicePath(fi) ) ); - } - } -#else - QString pattern ="*.*"; - WIN32_FIND_DATA findData; - WIN32_FIND_DATAA& findDataA=*(WIN32_FIND_DATAA*)&findData; // Needed for Win95 - - Qt::HANDLE searchHandle = QT_WA_INLINE( - FindFirstFile( (TCHAR*)pattern.ucs2(), &findData ), - FindFirstFileA( pattern.local8Bit(), &findDataA ) - ); - - if ( searchHandle != INVALID_HANDLE_VALUE ) - { - QString absPath = m_pFileAccess->absFilePath(); - QString relPath = m_pFileAccess->filePath(); - bool bFirst=true; - while( ! pp.wasCancelled() ) - { - if (!bFirst) - { - if ( ! QT_WA_INLINE( - FindNextFile(searchHandle,&findData), - FindNextFileA(searchHandle,&findDataA)) ) - break; - } - bFirst = false; - FileAccess fa; - fa.m_size = findData.nFileSizeLow ;//+ findData.nFileSizeHigh; - - FILETIME ft; - SYSTEMTIME t; - FileTimeToLocalFileTime( &findData.ftLastWriteTime, &ft ); FileTimeToSystemTime(&ft,&t); - fa.m_modificationTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) ); - FileTimeToLocalFileTime( &findData.ftLastAccessTime, &ft ); FileTimeToSystemTime(&ft,&t); - fa.m_accessTime = QDateTime( QDate(t.wYear, t.wMonth, t.wDay), QTime(t.wHour, t.wMinute, t.wSecond) ); - FileTimeToLocalFileTime( &findData.ftCreationTime, &ft ); FileTimeToSystemTime(&ft,&t); - 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_bDir = ( a & FILE_ATTRIBUTE_DIRECTORY ) != 0; - fa.m_bFile = !fa.m_bDir; - fa.m_bHidden = ( a & FILE_ATTRIBUTE_HIDDEN) != 0; - - fa.m_bExecutable = false; // Useless on windows - fa.m_bExists = true; - fa.m_bReadable = true; - fa.m_bLocal = true; - fa.m_bValidData = true; - fa.m_bSymLink = false; - fa.m_fileType = 0; - - fa.m_name = QT_WA_INLINE( - QString::fromUcs2((const ushort*)findData.cFileName), - QString::fromLocal8Bit(findDataA.cFileName) - ); - - fa.m_path = fa.m_name; - fa.m_absFilePath = absPath + "/" + fa.m_name; - fa.m_url.setPath( fa.m_absFilePath ); - if ( fa.m_name!="." && fa.m_name!=".." ) - pDirList->push_back( fa ); - } - FindClose( searchHandle ); - } - else - { - QDir::setCurrent( currentPath ); // restore current path - return false; - } -#endif - } - QDir::setCurrent( currentPath ); // restore current path - } - else - { - bool bShowProgress = false; - - KIO::ListJob* pListJob=0; - pListJob = KIO::listDir( m_pFileAccess->m_url, bShowProgress, true /*bFindHidden*/ ); - - m_bSuccess = false; - if ( pListJob!=0 ) - { - connect( pListJob, SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ), - this, SLOT( slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& )) ); - connect( pListJob, SIGNAL( result( KIO::Job* )), - this, SLOT( slotSimpleJobResult(KIO::Job*) ) ); - - connect( pListJob, SIGNAL( infoMessage(KIO::Job*, const QString&)), - this, SLOT( slotListDirInfoMessage(KIO::Job*, const QString&) )); - - // This line makes the transfer via fish unreliable.:-( - //connect( pListJob, SIGNAL(percent(KIO::Job*,unsigned long)), this, SLOT(slotPercent(KIO::Job*, unsigned long))); - - g_pProgressDialog->enterEventLoop( pListJob, - i18n("Listing directory: %1").arg(m_pFileAccess->prettyAbsPath()) ); - } - } - - CvsIgnoreList cvsIgnoreList; - if ( bUseCvsIgnore ) - { - cvsIgnoreList.init( *m_pFileAccess, cvsIgnoreExists(pDirList) ); - } -#ifdef _WIN32 - bool bCaseSensitive = false; -#else - bool bCaseSensitive = true; -#endif - - // Now remove all entries that don't match: - t_DirectoryList::iterator i; - for( i = pDirList->begin(); i!=pDirList->end(); ) - { - t_DirectoryList::iterator i2=i; - ++i2; - QString fn = i->fileName(); - if ( (!bFindHidden && i->isHidden() ) - || - (i->isFile() && - ( !wildcardMultiMatch( filePattern, i->fileName(), bCaseSensitive ) || - wildcardMultiMatch( fileAntiPattern, i->fileName(), bCaseSensitive ) ) ) - || - (i->isDir() && wildcardMultiMatch( dirAntiPattern, i->fileName(), bCaseSensitive ) ) - || - cvsIgnoreList.matches( i->fileName(), bCaseSensitive ) - ) - { - // Remove it - pDirList->erase( i ); - i = i2; - } - else - { - ++i; - } - } - - if ( bRecursive ) - { - t_DirectoryList subDirsList; - - t_DirectoryList::iterator i; - for( i = m_pDirList->begin(); i!=m_pDirList->end(); ++i ) - { - if ( i->isDir() && (!i->isSymLink() || m_bFollowDirLinks)) - { - t_DirectoryList dirList; - i->listDir( &dirList, bRecursive, bFindHidden, - filePattern, fileAntiPattern, dirAntiPattern, bFollowDirLinks, bUseCvsIgnore ); - - t_DirectoryList::iterator j; - for( j = dirList.begin(); j!=dirList.end(); ++j ) - { - j->m_path = i->fileName() + "/" + j->m_path; - } - - // append data onto the main list - subDirsList.splice( subDirsList.end(), dirList ); - } - } - - m_pDirList->splice( m_pDirList->end(), subDirsList ); - } - - return m_bSuccess; -} - - -void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l ) -{ - KURL parentUrl( m_pFileAccess->m_absFilePath ); - - KIO::UDSEntryList::ConstIterator i; - for ( i=l.begin(); i!=l.end(); ++i ) - { - const KIO::UDSEntry& e = *i; - FileAccess fa; - fa.setUdsEntry( e ); - - if ( fa.filePath() != "." && fa.filePath() != ".." ) - { - fa.m_url = parentUrl; - fa.m_url.addPath( fa.filePath() ); - fa.m_absFilePath = fa.m_url.url(); - m_pDirList->push_back( fa ); - } - } -} - -void FileAccessJobHandler::slotListDirInfoMessage( KIO::Job*, const QString& msg ) -{ - g_pProgressDialog->setInformation( msg, 0.0 ); -} - -void FileAccessJobHandler::slotPercent( KIO::Job*, unsigned long percent ) -{ - g_pProgressDialog->setCurrent( percent/100.0 ); -} - - -ProgressDialog::ProgressDialog( QWidget* pParent ) -: QDialog( pParent, 0, true ) -{ - Q3VBoxLayout* layout = new Q3VBoxLayout(this); - - m_pInformation = new QLabel( " ", this ); - layout->addWidget( m_pInformation ); - - m_pProgressBar = new KProgress(1000, this); - layout->addWidget( m_pProgressBar ); - - m_pSubInformation = new QLabel( " ", this); - layout->addWidget( m_pSubInformation ); - - m_pSubProgressBar = new KProgress(1000, this); - layout->addWidget( m_pSubProgressBar ); - - m_pSlowJobInfo = new QLabel( " ", this); - layout->addWidget( m_pSlowJobInfo ); - - Q3HBoxLayout* hlayout = new Q3HBoxLayout( layout ); - hlayout->addStretch(1); - m_pAbortButton = new QPushButton( i18n("&Cancel"), this); - hlayout->addWidget( m_pAbortButton ); - connect( m_pAbortButton, SIGNAL(clicked()), this, SLOT(slotAbort()) ); - - m_progressDelayTimer = 0; - resize( 400, 100 ); - m_t1.start(); - m_t2.start(); - m_bWasCancelled = false; - m_pJob = 0; -} - -void ProgressDialog::push() -{ - ProgressLevelData pld; - if ( !m_progressStack.empty() ) - { - pld.m_dRangeMax = m_progressStack.back().m_dSubRangeMax; - pld.m_dRangeMin = m_progressStack.back().m_dSubRangeMin; - } - else - { - m_bWasCancelled = false; - m_t1.restart(); - m_t2.restart(); - show(); - } - - m_progressStack.push_back( pld ); -} - -void ProgressDialog::pop( bool bRedrawUpdate ) -{ - if ( !m_progressStack.empty() ) - { - m_progressStack.pop_back(); - if ( m_progressStack.empty() ) - hide(); - else - recalc(bRedrawUpdate); - } -} - -void ProgressDialog::setInformation(const QString& info, double dCurrent, bool bRedrawUpdate ) -{ - if ( m_progressStack.empty() ) - return; - ProgressLevelData& pld = m_progressStack.back(); - pld.m_dCurrent = dCurrent; - int level = m_progressStack.size(); - if ( level==1 ) - { - m_pInformation->setText( info ); - m_pSubInformation->setText(""); - } - else if ( level==2 ) - { - m_pSubInformation->setText( info ); - } - recalc(bRedrawUpdate); -} - -void ProgressDialog::setInformation(const QString& info, bool bRedrawUpdate ) -{ - if ( m_progressStack.empty() ) - return; - //ProgressLevelData& pld = m_progressStack.back(); - int level = m_progressStack.size(); - if ( level==1 ) - { - m_pInformation->setText( info ); - m_pSubInformation->setText( "" ); - } - else if ( level==2 ) - { - m_pSubInformation->setText( info ); - } - recalc(bRedrawUpdate); -} - -void ProgressDialog::setMaxNofSteps( int maxNofSteps ) -{ - if ( m_progressStack.empty() ) - return; - ProgressLevelData& pld = m_progressStack.back(); - pld.m_maxNofSteps = maxNofSteps; - pld.m_dCurrent = 0; -} - -void ProgressDialog::step( bool bRedrawUpdate ) -{ - if ( m_progressStack.empty() ) - return; - ProgressLevelData& pld = m_progressStack.back(); - pld.m_dCurrent += 1.0/pld.m_maxNofSteps; - recalc(bRedrawUpdate); -} - -void ProgressDialog::setCurrent( double dSubCurrent, bool bRedrawUpdate ) -{ - if ( m_progressStack.empty() ) - return; - ProgressLevelData& pld = m_progressStack.back(); - pld.m_dCurrent = dSubCurrent; - recalc( bRedrawUpdate ); -} - -// The progressbar goes from 0 to 1 usually. -// By supplying a subrange transformation the subCurrent-values -// 0 to 1 will be transformed to dMin to dMax instead. -// Requirement: 0 < dMin < dMax < 1 -void ProgressDialog::setRangeTransformation( double dMin, double dMax ) -{ - if ( m_progressStack.empty() ) - return; - ProgressLevelData& pld = m_progressStack.back(); - pld.m_dRangeMin = dMin; - pld.m_dRangeMax = dMax; - pld.m_dCurrent = 0; -} - -void ProgressDialog::setSubRangeTransformation( double dMin, double dMax ) -{ - if ( m_progressStack.empty() ) - return; - ProgressLevelData& pld = m_progressStack.back(); - pld.m_dSubRangeMin = dMin; - pld.m_dSubRangeMax = dMax; -} - -void qt_enter_modal(QWidget*); -void qt_leave_modal(QWidget*); - -void ProgressDialog::enterEventLoop( KIO::Job* pJob, const QString& jobInfo ) -{ - m_pJob = pJob; - m_pSlowJobInfo->setText(""); - m_currentJobInfo = jobInfo; - killTimer( m_progressDelayTimer ); - m_progressDelayTimer = startTimer( 3000 ); /* 3 s delay */ - - // instead of using exec() the eventloop is entered and exited often without hiding/showing the window. - //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() -{ - killTimer( m_progressDelayTimer ); - m_progressDelayTimer = 0; - m_pJob = 0; - if (!m_eventLoopStack.empty()) - m_eventLoopStack.back()->exit(); -} - -void ProgressDialog::recalc( bool bUpdate ) -{ - killTimer( m_progressDelayTimer ); - m_progressDelayTimer = startTimer( 3000 ); /* 3 s delay */ - - int level = m_progressStack.size(); - if( ( bUpdate && level==1) || m_t1.elapsed()>200 ) - { - if (m_progressStack.empty() ) - { - m_pProgressBar->setProgress( 0 ); - m_pSubProgressBar->setProgress( 0 ); - } - else - { - std::list::iterator i = m_progressStack.begin(); - m_pProgressBar->setProgress( int( 1000.0 * ( i->m_dCurrent * (i->m_dRangeMax - i->m_dRangeMin) + i->m_dRangeMin ) ) ); - ++i; - if ( i!=m_progressStack.end() ) - m_pSubProgressBar->setProgress( int( 1000.0 * ( i->m_dCurrent * (i->m_dRangeMax - i->m_dRangeMin) + i->m_dRangeMin ) ) ); - else - m_pSubProgressBar->setProgress( int( 1000.0 * m_progressStack.front().m_dSubRangeMin ) ); - } - - if ( !isVisible() ) show(); - qApp->processEvents(); - m_t1.restart(); - } -} - - -#include -void ProgressDialog::show() -{ - killTimer( m_progressDelayTimer ); - m_progressDelayTimer = 0; - if ( !isVisible() && (parentWidget()==0 || parentWidget()->isVisible()) ) - { -#if QT_VERSION==230 - QWidget::show(); -#else - QDialog::show(); -#endif - } -} - -void ProgressDialog::hide() -{ - killTimer( m_progressDelayTimer ); - m_progressDelayTimer = 0; - // Calling QDialog::hide() directly doesn't always work. (?) - QTimer::singleShot( 100, this, SLOT(delayedHide()) ); -} - -void ProgressDialog::delayedHide() -{ - if (m_pJob!=0) - { - m_pJob->kill(false); - m_pJob = 0; - } - QDialog::hide(); - m_pInformation->setText( "" ); - - //m_progressStack.clear(); - - m_pProgressBar->setProgress( 0 ); - m_pSubProgressBar->setProgress( 0 ); - m_pSubInformation->setText(""); - m_pSlowJobInfo->setText(""); -} - -void ProgressDialog::reject() -{ - m_bWasCancelled = true; - QDialog::reject(); -} - -void ProgressDialog::slotAbort() -{ - reject(); -} - -bool ProgressDialog::wasCancelled() -{ - if( m_t2.elapsed()>100 ) - { - qApp->processEvents(); - m_t2.restart(); - } - return m_bWasCancelled; -} - - -void ProgressDialog::timerEvent(QTimerEvent*) -{ - if( !isVisible() ) - { - show(); - } - m_pSlowJobInfo->setText( m_currentJobInfo ); -} - - -ProgressProxy::ProgressProxy() -{ - g_pProgressDialog->push(); -} - -ProgressProxy::~ProgressProxy() -{ - g_pProgressDialog->pop(false); -} - -void ProgressProxy::setInformation( const QString& info, bool bRedrawUpdate ) -{ - g_pProgressDialog->setInformation( info, bRedrawUpdate ); -} - -void ProgressProxy::setInformation( const QString& info, double dCurrent, bool bRedrawUpdate ) -{ - g_pProgressDialog->setInformation( info, dCurrent, bRedrawUpdate ); -} - -void ProgressProxy::setCurrent( double dCurrent, bool bRedrawUpdate ) -{ - g_pProgressDialog->setCurrent( dCurrent, bRedrawUpdate ); -} - -void ProgressProxy::step( bool bRedrawUpdate ) -{ - g_pProgressDialog->step( bRedrawUpdate ); -} - -void ProgressProxy::setMaxNofSteps( int maxNofSteps ) -{ - g_pProgressDialog->setMaxNofSteps( maxNofSteps ); -} - -bool ProgressProxy::wasCancelled() -{ - return g_pProgressDialog->wasCancelled(); -} - -void ProgressProxy::setRangeTransformation( double dMin, double dMax ) -{ - g_pProgressDialog->setRangeTransformation( dMin, dMax ); -} - -void ProgressProxy::setSubRangeTransformation( double dMin, double dMax ) -{ - g_pProgressDialog->setSubRangeTransformation( dMin, dMax ); -} - - - - - -//#include "fileaccess.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/fileaccess.h --- a/kdiff3/src/fileaccess.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,267 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2003-2006 by Joachim Eibl * - * joachim.eibl at gmx.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - ***************************************************************************/ - -#ifndef FILEACCESS_H -#define FILEACCESS_H - -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include -#include -#include - -bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive ); - -class t_DirectoryList; - -class FileAccess -{ -public: - FileAccess(); - ~FileAccess(); - FileAccess( const QString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported) - void setFile( const QString& name, bool bWantToWrite=false ); - - bool isValid() const; - bool isFile() const; - bool isDir() const; - bool isSymLink() const; - bool exists() const; - long size() const; // Size as returned by stat(). - long sizeForReading(); // If the size can't be determined by stat() then the file is copied to a local temp file. - bool isReadable() const; - bool isWritable() const; - bool isExecutable() const; - bool isHidden() const; - QString readLink() const; - - QDateTime created() const; - QDateTime lastModified() const; - QDateTime lastRead() const; - - QString fileName() const; // Just the name-part of the path, without parent directories - QString filePath() const; // The path-string that was used during construction - QString prettyAbsPath() const; - KURL url() const; - QString absFilePath() const; - - bool isLocal() const; - - bool readFile(void* pDestBuffer, unsigned long maxLength ); - bool writeFile(const void* pSrcBuffer, unsigned long length ); - bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, - const QString& filePattern, const QString& fileAntiPattern, - const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); - bool copyFile( const QString& destUrl ); - 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& ); - static bool removeDir( const QString& ); - static bool exists( const QString& ); - static QString cleanDirPath( const QString& ); - - //bool chmod( const QString& ); - bool rename( const QString& ); - static bool symLink( const QString& linkTarget, const QString& linkLocation ); - - void addPath( const QString& txt ); - QString getStatusText(); -private: - void setUdsEntry( const KIO::UDSEntry& e ); - KURL m_url; - bool m_bLocal; - bool m_bValidData; - - unsigned long m_size; - QDateTime m_modificationTime; - QDateTime m_accessTime; - QDateTime m_creationTime; - bool m_bReadable; - bool m_bWritable; - bool m_bExecutable; - bool m_bExists; - bool m_bFile; - bool m_bDir; - bool m_bSymLink; - bool m_bHidden; - long m_fileType; // for testing only - - QString m_linkTarget; - QString m_user; - QString m_group; - QString m_name; - QString m_path; - QString m_absFilePath; - QString m_localCopy; - QString m_statusText; // Might contain an error string, when the last operation didn't succeed. - - friend class FileAccessJobHandler; -}; - -class t_DirectoryList : public std::list -{}; - - -class FileAccessJobHandler : public QObject -{ - Q_OBJECT -public: - FileAccessJobHandler( FileAccess* pFileAccess ); - - bool get( void* pDestBuffer, long maxLength ); - bool put( const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume=false, int permissions=-1 ); - bool stat(int detailLevel=2, bool bWantToWrite=false ); - bool copyFile( const QString& dest ); - bool rename( const QString& dest ); - bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden, - const QString& filePattern, const QString& fileAntiPattern, - const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore ); - bool mkDir( const QString& dirName ); - bool rmDir( const QString& dirName ); - bool removeFile( const QString& dirName ); - bool symLink( const QString& linkTarget, const QString& linkLocation ); - -private: - FileAccess* m_pFileAccess; - bool m_bSuccess; - - // Data needed during Job - long m_transferredBytes; - char* m_pTransferBuffer; // Needed during get or put - long m_maxLength; - - QString m_filePattern; - QString m_fileAntiPattern; - QString m_dirAntiPattern; - t_DirectoryList* m_pDirList; - bool m_bFindHidden; - bool m_bRecursive; - bool m_bFollowDirLinks; - - bool scanLocalDirectory( const QString& dirName, t_DirectoryList* dirList ); - -private slots: - void slotStatResult( KIO::Job* ); - void slotSimpleJobResult( KIO::Job* pJob ); - void slotPutJobResult( KIO::Job* pJob ); - - void slotGetData(KIO::Job*,const QByteArray&); - void slotPutData(KIO::Job*, QByteArray&); - - void slotListDirInfoMessage( KIO::Job*, const QString& msg ); - void slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l ); - - void slotPercent( KIO::Job* pJob, unsigned long percent ); -}; - -class ProgressDialog : public QDialog -{ - Q_OBJECT -public: - ProgressDialog( QWidget* pParent ); - - void setInformation( const QString& info, bool bRedrawUpdate=true ); - void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); - void setCurrent( double dCurrent, bool bRedrawUpdate=true ); - void step( bool bRedrawUpdate=true ); - void setMaxNofSteps( int dMaxNofSteps ); - void push(); - void pop(bool bRedrawUpdate=true); - - // The progressbar goes from 0 to 1 usually. - // By supplying a subrange transformation the subCurrent-values - // 0 to 1 will be transformed to dMin to dMax instead. - // Requirement: 0 < dMin < dMax < 1 - void setRangeTransformation( double dMin, double dMax ); - void setSubRangeTransformation( double dMin, double dMax ); - - void exitEventLoop(); - void enterEventLoop( KIO::Job* pJob, const QString& jobInfo ); - - bool wasCancelled(); - void show(); - void hide(); - - virtual void timerEvent(QTimerEvent*); -private: - - struct ProgressLevelData - { - ProgressLevelData() - { - m_dCurrent=0; m_maxNofSteps=1; m_dRangeMin=0; m_dRangeMax=1; - m_dSubRangeMin = 0; m_dSubRangeMax = 1; - } - double m_dCurrent; - int m_maxNofSteps; // when step() is used. - double m_dRangeMax; - double m_dRangeMin; - double m_dSubRangeMax; - double m_dSubRangeMin; - }; - std::list m_progressStack; - - int m_progressDelayTimer; - std::list m_eventLoopStack; - - KProgress* m_pProgressBar; - KProgress* m_pSubProgressBar; - QLabel* m_pInformation; - QLabel* m_pSubInformation; - QLabel* m_pSlowJobInfo; - QPushButton* m_pAbortButton; - void recalc(bool bRedrawUpdate); - QTime m_t1; - QTime m_t2; - bool m_bWasCancelled; - KIO::Job* m_pJob; - QString m_currentJobInfo; // Needed if the job doesn't stop after a reasonable time. -protected: - virtual void reject(); -private slots: - void delayedHide(); - void slotAbort(); -}; - -// When using the ProgressProxy you need not take care of the push and pop, except when explicit. -class ProgressProxy -{ -public: - ProgressProxy(); - ~ProgressProxy(); - - void setInformation( const QString& info, bool bRedrawUpdate=true ); - void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true ); - void setCurrent( double dCurrent, bool bRedrawUpdate=true ); - void step( bool bRedrawUpdate=true ); - void setMaxNofSteps( int dMaxNofSteps ); - bool wasCancelled(); - void setRangeTransformation( double dMin, double dMax ); - void setSubRangeTransformation( double dMin, double dMax ); -private: -}; - -extern ProgressDialog* g_pProgressDialog; - - - -#endif - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/gnudiff_analyze.cpp --- a/kdiff3/src/gnudiff_analyze.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,873 +0,0 @@ -/* Analyze file differences for GNU DIFF. - - Modified for KDiff3 by Joachim Eibl 2003. - The original file was part of GNU DIFF. - - Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1998, 2001, 2002 - Free Software Foundation, Inc. - - GNU DIFF is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GNU DIFF is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* The basic algorithm is described in: - "An O(ND) Difference Algorithm and its Variations", Eugene Myers, - Algorithmica Vol. 1 No. 2, 1986, pp. 251-266; - see especially section 4.2, which describes the variation used below. - Unless the --minimal option is specified, this code uses the TOO_EXPENSIVE - heuristic, by Paul Eggert, to limit the cost to O(N**1.5 log N) - at the price of producing suboptimal output for large inputs with - many differences. - - The basic algorithm was independently discovered as described in: - "Algorithms for Approximate String Matching", E. Ukkonen, - Information and Control Vol. 64, 1985, pp. 100-118. */ - -#define GDIFF_MAIN - -#include "gnudiff_diff.h" -//#include -#include - -static lin *xvec, *yvec; /* Vectors being compared. */ -static lin *fdiag; /* Vector, indexed by diagonal, containing - 1 + the X coordinate of the point furthest - along the given diagonal in the forward - search of the edit matrix. */ -static lin *bdiag; /* Vector, indexed by diagonal, containing - the X coordinate of the point furthest - along the given diagonal in the backward - search of the edit matrix. */ -static lin too_expensive; /* Edit scripts longer than this are too - expensive to compute. */ - -#define SNAKE_LIMIT 20 /* Snakes bigger than this are considered `big'. */ - - -struct partition -{ - lin xmid, ymid; /* Midpoints of this partition. */ - bool lo_minimal; /* Nonzero if low half will be analyzed minimally. */ - bool hi_minimal; /* Likewise for high half. */ -}; - -/* Find the midpoint of the shortest edit script for a specified - portion of the two files. - - Scan from the beginnings of the files, and simultaneously from the ends, - doing a breadth-first search through the space of edit-sequence. - When the two searches meet, we have found the midpoint of the shortest - edit sequence. - - If FIND_MINIMAL is nonzero, find the minimal edit script regardless - of expense. Otherwise, if the search is too expensive, use - heuristics to stop the search and report a suboptimal answer. - - Set PART->(xmid,ymid) to the midpoint (XMID,YMID). The diagonal number - XMID - YMID equals the number of inserted lines minus the number - of deleted lines (counting only lines before the midpoint). - Return the approximate edit cost; this is the total number of - lines inserted or deleted (counting only lines before the midpoint), - unless a heuristic is used to terminate the search prematurely. - - Set PART->lo_minimal to true iff the minimal edit script for the - left half of the partition is known; similarly for PART->hi_minimal. - - This function assumes that the first lines of the specified portions - of the two files do not match, and likewise that the last lines do not - match. The caller must trim matching lines from the beginning and end - of the portions it is going to specify. - - If we return the "wrong" partitions, - the worst this can do is cause suboptimal diff output. - It cannot cause incorrect diff output. */ - -lin -GnuDiff::diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal, - struct partition *part) -{ - lin *const fd = fdiag; /* Give the compiler a chance. */ - lin *const bd = bdiag; /* Additional help for the compiler. */ - lin const *const xv = xvec; /* Still more help for the compiler. */ - lin const *const yv = yvec; /* And more and more . . . */ - lin const dmin = xoff - ylim; /* Minimum valid diagonal. */ - lin const dmax = xlim - yoff; /* Maximum valid diagonal. */ - lin const fmid = xoff - yoff; /* Center diagonal of top-down search. */ - lin const bmid = xlim - ylim; /* Center diagonal of bottom-up search. */ - lin fmin = fmid, fmax = fmid; /* Limits of top-down search. */ - lin bmin = bmid, bmax = bmid; /* Limits of bottom-up search. */ - lin c; /* Cost. */ - bool odd = (fmid - bmid) & 1; /* True if southeast corner is on an odd - diagonal with respect to the northwest. */ - - fd[fmid] = xoff; - bd[bmid] = xlim; - - for (c = 1;; ++c) - { - lin d; /* Active diagonal. */ - bool big_snake = 0; - - /* Extend the top-down search by an edit step in each diagonal. */ - fmin > dmin ? fd[--fmin - 1] = -1 : ++fmin; - fmax < dmax ? fd[++fmax + 1] = -1 : --fmax; - for (d = fmax; d >= fmin; d -= 2) - { - lin x, y, oldx, tlo = fd[d - 1], thi = fd[d + 1]; - - if (tlo >= thi) - x = tlo + 1; - else - x = thi; - oldx = x; - y = x - d; - while (x < xlim && y < ylim && xv[x] == yv[y]) - ++x, ++y; - if (x - oldx > SNAKE_LIMIT) - big_snake = 1; - fd[d] = x; - if (odd && bmin <= d && d <= bmax && bd[d] <= x) - { - part->xmid = x; - part->ymid = y; - part->lo_minimal = part->hi_minimal = 1; - return 2 * c - 1; - } - } - - /* Similarly extend the bottom-up search. */ - bmin > dmin ? bd[--bmin - 1] = LIN_MAX : ++bmin; - bmax < dmax ? bd[++bmax + 1] = LIN_MAX : --bmax; - for (d = bmax; d >= bmin; d -= 2) - { - lin x, y, oldx, tlo = bd[d - 1], thi = bd[d + 1]; - - if (tlo < thi) - x = tlo; - else - x = thi - 1; - oldx = x; - y = x - d; - while (x > xoff && y > yoff && xv[x - 1] == yv[y - 1]) - --x, --y; - if (oldx - x > SNAKE_LIMIT) - big_snake = 1; - bd[d] = x; - if (!odd && fmin <= d && d <= fmax && x <= fd[d]) - { - part->xmid = x; - part->ymid = y; - part->lo_minimal = part->hi_minimal = 1; - return 2 * c; - } - } - - if (find_minimal) - continue; - - /* Heuristic: check occasionally for a diagonal that has made - lots of progress compared with the edit distance. - If we have any such, find the one that has made the most - progress and return it as if it had succeeded. - - With this heuristic, for files with a constant small density - of changes, the algorithm is linear in the file size. */ - - if (200 < c && big_snake && speed_large_files) - { - lin best; - - best = 0; - for (d = fmax; d >= fmin; d -= 2) - { - lin dd = d - fmid; - lin x = fd[d]; - lin y = x - d; - lin v = (x - xoff) * 2 - dd; - if (v > 12 * (c + (dd < 0 ? -dd : dd))) - { - if (v > best - && xoff + SNAKE_LIMIT <= x && x < xlim - && yoff + SNAKE_LIMIT <= y && y < ylim) - { - /* We have a good enough best diagonal; - now insist that it end with a significant snake. */ - int k; - - for (k = 1; xv[x - k] == yv[y - k]; k++) - if (k == SNAKE_LIMIT) - { - best = v; - part->xmid = x; - part->ymid = y; - break; - } - } - } - } - if (best > 0) - { - part->lo_minimal = 1; - part->hi_minimal = 0; - return 2 * c - 1; - } - - best = 0; - for (d = bmax; d >= bmin; d -= 2) - { - lin dd = d - bmid; - lin x = bd[d]; - lin y = x - d; - lin v = (xlim - x) * 2 + dd; - if (v > 12 * (c + (dd < 0 ? -dd : dd))) - { - if (v > best - && xoff < x && x <= xlim - SNAKE_LIMIT - && yoff < y && y <= ylim - SNAKE_LIMIT) - { - /* We have a good enough best diagonal; - now insist that it end with a significant snake. */ - int k; - - for (k = 0; xv[x + k] == yv[y + k]; k++) - if (k == SNAKE_LIMIT - 1) - { - best = v; - part->xmid = x; - part->ymid = y; - break; - } - } - } - } - if (best > 0) - { - part->lo_minimal = 0; - part->hi_minimal = 1; - return 2 * c - 1; - } - } - - /* Heuristic: if we've gone well beyond the call of duty, - give up and report halfway between our best results so far. */ - if (c >= too_expensive) - { - lin fxybest, fxbest; - lin bxybest, bxbest; - - fxbest = bxbest = 0; /* Pacify `gcc -Wall'. */ - - /* Find forward diagonal that maximizes X + Y. */ - fxybest = -1; - for (d = fmax; d >= fmin; d -= 2) - { - lin x = MIN (fd[d], xlim); - lin y = x - d; - if (ylim < y) - x = ylim + d, y = ylim; - if (fxybest < x + y) - { - fxybest = x + y; - fxbest = x; - } - } - - /* Find backward diagonal that minimizes X + Y. */ - bxybest = LIN_MAX; - for (d = bmax; d >= bmin; d -= 2) - { - lin x = MAX (xoff, bd[d]); - lin y = x - d; - if (y < yoff) - x = yoff + d, y = yoff; - if (x + y < bxybest) - { - bxybest = x + y; - bxbest = x; - } - } - - /* Use the better of the two diagonals. */ - if ((xlim + ylim) - bxybest < fxybest - (xoff + yoff)) - { - part->xmid = fxbest; - part->ymid = fxybest - fxbest; - part->lo_minimal = 1; - part->hi_minimal = 0; - } - else - { - part->xmid = bxbest; - part->ymid = bxybest - bxbest; - part->lo_minimal = 0; - part->hi_minimal = 1; - } - return 2 * c - 1; - } - } -} - -/* Compare in detail contiguous subsequences of the two files - which are known, as a whole, to match each other. - - The results are recorded in the vectors files[N].changed, by - storing 1 in the element for each line that is an insertion or deletion. - - The subsequence of file 0 is [XOFF, XLIM) and likewise for file 1. - - Note that XLIM, YLIM are exclusive bounds. - All line numbers are origin-0 and discarded lines are not counted. - - If FIND_MINIMAL, find a minimal difference no matter how - expensive it is. */ - -void GnuDiff::compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal) -{ - lin * const xv = xvec; /* Help the compiler. */ - lin * const yv = yvec; - - /* Slide down the bottom initial diagonal. */ - while (xoff < xlim && yoff < ylim && xv[xoff] == yv[yoff]) - ++xoff, ++yoff; - /* Slide up the top initial diagonal. */ - while (xlim > xoff && ylim > yoff && xv[xlim - 1] == yv[ylim - 1]) - --xlim, --ylim; - - /* Handle simple cases. */ - if (xoff == xlim) - while (yoff < ylim) - files[1].changed[files[1].realindexes[yoff++]] = 1; - else if (yoff == ylim) - while (xoff < xlim) - files[0].changed[files[0].realindexes[xoff++]] = 1; - else - { - lin c; - struct partition part; - - /* Find a point of correspondence in the middle of the files. */ - - c = diag (xoff, xlim, yoff, ylim, find_minimal, &part); - - if (c == 1) - { - /* This should be impossible, because it implies that - one of the two subsequences is empty, - and that case was handled above without calling `diag'. - Let's verify that this is true. */ - abort (); -#if 0 - /* The two subsequences differ by a single insert or delete; - record it and we are done. */ - if (part.xmid - part.ymid < xoff - yoff) - files[1].changed[files[1].realindexes[part.ymid - 1]] = 1; - else - files[0].changed[files[0].realindexes[part.xmid]] = 1; -#endif - } - else - { - /* Use the partitions to split this problem into subproblems. */ - compareseq (xoff, part.xmid, yoff, part.ymid, part.lo_minimal); - compareseq (part.xmid, xlim, part.ymid, ylim, part.hi_minimal); - } - } -} - -/* Discard lines from one file that have no matches in the other file. - - A line which is discarded will not be considered by the actual - comparison algorithm; it will be as if that line were not in the file. - The file's `realindexes' table maps virtual line numbers - (which don't count the discarded lines) into real line numbers; - this is how the actual comparison algorithm produces results - that are comprehensible when the discarded lines are counted. - - When we discard a line, we also mark it as a deletion or insertion - so that it will be printed in the output. */ - -void GnuDiff::discard_confusing_lines (struct file_data filevec[]) -{ - int f; - lin i; - char *discarded[2]; - lin *equiv_count[2]; - lin *p; - - /* Allocate our results. */ - p = (lin*)xmalloc ((filevec[0].buffered_lines + filevec[1].buffered_lines) - * (2 * sizeof *p)); - for (f = 0; f < 2; f++) - { - filevec[f].undiscarded = p; p += filevec[f].buffered_lines; - filevec[f].realindexes = p; p += filevec[f].buffered_lines; - } - - /* Set up equiv_count[F][I] as the number of lines in file F - that fall in equivalence class I. */ - - p = (lin*)zalloc (filevec[0].equiv_max * (2 * sizeof *p)); - equiv_count[0] = p; - equiv_count[1] = p + filevec[0].equiv_max; - - for (i = 0; i < filevec[0].buffered_lines; ++i) - ++equiv_count[0][filevec[0].equivs[i]]; - for (i = 0; i < filevec[1].buffered_lines; ++i) - ++equiv_count[1][filevec[1].equivs[i]]; - - /* Set up tables of which lines are going to be discarded. */ - - discarded[0] = (char*)zalloc (filevec[0].buffered_lines - + filevec[1].buffered_lines); - discarded[1] = discarded[0] + filevec[0].buffered_lines; - - /* Mark to be discarded each line that matches no line of the other file. - If a line matches many lines, mark it as provisionally discardable. */ - - for (f = 0; f < 2; f++) - { - size_t end = filevec[f].buffered_lines; - char *discards = discarded[f]; - lin *counts = equiv_count[1 - f]; - lin *equivs = filevec[f].equivs; - size_t many = 5; - size_t tem = end / 64; - - /* Multiply MANY by approximate square root of number of lines. - That is the threshold for provisionally discardable lines. */ - while ((tem = tem >> 2) > 0) - many *= 2; - - for (i = 0; i < (lin)end; i++) - { - lin nmatch; - if (equivs[i] == 0) - continue; - nmatch = counts[equivs[i]]; - if (nmatch == 0) - discards[i] = 1; - else if (nmatch > (lin)many) - discards[i] = 2; - } - } - - /* Don't really discard the provisional lines except when they occur - in a run of discardables, with nonprovisionals at the beginning - and end. */ - - for (f = 0; f < 2; f++) - { - lin end = filevec[f].buffered_lines; - register char *discards = discarded[f]; - - for (i = 0; i < end; i++) - { - /* Cancel provisional discards not in middle of run of discards. */ - if (discards[i] == 2) - discards[i] = 0; - else if (discards[i] != 0) - { - /* We have found a nonprovisional discard. */ - register lin j; - lin length; - lin provisional = 0; - - /* Find end of this run of discardable lines. - Count how many are provisionally discardable. */ - for (j = i; j < end; j++) - { - if (discards[j] == 0) - break; - if (discards[j] == 2) - ++provisional; - } - - /* Cancel provisional discards at end, and shrink the run. */ - while (j > i && discards[j - 1] == 2) - discards[--j] = 0, --provisional; - - /* Now we have the length of a run of discardable lines - whose first and last are not provisional. */ - length = j - i; - - /* If 1/4 of the lines in the run are provisional, - cancel discarding of all provisional lines in the run. */ - if (provisional * 4 > length) - { - while (j > i) - if (discards[--j] == 2) - discards[j] = 0; - } - else - { - register lin consec; - lin minimum = 1; - lin tem = length >> 2; - - /* MINIMUM is approximate square root of LENGTH/4. - A subrun of two or more provisionals can stand - when LENGTH is at least 16. - A subrun of 4 or more can stand when LENGTH >= 64. */ - while (0 < (tem >>= 2)) - minimum <<= 1; - minimum++; - - /* Cancel any subrun of MINIMUM or more provisionals - within the larger run. */ - for (j = 0, consec = 0; j < length; j++) - if (discards[i + j] != 2) - consec = 0; - else if (minimum == ++consec) - /* Back up to start of subrun, to cancel it all. */ - j -= consec; - else if (minimum < consec) - discards[i + j] = 0; - - /* Scan from beginning of run - until we find 3 or more nonprovisionals in a row - or until the first nonprovisional at least 8 lines in. - Until that point, cancel any provisionals. */ - for (j = 0, consec = 0; j < length; j++) - { - if (j >= 8 && discards[i + j] == 1) - break; - if (discards[i + j] == 2) - consec = 0, discards[i + j] = 0; - else if (discards[i + j] == 0) - consec = 0; - else - consec++; - if (consec == 3) - break; - } - - /* I advances to the last line of the run. */ - i += length - 1; - - /* Same thing, from end. */ - for (j = 0, consec = 0; j < length; j++) - { - if (j >= 8 && discards[i - j] == 1) - break; - if (discards[i - j] == 2) - consec = 0, discards[i - j] = 0; - else if (discards[i - j] == 0) - consec = 0; - else - consec++; - if (consec == 3) - break; - } - } - } - } - } - - /* Actually discard the lines. */ - for (f = 0; f < 2; f++) - { - char *discards = discarded[f]; - lin end = filevec[f].buffered_lines; - lin j = 0; - for (i = 0; i < end; ++i) - if (minimal || discards[i] == 0) - { - filevec[f].undiscarded[j] = filevec[f].equivs[i]; - filevec[f].realindexes[j++] = i; - } - else - filevec[f].changed[i] = 1; - filevec[f].nondiscarded_lines = j; - } - - free (discarded[0]); - free (equiv_count[0]); -} - -/* Adjust inserts/deletes of identical lines to join changes - as much as possible. - - We do something when a run of changed lines include a - line at one end and have an excluded, identical line at the other. - We are free to choose which identical line is included. - `compareseq' usually chooses the one at the beginning, - but usually it is cleaner to consider the following identical line - to be the "change". */ - -void GnuDiff::shift_boundaries (struct file_data filevec[]) -{ - int f; - - for (f = 0; f < 2; f++) - { - bool *changed = filevec[f].changed; - bool const *other_changed = filevec[1 - f].changed; - lin const *equivs = filevec[f].equivs; - lin i = 0; - lin j = 0; - lin i_end = filevec[f].buffered_lines; - - while (1) - { - lin runlength, start, corresponding; - - /* Scan forwards to find beginning of another run of changes. - Also keep track of the corresponding point in the other file. */ - - while (i < i_end && !changed[i]) - { - while (other_changed[j++]) - continue; - i++; - } - - if (i == i_end) - break; - - start = i; - - /* Find the end of this run of changes. */ - - while (changed[++i]) - continue; - while (other_changed[j]) - j++; - - do - { - /* Record the length of this run of changes, so that - we can later determine whether the run has grown. */ - runlength = i - start; - - /* Move the changed region back, so long as the - previous unchanged line matches the last changed one. - This merges with previous changed regions. */ - - while (start && equivs[start - 1] == equivs[i - 1]) - { - changed[--start] = 1; - changed[--i] = 0; - while (changed[start - 1]) - start--; - while (other_changed[--j]) - continue; - } - - /* Set CORRESPONDING to the end of the changed run, at the last - point where it corresponds to a changed run in the other file. - CORRESPONDING == I_END means no such point has been found. */ - corresponding = other_changed[j - 1] ? i : i_end; - - /* Move the changed region forward, so long as the - first changed line matches the following unchanged one. - This merges with following changed regions. - Do this second, so that if there are no merges, - the changed region is moved forward as far as possible. */ - - while (i != i_end && equivs[start] == equivs[i]) - { - changed[start++] = 0; - changed[i++] = 1; - while (changed[i]) - i++; - while (other_changed[++j]) - corresponding = i; - } - } - while (runlength != i - start); - - /* If possible, move the fully-merged run of changes - back to a corresponding run in the other file. */ - - while (corresponding < i) - { - changed[--start] = 1; - changed[--i] = 0; - while (other_changed[--j]) - continue; - } - } - } -} - -/* Cons an additional entry onto the front of an edit script OLD. - LINE0 and LINE1 are the first affected lines in the two files (origin 0). - DELETED is the number of lines deleted here from file 0. - INSERTED is the number of lines inserted here in file 1. - - If DELETED is 0 then LINE0 is the number of the line before - which the insertion was done; vice versa for INSERTED and LINE1. */ - -GnuDiff::change* GnuDiff::add_change (lin line0, lin line1, lin deleted, lin inserted, struct change *old) -{ - struct change *newChange = (change*) xmalloc (sizeof *newChange); - - newChange->line0 = line0; - newChange->line1 = line1; - newChange->inserted = inserted; - newChange->deleted = deleted; - newChange->link = old; - return newChange; -} - -/* Scan the tables of which lines are inserted and deleted, - producing an edit script in reverse order. */ - -GnuDiff::change* GnuDiff::build_reverse_script (struct file_data const filevec[]) -{ - struct change *script = 0; - bool *changed0 = filevec[0].changed; - bool *changed1 = filevec[1].changed; - lin len0 = filevec[0].buffered_lines; - lin len1 = filevec[1].buffered_lines; - - /* Note that changedN[len0] does exist, and is 0. */ - - lin i0 = 0, i1 = 0; - - while (i0 < len0 || i1 < len1) - { - if (changed0[i0] | changed1[i1]) - { - lin line0 = i0, line1 = i1; - - /* Find # lines changed here in each file. */ - while (changed0[i0]) ++i0; - while (changed1[i1]) ++i1; - - /* Record this change. */ - script = add_change (line0, line1, i0 - line0, i1 - line1, script); - } - - /* We have reached lines in the two files that match each other. */ - i0++, i1++; - } - - return script; -} - -/* Scan the tables of which lines are inserted and deleted, - producing an edit script in forward order. */ - -GnuDiff::change* GnuDiff::build_script (struct file_data const filevec[]) -{ - struct change *script = 0; - bool *changed0 = filevec[0].changed; - bool *changed1 = filevec[1].changed; - lin i0 = filevec[0].buffered_lines, i1 = filevec[1].buffered_lines; - - /* Note that changedN[-1] does exist, and is 0. */ - - while (i0 >= 0 || i1 >= 0) - { - if (changed0[i0 - 1] | changed1[i1 - 1]) - { - lin line0 = i0, line1 = i1; - - /* Find # lines changed here in each file. */ - while (changed0[i0 - 1]) --i0; - while (changed1[i1 - 1]) --i1; - - /* Record this change. */ - script = add_change (i0, i1, line0 - i0, line1 - i1, script); - } - - /* We have reached lines in the two files that match each other. */ - i0--, i1--; - } - - return script; -} - - -/* Report the differences of two files. */ -GnuDiff::change* GnuDiff::diff_2_files (struct comparison *cmp) -{ - lin diags; - int f; - //struct change *e, *p; - struct change *script; - int changes; - - read_files (cmp->file, files_can_be_treated_as_binary); - - { - /* Allocate vectors for the results of comparison: - a flag for each line of each file, saying whether that line - is an insertion or deletion. - Allocate an extra element, always 0, at each end of each vector. */ - - size_t s = cmp->file[0].buffered_lines + cmp->file[1].buffered_lines + 4; - bool *flag_space = (bool*)zalloc (s * sizeof(*flag_space)); - cmp->file[0].changed = flag_space + 1; - cmp->file[1].changed = flag_space + cmp->file[0].buffered_lines + 3; - - /* Some lines are obviously insertions or deletions - because they don't match anything. Detect them now, and - avoid even thinking about them in the main comparison algorithm. */ - - discard_confusing_lines (cmp->file); - - /* Now do the main comparison algorithm, considering just the - undiscarded lines. */ - - xvec = cmp->file[0].undiscarded; - yvec = cmp->file[1].undiscarded; - diags = (cmp->file[0].nondiscarded_lines - + cmp->file[1].nondiscarded_lines + 3); - fdiag = (lin*)xmalloc (diags * (2 * sizeof *fdiag)); - bdiag = fdiag + diags; - fdiag += cmp->file[1].nondiscarded_lines + 1; - bdiag += cmp->file[1].nondiscarded_lines + 1; - - /* Set TOO_EXPENSIVE to be approximate square root of input size, - bounded below by 256. */ - too_expensive = 1; - for (; diags != 0; diags >>= 2) - too_expensive <<= 1; - too_expensive = MAX (256, too_expensive); - - files[0] = cmp->file[0]; - files[1] = cmp->file[1]; - - compareseq (0, cmp->file[0].nondiscarded_lines, - 0, cmp->file[1].nondiscarded_lines, minimal); - - free (fdiag - (cmp->file[1].nondiscarded_lines + 1)); - - /* Modify the results slightly to make them prettier - in cases where that can validly be done. */ - - shift_boundaries (cmp->file); - - /* Get the results of comparison in the form of a chain - of `struct change's -- an edit script. */ - - script = build_script (cmp->file); - - changes = (script != 0); - - free (cmp->file[0].undiscarded); - - free (flag_space); - - for (f = 0; f < 2; f++) - { - free (cmp->file[f].equivs); - free (cmp->file[f].linbuf + cmp->file[f].linbuf_base); - } - } - - return script; -} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/gnudiff_diff.h --- a/kdiff3/src/gnudiff_diff.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,357 +0,0 @@ -/* Shared definitions for GNU DIFF - - Modified for KDiff3 by Joachim Eibl 2003, 2004, 2005. - The original file was part of GNU DIFF. - - Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 2001, - 2002 Free Software Foundation, Inc. - - GNU DIFF is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GNU DIFF is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef GNUDIFF_DIFF_H -#define GNUDIFF_DIFF_H - -#include "gnudiff_system.h" - -#include -#include - -#define TAB_WIDTH 8 - -class GnuDiff -{ -public: -/* What kind of changes a hunk contains. */ -enum changes -{ - /* No changes: lines common to both files. */ - UNCHANGED, - - /* Deletes only: lines taken from just the first file. */ - OLD, - - /* Inserts only: lines taken from just the second file. */ - NEW, - - /* Both deletes and inserts: a hunk containing both old and new lines. */ - CHANGED -}; - -/* Variables for command line options */ - -/* Nonzero if output cannot be generated for identical files. */ -bool no_diff_means_no_output; - -/* Number of lines of context to show in each set of diffs. - This is zero when context is not to be shown. */ -lin context; - -/* Consider all files as text files (-a). - Don't interpret codes over 0177 as implying a "binary file". */ -bool text; - -/* The significance of white space during comparisons. */ -enum -{ - /* All white space is significant (the default). */ - IGNORE_NO_WHITE_SPACE, - - /* Ignore changes due to tab expansion (-E). */ - IGNORE_TAB_EXPANSION, - - /* Ignore changes in horizontal white space (-b). */ - IGNORE_SPACE_CHANGE, - - /* Ignore all horizontal white space (-w). */ - IGNORE_ALL_SPACE -} ignore_white_space; - -/* Ignore changes that affect only blank lines (-B). */ -bool ignore_blank_lines; - -/* Ignore changes that affect only numbers. (J. Eibl) */ -bool bIgnoreNumbers; -bool bIgnoreWhiteSpace; - -/* Files can be compared byte-by-byte, as if they were binary. - This depends on various options. */ -bool files_can_be_treated_as_binary; - -/* Ignore differences in case of letters (-i). */ -bool ignore_case; - -/* Ignore differences in case of letters in file names. */ -bool ignore_file_name_case; - -/* Regexp to identify function-header lines (-F). */ -//struct re_pattern_buffer function_regexp; - -/* Ignore changes that affect only lines matching this regexp (-I). */ -//struct re_pattern_buffer ignore_regexp; - -/* Say only whether files differ, not how (-q). */ -bool brief; - -/* Expand tabs in the output so the text lines up properly - despite the characters added to the front of each line (-t). */ -bool expand_tabs; - -/* Use a tab in the output, rather than a space, before the text of an - input line, so as to keep the proper alignment in the input line - without changing the characters in it (-T). */ -bool initial_tab; - -/* In directory comparison, specify file to start with (-S). - This is used for resuming an aborted comparison. - All file names less than this name are ignored. */ -const QChar *starting_file; - -/* Pipe each file's output through pr (-l). */ -bool paginate; - -/* Line group formats for unchanged, old, new, and changed groups. */ -const QChar *group_format[CHANGED + 1]; - -/* Line formats for unchanged, old, and new lines. */ -const QChar *line_format[NEW + 1]; - -/* If using OUTPUT_SDIFF print extra information to help the sdiff filter. */ -bool sdiff_merge_assist; - -/* Tell OUTPUT_SDIFF to show only the left version of common lines. */ -bool left_column; - -/* Tell OUTPUT_SDIFF to not show common lines. */ -bool suppress_common_lines; - -/* The half line width and column 2 offset for OUTPUT_SDIFF. */ -unsigned int sdiff_half_width; -unsigned int sdiff_column2_offset; - -/* Use heuristics for better speed with large files with a small - density of changes. */ -bool speed_large_files; - -/* Patterns that match file names to be excluded. */ -struct exclude *excluded; - -/* Don't discard lines. This makes things slower (sometimes much - slower) but will find a guaranteed minimal set of changes. */ -bool minimal; - - -/* The result of comparison is an "edit script": a chain of `struct change'. - Each `struct change' represents one place where some lines are deleted - and some are inserted. - - LINE0 and LINE1 are the first affected lines in the two files (origin 0). - DELETED is the number of lines deleted here from file 0. - INSERTED is the number of lines inserted here in file 1. - - If DELETED is 0 then LINE0 is the number of the line before - which the insertion was done; vice versa for INSERTED and LINE1. */ - -struct change -{ - struct change *link; /* Previous or next edit command */ - lin inserted; /* # lines of file 1 changed here. */ - lin deleted; /* # lines of file 0 changed here. */ - lin line0; /* Line number of 1st deleted line. */ - lin line1; /* Line number of 1st inserted line. */ - bool ignore; /* Flag used in context.c. */ -}; - -/* Structures that describe the input files. */ - -/* Data on one input file being compared. */ - -struct file_data { - /* Buffer in which text of file is read. */ - const QChar* buffer; - - /* Allocated size of buffer, in QChars. Always a multiple of - sizeof *buffer. */ - size_t bufsize; - - /* Number of valid bytes now in the buffer. */ - size_t buffered; - - /* Array of pointers to lines in the file. */ - const QChar **linbuf; - - /* linbuf_base <= buffered_lines <= valid_lines <= alloc_lines. - linebuf[linbuf_base ... buffered_lines - 1] are possibly differing. - linebuf[linbuf_base ... valid_lines - 1] contain valid data. - linebuf[linbuf_base ... alloc_lines - 1] are allocated. */ - lin linbuf_base, buffered_lines, valid_lines, alloc_lines; - - /* Pointer to end of prefix of this file to ignore when hashing. */ - const QChar *prefix_end; - - /* Count of lines in the prefix. - There are this many lines in the file before linbuf[0]. */ - lin prefix_lines; - - /* Pointer to start of suffix of this file to ignore when hashing. */ - const QChar *suffix_begin; - - /* Vector, indexed by line number, containing an equivalence code for - each line. It is this vector that is actually compared with that - of another file to generate differences. */ - lin *equivs; - - /* Vector, like the previous one except that - the elements for discarded lines have been squeezed out. */ - lin *undiscarded; - - /* Vector mapping virtual line numbers (not counting discarded lines) - to real ones (counting those lines). Both are origin-0. */ - lin *realindexes; - - /* Total number of nondiscarded lines. */ - lin nondiscarded_lines; - - /* Vector, indexed by real origin-0 line number, - containing TRUE for a line that is an insertion or a deletion. - The results of comparison are stored here. */ - bool *changed; - - /* 1 if at end of file. */ - bool eof; - - /* 1 more than the maximum equivalence value used for this or its - sibling file. */ - lin equiv_max; -}; - -/* Data on two input files being compared. */ - -struct comparison - { - struct file_data file[2]; - struct comparison const *parent; /* parent, if a recursive comparison */ - }; - -/* Describe the two files currently being compared. */ - -struct file_data files[2]; - -/* Stdio stream to output diffs to. */ - -FILE *outfile; - -/* Declare various functions. */ - -/* analyze.c */ -struct change* diff_2_files (struct comparison *); - -/* context.c */ -void print_context_header (struct file_data[], bool); -void print_context_script (struct change *, bool); - -/* dir.c */ -int diff_dirs (struct comparison const *, int (*) (struct comparison const *, const QChar *, const QChar *)); - -/* ed.c */ -void print_ed_script (struct change *); -void pr_forward_ed_script (struct change *); - -/* ifdef.c */ -void print_ifdef_script (struct change *); - -/* io.c */ -void file_block_read (struct file_data *, size_t); -bool read_files (struct file_data[], bool); - -/* normal.c */ -void print_normal_script (struct change *); - -/* rcs.c */ -void print_rcs_script (struct change *); - -/* side.c */ -void print_sdiff_script (struct change *); - -/* util.c */ -QChar *concat (const QChar *, const QChar *, const QChar *); -bool lines_differ ( const QChar *, size_t, const QChar *, size_t ); -lin translate_line_number (struct file_data const *, lin); -struct change *find_change (struct change *); -struct change *find_reverse_change (struct change *); -void *zalloc (size_t); -enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *); -void begin_output (void); -void debug_script (struct change *); -void fatal (const QChar *) __attribute__((noreturn)); -void finish_output (void); -void message (const QChar *, const QChar *, const QChar *); -void message5 (const QChar *, const QChar *, const QChar *, const QChar *, const QChar *); -void output_1_line (const QChar *, const QChar *, const QChar *, const QChar *); -void perror_with_name (const QChar *); -void pfatal_with_name (const QChar *) __attribute__((noreturn)); -void setup_output (const QChar *, const QChar *, bool); -void translate_range (struct file_data const *, lin, lin, long *, long *); - -/* version.c */ -//extern const QChar version_string[]; - -private: - // gnudiff_analyze.cpp - lin diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal, struct partition *part); - void compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal); - void discard_confusing_lines (struct file_data filevec[]); - void shift_boundaries (struct file_data filevec[]); - struct change * add_change (lin line0, lin line1, lin deleted, lin inserted, struct change *old); - struct change * build_reverse_script (struct file_data const filevec[]); - struct change* build_script (struct file_data const filevec[]); - - // gnudiff_io.cpp - void find_and_hash_each_line (struct file_data *current); - void find_identical_ends (struct file_data filevec[]); - - // gnudiff_xmalloc.cpp - void *xmalloc (size_t n); - void *xrealloc(void *p, size_t n); - void xalloc_die (void); - - inline bool isWhite( QChar c ) - { - return c==' ' || c=='\t' || c=='\r'; - } -}; // class GnuDiff - -# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) -# define XREALLOC(Ptr, Type, N_items) \ - ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) - -/* Declare and alloc memory for VAR of type TYPE. */ -# define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1) - -/* Free VAR only if non NULL. */ -# define XFREE(Var) \ - do { \ - if (Var) \ - free (Var); \ - } while (0) - -/* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */ -# define CCLONE(Src, Num) \ - (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num))) - -/* Return a malloc'ed copy of SRC. */ -# define CLONE(Src) CCLONE (Src, 1) - -#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/gnudiff_io.cpp --- a/kdiff3/src/gnudiff_io.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,559 +0,0 @@ -/* File I/O for GNU DIFF. - - Modified for KDiff3 by Joachim Eibl 2003, 2004, 2005. - The original file was part of GNU DIFF. - - Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1998, 2001, 2002 - Free Software Foundation, Inc. - - GNU DIFF is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GNU DIFF is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#include "gnudiff_diff.h" -#include - -/* Rotate an unsigned value to the left. */ -#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n))) - -/* Given a hash value and a new character, return a new hash value. */ -#define HASH(h, c) ((c) + ROL (h, 7)) - -/* The type of a hash value. */ -typedef size_t hash_value; -verify (hash_value_is_unsigned, ! TYPE_SIGNED (hash_value)); - -/* Lines are put into equivalence classes of lines that match in lines_differ. - Each equivalence class is represented by one of these structures, - but only while the classes are being computed. - Afterward, each class is represented by a number. */ -struct equivclass -{ - lin next; /* Next item in this bucket. */ - hash_value hash; /* Hash of lines in this class. */ - const QChar *line; /* A line that fits this class. */ - size_t length; /* That line's length, not counting its newline. */ -}; - -/* Hash-table: array of buckets, each being a chain of equivalence classes. - buckets[-1] is reserved for incomplete lines. */ -static lin *buckets; - -/* Number of buckets in the hash table array, not counting buckets[-1]. */ -static size_t nbuckets; - -/* Array in which the equivalence classes are allocated. - The bucket-chains go through the elements in this array. - The number of an equivalence class is its index in this array. */ -static struct equivclass *equivs; - -/* Index of first free element in the array `equivs'. */ -static lin equivs_index; - -/* Number of elements allocated in the array `equivs'. */ -static lin equivs_alloc; - - -/* Check for binary files and compare them for exact identity. */ - -/* Return 1 if BUF contains a non text character. - SIZE is the number of characters in BUF. */ - -#define binary_file_p(buf, size) (memchr (buf, 0, size) != 0) - -/* Compare two lines (typically one from each input file) - according to the command line options. - For efficiency, this is invoked only when the lines do not match exactly - but an option like -i might cause us to ignore the difference. - Return nonzero if the lines differ. */ - -bool GnuDiff::lines_differ (const QChar *s1, size_t len1, const QChar *s2, size_t len2 ) -{ - const QChar *t1 = s1; - const QChar *t2 = s2; - const QChar *s1end = s1+len1; - const QChar *s2end = s2+len2; - - for ( ; ; ++t1, ++t2 ) - { - /* Test for exact char equality first, since it's a common case. */ - if ( t1!=s1end && t2!=s2end && *t1==*t2 ) - continue; - else - { - while ( t1!=s1end && - ( bIgnoreWhiteSpace && isWhite( *t1 ) || - bIgnoreNumbers && (t1->isDigit() || *t1=='-' || *t1=='.' ))) - { - ++t1; - } - - while ( t2 != s2end && - ( bIgnoreWhiteSpace && isWhite( *t2 ) || - bIgnoreNumbers && (t2->isDigit() || *t2=='-' || *t2=='.' ))) - { - ++t2; - } - - if ( t1!=s1end && t2!=s2end ) - { - if (ignore_case) - { /* Lowercase comparison. */ - if ( t1->lower() == t2->lower() ) - continue; - } - else if ( *t1 == *t2 ) - continue; - else - return true; - } - else if ( t1==s1end && t2==s2end ) - return false; - else - return true; - } - } - return false; -} - - -/* Split the file into lines, simultaneously computing the equivalence - class for each line. */ - -void GnuDiff::find_and_hash_each_line (struct file_data *current) -{ - hash_value h; - const QChar *p = current->prefix_end; - QChar c; - lin i, *bucket; - size_t length; - - /* Cache often-used quantities in local variables to help the compiler. */ - const QChar **linbuf = current->linbuf; - lin alloc_lines = current->alloc_lines; - lin line = 0; - lin linbuf_base = current->linbuf_base; - lin *cureqs = (lin*)xmalloc (alloc_lines * sizeof *cureqs); - struct equivclass *eqs = equivs; - lin eqs_index = equivs_index; - lin eqs_alloc = equivs_alloc; - const QChar *suffix_begin = current->suffix_begin; - const QChar *bufend = current->buffer + current->buffered; - bool diff_length_compare_anyway = - ignore_white_space != IGNORE_NO_WHITE_SPACE || bIgnoreNumbers; - bool same_length_diff_contents_compare_anyway = - diff_length_compare_anyway | ignore_case; - - while ( p < suffix_begin) - { - const QChar *ip = p; - - h = 0; - - /* Hash this line until we find a newline or bufend is reached. */ - if (ignore_case) - switch (ignore_white_space) - { - case IGNORE_ALL_SPACE: - while ( pbuffered_lines = line; - - for (i = 0; ; i++) - { - /* Record the line start for lines in the suffix that we care about. - Record one more line start than lines, - so that we can compute the length of any buffered line. */ - if (line == alloc_lines) - { - /* Double (alloc_lines - linbuf_base) by adding to alloc_lines. */ - if ((lin)(PTRDIFF_MAX / 3) <= alloc_lines - || (lin)(PTRDIFF_MAX / sizeof *cureqs) <= 2 * alloc_lines - linbuf_base - || (lin)(PTRDIFF_MAX / sizeof *linbuf) <= alloc_lines - linbuf_base) - xalloc_die (); - alloc_lines = 2 * alloc_lines - linbuf_base; - linbuf += linbuf_base; - linbuf = (const QChar**)xrealloc (linbuf, - (alloc_lines - linbuf_base) * sizeof *linbuf); - linbuf -= linbuf_base; - } - linbuf[line] = p; - - if ( p >= bufend) - break; - - if (context <= i && no_diff_means_no_output) - break; - - line++; - - while (plinbuf = linbuf; - current->valid_lines = line; - current->alloc_lines = alloc_lines; - current->equivs = cureqs; - equivs = eqs; - equivs_alloc = eqs_alloc; - equivs_index = eqs_index; -} - -/* We have found N lines in a buffer of size S; guess the - proportionate number of lines that will be found in a buffer of - size T. However, do not guess a number of lines so large that the - resulting line table might cause overflow in size calculations. */ -static lin -guess_lines (lin n, size_t s, size_t t) -{ - size_t guessed_bytes_per_line = n < 10 ? 32 : s / (n - 1); - lin guessed_lines = MAX (1, t / guessed_bytes_per_line); - return MIN (guessed_lines, (lin)(PTRDIFF_MAX / (2 * sizeof (QChar *) + 1) - 5)) + 5; -} - -/* Given a vector of two file_data objects, find the identical - prefixes and suffixes of each object. */ - -void GnuDiff::find_identical_ends (struct file_data filevec[]) -{ - /* Find identical prefix. */ - const QChar *p0, *p1, *buffer0, *buffer1; - p0 = buffer0 = filevec[0].buffer; - p1 = buffer1 = filevec[1].buffer; - size_t n0, n1; - n0 = filevec[0].buffered; - n1 = filevec[1].buffered; - const QChar* const pEnd0 = p0 + n0; - const QChar* const pEnd1 = p1 + n1; - - if (p0 == p1) - /* The buffers are the same; sentinels won't work. */ - p0 = p1 += n1; - else - { - /* Loop until first mismatch, or end. */ - while ( p0!=pEnd0 && p1!=pEnd1 && *p0 == *p1 ) - { - p0++; - p1++; - } - } - - /* Now P0 and P1 point at the first nonmatching characters. */ - - /* Skip back to last line-beginning in the prefix. */ - while (p0 != buffer0 && (p0[-1] != '\n' )) - p0--, p1--; - - /* Record the prefix. */ - filevec[0].prefix_end = p0; - filevec[1].prefix_end = p1; - - /* Find identical suffix. */ - - /* P0 and P1 point beyond the last chars not yet compared. */ - p0 = buffer0 + n0; - p1 = buffer1 + n1; - - const QChar *end0, *beg0; - end0 = p0; /* Addr of last char in file 0. */ - - /* Get value of P0 at which we should stop scanning backward: - this is when either P0 or P1 points just past the last char - of the identical prefix. */ - beg0 = filevec[0].prefix_end + (n0 < n1 ? 0 : n0 - n1); - - /* Scan back until chars don't match or we reach that point. */ - for (; p0 != beg0; p0--, p1--) - { - if (*p0 != *p1) - { - /* Point at the first char of the matching suffix. */ - beg0 = p0; - break; - } - } - - // Go to the next line (skip last line with a difference) - if ( p0 != end0 ) - { - if (*p0 != *p1) - ++p0; - while ( p0. */ - -static unsigned char const prime_offset[] = -{ - 0, 0, 1, 1, 3, 1, 3, 1, 5, 3, 3, 9, 3, 1, 3, 19, 15, 1, 5, 1, 3, 9, 3, - 15, 3, 39, 5, 39, 57, 3, 35, 1, 5, 9, 41, 31, 5, 25, 45, 7, 87, 21, - 11, 57, 17, 55, 21, 115, 59, 81, 27, 129, 47, 111, 33, 55, 5, 13, 27, - 55, 93, 1, 57, 25 -}; - -/* Verify that this host's size_t is not too wide for the above table. */ - -verify (enough_prime_offsets, - sizeof (size_t) * CHAR_BIT <= sizeof prime_offset); - -/* Given a vector of two file_data objects, read the file associated - with each one, and build the table of equivalence classes. - Return nonzero if either file appears to be a binary file. - If PRETEND_BINARY is nonzero, pretend they are binary regardless. */ - -bool -GnuDiff::read_files (struct file_data filevec[], bool /*pretend_binary*/) -{ - int i; - - find_identical_ends (filevec); - - equivs_alloc = filevec[0].alloc_lines + filevec[1].alloc_lines + 1; - if ((lin)(PTRDIFF_MAX / sizeof *equivs) <= equivs_alloc) - xalloc_die (); - equivs = (equivclass*)xmalloc (equivs_alloc * sizeof *equivs); - /* Equivalence class 0 is permanently safe for lines that were not - hashed. Real equivalence classes start at 1. */ - equivs_index = 1; - - /* Allocate (one plus) a prime number of hash buckets. Use a prime - number between 1/3 and 2/3 of the value of equiv_allocs, - approximately. */ - for (i = 9; 1 << i < equivs_alloc / 3; i++) - continue; - nbuckets = ((size_t) 1 << i) - prime_offset[i]; - if (PTRDIFF_MAX / sizeof *buckets <= nbuckets) - xalloc_die (); - buckets = (lin*)zalloc ((nbuckets + 1) * sizeof *buckets); - buckets++; - - for (i = 0; i < 2; i++) - find_and_hash_each_line (&filevec[i]); - - filevec[0].equiv_max = filevec[1].equiv_max = equivs_index; - - free (equivs); - free (buckets - 1); - - return 0; -} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/gnudiff_system.h --- a/kdiff3/src/gnudiff_system.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* System dependent declarations. - - Modified for KDiff3 by Joachim Eibl 2003. - The original file was part of GNU DIFF. - - Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1998, 2001, 2002 - Free Software Foundation, Inc. - - GNU DIFF is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GNU DIFF is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. - If not, write to the Free Software Foundation, - 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef GNUDIFF_SYSTEM_H -#define GNUDIFF_SYSTEM_H - -//#include - - - -/* Don't bother to support K&R C compilers any more; it's not worth - the trouble. These macros prevent some library modules from being - compiled in K&R C mode. */ -#define PARAMS(Args) Args -#define PROTOTYPES 1 - -/* Define `__attribute__' and `volatile' first - so that they're used consistently in all system includes. */ -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ -# define __attribute__(x) -#endif -#if defined const && !defined volatile -# define volatile -#endif - -/* Verify a requirement at compile-time (unlike assert, which is runtime). */ -#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } - - -/* Determine whether an integer type is signed, and its bounds. - This code assumes two's (or one's!) complement with no holes. */ - -/* The extra casts work around common compiler bugs, - e.g. Cray C 5.0.3.0 when t == time_t. */ -#ifndef TYPE_SIGNED -# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -#endif -#ifndef TYPE_MINIMUM -# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ - ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ - : (t) 0)) -#endif -#ifndef TYPE_MAXIMUM -# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) -#endif - -#include -#include - - -# include -#ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -#endif -#if !EXIT_FAILURE -# undef EXIT_FAILURE /* Sony NEWS-OS 4.0C defines EXIT_FAILURE to 0. */ -# define EXIT_FAILURE 1 -#endif -#define EXIT_TROUBLE 2 - -#include -#ifndef SSIZE_MAX -# define SSIZE_MAX TYPE_MAXIMUM (ssize_t) -#endif - -#ifndef PTRDIFF_MAX -# define PTRDIFF_MAX TYPE_MAXIMUM (ptrdiff_t) -#endif -#ifndef SIZE_MAX -# define SIZE_MAX TYPE_MAXIMUM (size_t) -#endif -#ifndef UINTMAX_MAX -# define UINTMAX_MAX TYPE_MAXIMUM (uintmax_t) -#endif - -#include -#include -#include - -/* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given - as an argument to macros like `isspace'. */ -# define CTYPE_DOMAIN(c) 1 -#define ISPRINT(c) (CTYPE_DOMAIN (c) && isprint (c)) -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) - -# define TOLOWER(c) tolower (c) - -/* ISDIGIT differs from isdigit, as follows: - - Its arg may be any int or unsigned int; it need not be an unsigned char. - - It's guaranteed to evaluate its argument exactly once. - - It's typically faster. - POSIX 1003.1-2001 says that only '0' through '9' are digits. - Prefer ISDIGIT to isdigit unless it's important to use the locale's - definition of `digit' even when the host does not conform to POSIX. */ -#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) - -#undef MIN -#undef MAX -#define MIN(a, b) ((a) <= (b) ? (a) : (b)) -#define MAX(a, b) ((a) >= (b) ? (a) : (b)) - - -/* The integer type of a line number. Since files are read into main - memory, ptrdiff_t should be wide enough. */ - -typedef ptrdiff_t lin; -#define LIN_MAX PTRDIFF_MAX -verify (lin_is_signed, TYPE_SIGNED (lin)); -verify (lin_is_wide_enough, sizeof (ptrdiff_t) <= sizeof (lin)); -verify (lin_is_printable_as_long, sizeof (lin) <= sizeof (long)); - -#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/gnudiff_xmalloc.cpp --- a/kdiff3/src/gnudiff_xmalloc.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* xmalloc.c -- malloc with out of memory checking - - Modified for KDiff3 by Joachim Eibl 2003. - The original file was part of GNU DIFF. - - Copyright (C) 1990-1999, 2000, 2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include - - -#include -#include - - -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -#include "gnudiff_diff.h" -/* If non NULL, call this function when memory is exhausted. */ -//void (*xalloc_fail_func) PARAMS ((void)) = 0; -void (*xalloc_fail_func)(void) = 0; - - -void GnuDiff::xalloc_die (void) -{ - if (xalloc_fail_func) - (*xalloc_fail_func) (); - //error (exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted)); - /* The `noreturn' cannot be given to error, since it may return if - its first argument is 0. To help compilers understand the - xalloc_die does terminate, call exit. */ - exit (EXIT_FAILURE); -} - -/* Allocate N bytes of memory dynamically, with error checking. */ - -void * -GnuDiff::xmalloc (size_t n) -{ - void *p; - - p = malloc (n == 0 ? 1 : n); // There are systems where malloc returns 0 for n==0. - if (p == 0) - xalloc_die (); - return p; -} - -/* Change the size of an allocated block of memory P to N bytes, - with error checking. */ - -void * -GnuDiff::xrealloc (void *p, size_t n) -{ - p = realloc (p, n==0 ? 1 : n); - if (p == 0) - xalloc_die (); - return p; -} - - -/* Yield a new block of SIZE bytes, initialized to zero. */ - -void * -GnuDiff::zalloc (size_t size) -{ - void *p = xmalloc (size); - memset (p, 0, size); - return p; -} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/hi16-app-kdiff3.png Binary file kdiff3/src/hi16-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/hi32-app-kdiff3.png Binary file kdiff3/src/hi32-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3.cpp --- a/kdiff3/src/kdiff3.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,968 +0,0 @@ -/*************************************************************************** - kdiff3.cpp - description - ------------------- - begin : Don Jul 11 12:31:29 CEST 2002 - copyright : (C) 2002-2004 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "difftextwindow.h" -#include "mergeresultwindow.h" - -#include - -// include files for QT -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include - -// include files for KDE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include - -// application specific includes -#include "kdiff3.h" -#include "optiondialog.h" -#include "fileaccess.h" -#include "kdiff3_part.h" -#include "directorymergewindow.h" -#include "smalldialogs.h" - -#define ID_STATUS_MSG 1 - -KActionCollection* KDiff3App::actionCollection() -{ - if ( m_pKDiff3Shell==0 ) - return m_pKDiff3Part->actionCollection(); - else - return m_pKDiff3Shell->actionCollection(); -} - -KStatusBar* KDiff3App::statusBar() -{ - if ( m_pKDiff3Shell==0 ) - return 0; - else - return m_pKDiff3Shell->statusBar(); -} - -KToolBar* KDiff3App::toolBar(const char* toolBarId ) -{ - if ( m_pKDiff3Shell==0 ) - return 0; - else - return m_pKDiff3Shell->toolBar( toolBarId ); -} - -bool KDiff3App::isPart() -{ - return m_pKDiff3Shell==0; -} - -bool KDiff3App::isFileSaved() -{ - return m_bFileSaved; -} - -KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part ) - :QSplitter(pParent, name) //previously KMainWindow -{ - m_pKDiff3Part = pKDiff3Part; - m_pKDiff3Shell = dynamic_cast(pParent); - - setCaption( "KDiff3" ); - - m_pMainSplitter = 0; - m_pDirectoryMergeWindow = 0; - m_pCornerWidget = 0; - m_pMainWidget = 0; - m_pDiffTextWindow1 = 0; - m_pDiffTextWindow2 = 0; - m_pDiffTextWindow3 = 0; - m_pDiffTextWindowFrame1 = 0; - m_pDiffTextWindowFrame2 = 0; - m_pDiffTextWindowFrame3 = 0; - m_pDiffWindowSplitter = 0; - m_pOverview = 0; - m_bTripleDiff = false; - m_pMergeResultWindow = 0; - m_pMergeWindowFrame = 0; - m_bOutputModified = false; - m_bFileSaved = false; - m_bTimerBlock = false; - m_pHScrollBar = 0; - - // Needed before any file operations via FileAccess happen. - if (!g_pProgressDialog) - g_pProgressDialog = new ProgressDialog(0); - - // All default values must be set before calling readOptions(). - m_pOptionDialog = new OptionDialog( m_pKDiff3Shell!=0, this ); - connect( m_pOptionDialog, SIGNAL(applyClicked()), this, SLOT(slotRefresh()) ); - - m_pOptionDialog->readOptions( isPart() ? m_pKDiff3Part->instance()->config() : kapp->config() ); - - // Option handling: Only when pParent==0 (no parent) - KCmdLineArgs *args = isPart() ? 0 : KCmdLineArgs::parsedArgs(); - - if (args) - { - QString s; - QString title; - if ( args->isSet("confighelp") ) - { - s = m_pOptionDialog->calcOptionHelp(); - title = i18n("Current Configuration:"); - } - else - { - s = m_pOptionDialog->parseOptions( args->getOptionList("cs") ); - title = i18n("Config Option Error:"); - } - if (!s.isEmpty()) - { -#ifdef _WIN32 - // A windows program has no console - //KMessageBox::information(0, s,i18n("KDiff3-Usage")); - QDialog* pDialog = new QDialog(this,"",true,Qt::WDestructiveClose); - pDialog->setCaption(title); - Q3VBoxLayout* pVBoxLayout = new Q3VBoxLayout( pDialog ); - Q3TextEdit* pTextEdit = new Q3TextEdit(pDialog); - pTextEdit->setText(s); - pTextEdit->setReadOnly(true); - pTextEdit->setWordWrap(Q3TextEdit::NoWrap); - pVBoxLayout->addWidget(pTextEdit); - pDialog->resize(600,400); - pDialog->exec(); -#else - std::cerr << title.latin1() << std::endl; - std::cerr << s.latin1() << std::endl; -#endif - exit(1); - } - } - - m_sd1.setOptionDialog(m_pOptionDialog); - m_sd2.setOptionDialog(m_pOptionDialog); - m_sd3.setOptionDialog(m_pOptionDialog); - - if (args!=0) - { - m_outputFilename = args->getOption("output"); - if ( m_outputFilename.isEmpty() ) - m_outputFilename = args->getOption("out"); - } - - m_bAuto = args!=0 && args->isSet("auto"); - if ( m_bAuto && m_outputFilename.isEmpty() ) - { - //KMessageBox::information(this, i18n("Option --auto used, but no output file specified.")); - std::cerr << i18n("Option --auto used, but no output file specified.").ascii()<isSet("merge") ) - { - m_outputFilename = "unnamed.txt"; - m_bDefaultFilename = true; - } - else - m_bDefaultFilename = false; - - g_bAutoSolve = args!=0 && !args->isSet("qall"); // Note that this is effective only once. - - if ( args!=0 ) - { - m_sd1.setFilename( args->getOption("base") ); - if ( m_sd1.isEmpty() ) - { - if ( args->count() > 0 ) m_sd1.setFilename( args->url(0).url() ); // args->arg(0) - if ( args->count() > 1 ) m_sd2.setFilename( args->url(1).url() ); - if ( args->count() > 2 ) m_sd3.setFilename( args->url(2).url() ); - } - else - { - if ( args->count() > 0 ) m_sd2.setFilename( args->url(0).url() ); - if ( args->count() > 1 ) m_sd3.setFilename( args->url(1).url() ); - } - - - QCStringList aliasList = args->getOptionList("fname"); - QCStringList::Iterator ali = aliasList.begin(); - - QString an1 = args->getOption("L1"); - if ( !an1.isEmpty() ) { m_sd1.setAliasName(an1); } - else if ( ali != aliasList.end() ) { m_sd1.setAliasName(*ali); ++ali; } - - QString an2 = args->getOption("L2"); - if ( !an2.isEmpty() ) { m_sd2.setAliasName(an2); } - else if ( ali != aliasList.end() ) { m_sd2.setAliasName(*ali); ++ali; } - - QString an3 = args->getOption("L3"); - if ( !an3.isEmpty() ) { m_sd3.setAliasName(an3); } - else if ( ali != aliasList.end() ) { m_sd3.setAliasName(*ali); ++ali; } - } - /////////////////////////////////////////////////////////////////// - // call inits to invoke all other construction parts - initActions(actionCollection()); - initStatusBar(); - - m_pFindDialog = new FindDialog( this ); - connect( m_pFindDialog, SIGNAL(findNext()), this, SLOT(slotEditFindNext())); - - autoAdvance->setChecked( m_pOptionDialog->m_bAutoAdvance ); - showWhiteSpaceCharacters->setChecked( m_pOptionDialog->m_bShowWhiteSpaceCharacters ); - showWhiteSpace->setChecked( m_pOptionDialog->m_bShowWhiteSpace ); - showWhiteSpaceCharacters->setEnabled( m_pOptionDialog->m_bShowWhiteSpace ); - showLineNumbers->setChecked( m_pOptionDialog->m_bShowLineNumbers ); - wordWrap->setChecked( m_pOptionDialog->m_bWordWrap ); - if ( ! isPart() ) - { - viewToolBar->setChecked( m_pOptionDialog->m_bShowToolBar ); - viewStatusBar->setChecked( m_pOptionDialog->m_bShowStatusBar ); - slotViewToolBar(); - slotViewStatusBar(); - if( toolBar("mainToolBar")!=0 ) - toolBar("mainToolBar")->setBarPos( (KToolBar::BarPosition) m_pOptionDialog->m_toolBarPos ); -/* QSize size = m_pOptionDialog->m_geometry; - QPoint pos = m_pOptionDialog->m_position; - if(!size.isEmpty()) - { - m_pKDiff3Shell->resize( size ); - QRect visibleRect = QRect( pos, size ) & QApplication::desktop()->rect(); - if ( visibleRect.width()>100 && visibleRect.height()>100 ) - m_pKDiff3Shell->move( pos ); - }*/ - } - slotRefresh(); - - m_pMainSplitter = this; //new QSplitter(this); - m_pMainSplitter->setOrientation( Qt::Vertical ); -// setCentralWidget( m_pMainSplitter ); - m_pDirectoryMergeSplitter = new QSplitter( m_pMainSplitter ); - m_pDirectoryMergeSplitter->setOrientation( Qt::Horizontal ); - m_pDirectoryMergeWindow = new DirectoryMergeWindow( m_pDirectoryMergeSplitter, m_pOptionDialog, - KApplication::kApplication()->iconLoader() ); - m_pDirectoryMergeInfo = new DirectoryMergeInfo( m_pDirectoryMergeSplitter ); - m_pDirectoryMergeWindow->setDirectoryMergeInfo( m_pDirectoryMergeInfo ); - 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(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&))); - - m_pDirectoryMergeWindow->initDirectoryMergeActions( this, actionCollection() ); - - if ( args!=0 ) args->clear(); // Free up some memory. - - if (m_pKDiff3Shell==0) - { - completeInit(); - } -} - - -void KDiff3App::completeInit( const QString& fn1, const QString& fn2, const QString& fn3 ) -{ - if (m_pKDiff3Shell!=0) - { - QSize size=m_pOptionDialog->m_geometry; - QPoint pos=m_pOptionDialog->m_position; - if(!size.isEmpty()) - { - m_pKDiff3Shell->resize( size ); - QRect visibleRect = QRect( pos, size ) & QApplication::desktop()->rect(); - if ( visibleRect.width()>100 && visibleRect.height()>100 ) - m_pKDiff3Shell->move( pos ); - if (!m_bAuto) - m_pKDiff3Shell->show(); - } - } - if ( ! fn1.isEmpty() ) { m_sd1.setFilename(fn1); } - if ( ! fn2.isEmpty() ) { m_sd2.setFilename(fn2); } - if ( ! fn3.isEmpty() ) { m_sd3.setFilename(fn3); } - - bool bSuccess = improveFilenames(false); - - if ( m_bAuto && m_bDirCompare ) - { - std::cerr << i18n("Option --auto ignored for directory comparison.").ascii()<hide(); - - init( m_bAuto ); - if ( m_bAuto ) - { - SourceData* pSD=0; - if ( m_sd3.isEmpty() ) - { - if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd1; } - } - else - { - if ( m_totalDiffStatus.bBinaryBEqC ){ pSD = &m_sd3; } // B==C (assume A is old) - else if ( m_totalDiffStatus.bBinaryAEqB ){ pSD = &m_sd3; } // assuming C has changed - else if ( m_totalDiffStatus.bBinaryAEqC ){ pSD = &m_sd2; } // assuming B has changed - } - - if ( pSD!=0 ) - { - // Save this file directly, not via the merge result window. - bool bSuccess = false; - FileAccess fa( m_outputFilename ); - if ( m_pOptionDialog->m_bDmCreateBakFiles && fa.exists() ) - { - QString newName = m_outputFilename + ".orig"; - if ( FileAccess::exists( newName ) ) FileAccess::removeFile( newName ); - if ( !FileAccess::exists( newName ) ) fa.rename( newName ); - } - - bSuccess = pSD->saveNormalDataAs( m_outputFilename ); - if ( bSuccess ) ::exit(0); - else KMessageBox::error( this, i18n("Saving failed.") ); - } - else if ( m_pMergeResultWindow->getNrOfUnsolvedConflicts() == 0 ) - { - bool bSuccess = m_pMergeResultWindow->saveDocument( m_outputFilename ); - if ( bSuccess ) ::exit(0); - } - } - } - - if (m_pKDiff3Shell) - m_pKDiff3Shell->show(); - - if (statusBar() !=0 ) - statusBar()->setSizeGripEnabled(true); - - slotClipboardChanged(); // For initialisation. - - slotUpdateAvailabilities(); - - if ( ! m_bDirCompare && m_pKDiff3Shell!=0 ) - { - bool bFileOpenError = false; - if ( ! m_sd1.isEmpty() && !m_sd1.hasData() || - ! m_sd2.isEmpty() && !m_sd2.hasData() || - ! m_sd3.isEmpty() && !m_sd3.hasData() ) - { - QString text( i18n("Opening of these files failed:") ); - text += "\n\n"; - if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) - text += " - " + m_sd1.getAliasName() + "\n"; - if ( ! m_sd2.isEmpty() && !m_sd2.hasData() ) - text += " - " + m_sd2.getAliasName() + "\n"; - if ( ! m_sd3.isEmpty() && !m_sd3.hasData() ) - text += " - " + m_sd3.getAliasName() + "\n"; - - KMessageBox::sorry( this, text, i18n("File Open Error") ); - bFileOpenError = true; - } - - if ( m_sd1.isEmpty() || m_sd2.isEmpty() || bFileOpenError ) - slotFileOpen(); - } - else if ( !bSuccess ) // Directory open failed - { - slotFileOpen(); - } -} - -KDiff3App::~KDiff3App() -{ - -} - -void KDiff3App::initActions( KActionCollection* ac ) -{ - if (ac==0) KMessageBox::error(0, "actionCollection==0"); - - fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), ac); - fileOpen->setStatusText(i18n("Opens documents for comparison...")); - - 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!")); - fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), ac); - fileSaveAs->setStatusText(i18n("Saves the current document as...")); - filePrint = KStdAction::print(this, SLOT(slotFilePrint()), ac); - filePrint->setStatusText(i18n("Print the differences")); - fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), ac); - fileQuit->setStatusText(i18n("Quits the application")); - editCut = KStdAction::cut(this, SLOT(slotEditCut()), ac); - editCut->setStatusText(i18n("Cuts the selected section and puts it to the clipboard")); - editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), ac); - editCopy->setStatusText(i18n("Copies the selected section to the clipboard")); - editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), ac); - editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position")); - editSelectAll = KStdAction::selectAll(this, SLOT(slotEditSelectAll()), ac); - editSelectAll->setStatusText(i18n("Select everything in current window")); - editFind = KStdAction::find(this, SLOT(slotEditFind()), ac); - editFind->setStatusText(i18n("Search for a string")); - editFindNext = KStdAction::findNext(this, SLOT(slotEditFindNext()), ac); - editFindNext->setStatusText(i18n("Search again for the string")); - viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), ac); - viewToolBar->setStatusText(i18n("Enables/disables the toolbar")); - viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), ac); - viewStatusBar->setStatusText(i18n("Enables/disables the statusbar")); - KStdAction::keyBindings(this, SLOT(slotConfigureKeys()), ac); - KAction* pAction = KStdAction::preferences(this, SLOT(slotConfigure()), ac ); - if ( isPart() ) - pAction->setText(i18n("Configure KDiff3...")); - - -#include "xpm/downend.xpm" -#include "xpm/currentpos.xpm" -#include "xpm/down1arrow.xpm" -#include "xpm/down2arrow.xpm" -#include "xpm/upend.xpm" -#include "xpm/up1arrow.xpm" -#include "xpm/up2arrow.xpm" -#include "xpm/prevunsolved.xpm" -#include "xpm/nextunsolved.xpm" -#include "xpm/iconA.xpm" -#include "xpm/iconB.xpm" -#include "xpm/iconC.xpm" -#include "xpm/autoadvance.xpm" -#include "xpm/showwhitespace.xpm" -#include "xpm/showwhitespacechars.xpm" -#include "xpm/showlinenumbers.xpm" -//#include "reload.xpm" - - 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"), 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"); - chooseAForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose A for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseAForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_a_for_unsolved_whitespace_conflicts"); - chooseBForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose B for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseBForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_b_for_unsolved_whitespace_conflicts"); - chooseCForUnsolvedWhiteSpaceConflicts = new KAction(i18n("Choose C for All Unsolved Whitespace Conflicts"), 0, this, SLOT(slotChooseCForUnsolvedWhiteSpaceConflicts()), ac, "merge_choose_c_for_unsolved_whitespace_conflicts"); - autoSolve = new KAction(i18n("Automatically Solve Simple Conflicts"), 0, this, SLOT(slotAutoSolve()), ac, "merge_autosolve"); - unsolve = new KAction(i18n("Set Deltas to Conflicts"), 0, this, SLOT(slotUnsolve()), ac, "merge_autounsolve"); - mergeRegExp = new KAction(i18n("Run Regular Expression Auto Merge"), 0, this, SLOT(slotRegExpAutoMerge()),ac, "merge_regexp_automerge" ); - mergeHistory = new KAction(i18n("Automatically Solve History Conflicts"), 0, this, SLOT(slotMergeHistory()), ac, "merge_versioncontrol_history" ); - splitDiff = new KAction(i18n("Split Diff At Selection"), 0, this, SLOT(slotSplitDiff()), ac, "merge_splitdiff"); - joinDiffs = new KAction(i18n("Join Selected Diffs"), 0, this, SLOT(slotJoinDiffs()), ac, "merge_joindiffs"); - - 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"), 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"); - overviewModeAC = new KToggleAction(i18n("A vs. C Overview"), 0, this, SLOT(slotOverviewAC()), ac, "diff_overview_ac"); - overviewModeBC = new KToggleAction(i18n("B vs. C Overview"), 0, this, SLOT(slotOverviewBC()), ac, "diff_overview_bc"); - wordWrap = new KToggleAction(i18n("Word Wrap Diff Windows"), 0, this, SLOT(slotWordWrapToggled()), ac, "diff_wordwrap"); - addManualDiffHelp = new KAction(i18n("Add Manual Diff Alignment"), Qt::CTRL+Qt::Key_Y, this, SLOT(slotAddManualDiffHelp()), ac, "diff_add_manual_diff_help"); - clearManualDiffHelpList = new KAction(i18n("Clear All Manual Diff Alignments"), Qt::CTRL+Qt::SHIFT+Qt::Key_Y, this, SLOT(slotClearManualDiffHelpList()), ac, "diff_clear_manual_diff_help_list"); - -#ifdef _WIN32 - new KAction(i18n("Focus Next Window"), Qt::CTRL+Qt::Key_Tab, this, SLOT(slotWinFocusNext()), ac, "win_focus_next", false, false); -#endif - winFocusPrev = new KAction(i18n("Focus Prev Window"), Qt::ALT+Qt::Key_Left, this, SLOT(slotWinFocusPrev()), ac, "win_focus_prev"); - winToggleSplitOrientation = new KAction(i18n("Toggle Split Orientation"), 0, this, SLOT(slotWinToggleSplitterOrientation()), ac, "win_toggle_split_orientation"); - - dirShowBoth = new KToggleAction(i18n("Dir && Text Split Screen View"), 0, this, SLOT(slotDirShowBoth()), ac, "win_dir_show_both"); - dirShowBoth->setChecked( true ); - dirViewToggle = new KAction(i18n("Toggle Between Dir && Text View"), 0, this, SLOT(slotDirViewToggle()), actionCollection(), "win_dir_view_toggle"); - - m_pMergeEditorPopupMenu = new Q3PopupMenu( this ); - chooseA->plug( m_pMergeEditorPopupMenu ); - chooseB->plug( m_pMergeEditorPopupMenu ); - chooseC->plug( m_pMergeEditorPopupMenu ); -} - - -void KDiff3App::showPopupMenu( const QPoint& point ) -{ - m_pMergeEditorPopupMenu->popup( point ); -} - -void KDiff3App::initStatusBar() -{ - /////////////////////////////////////////////////////////////////// - // STATUSBAR - if (statusBar() !=0 ) - statusBar()->message( i18n("Ready.") ); -} - -void KDiff3App::saveOptions( KConfig* config ) -{ - if (!isPart()) - { - m_pOptionDialog->m_geometry = m_pKDiff3Shell->size(); - m_pOptionDialog->m_position = m_pKDiff3Shell->pos(); - if ( toolBar("mainToolBar")!=0 ) - m_pOptionDialog->m_toolBarPos = (int) toolBar("mainToolBar")->barPos(); - } - - m_pOptionDialog->saveOptions( config ); -} - - - - -bool KDiff3App::queryClose() -{ - saveOptions( isPart() ? m_pKDiff3Part->instance()->config() : kapp->config() ); - - if(m_bOutputModified) - { - int result = KMessageBox::warningYesNoCancel(this, - i18n("The merge result hasn't been saved."), - i18n("Warning"), i18n("Save && Quit"), i18n("Quit Without Saving") ); - if ( result==KMessageBox::Cancel ) - return false; - else if ( result==KMessageBox::Yes ) - { - slotFileSave(); - if ( m_bOutputModified ) - { - KMessageBox::sorry(this, i18n("Saving the merge result failed."), i18n("Warning") ); - return false; - } - } - } - - m_bOutputModified = false; - - if ( m_pDirectoryMergeWindow->isDirectoryMergeInProgress() ) - { - int result = KMessageBox::warningYesNo(this, - i18n("You are currently doing a directory merge. Are you sure, you want to abort?"), - i18n("Warning"), i18n("Quit"), i18n("Continue Merging") ); - if ( result!=KMessageBox::Yes ) - return false; - } - - return true; -} - - -///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION -///////////////////////////////////////////////////////////////////// - - -void KDiff3App::slotFileSave() -{ - if ( m_bDefaultFilename ) - { - slotFileSaveAs(); - } - else - { - slotStatusMsg(i18n("Saving file...")); - - bool bSuccess = m_pMergeResultWindow->saveDocument( m_outputFilename ); - if ( bSuccess ) - { - m_bFileSaved = true; - m_bOutputModified = false; - if ( m_bDirCompare ) - m_pDirectoryMergeWindow->mergeResultSaved(m_outputFilename); - } - - slotStatusMsg(i18n("Ready.")); - } -} - -void KDiff3App::slotFileSaveAs() -{ - slotStatusMsg(i18n("Saving file with a new filename...")); - - QString s = KFileDialog::getSaveURL( QDir::currentDirPath(), 0, this, i18n("Save As...") ).url(); - if(!s.isEmpty()) - { - m_outputFilename = s; - bool bSuccess = m_pMergeResultWindow->saveDocument( m_outputFilename ); - if ( bSuccess ) - { - m_bOutputModified = false; - if ( m_bDirCompare ) - m_pDirectoryMergeWindow->mergeResultSaved(m_outputFilename); - } - //setCaption(url.fileName(),doc->isModified()); - - m_bDefaultFilename = false; - } - - slotStatusMsg(i18n("Ready.")); -} - - -void printDiffTextWindow( MyPainter& painter, const QRect& view, const QString& headerText, DiffTextWindow* pDiffTextWindow, int line, int linesPerPage, QColor fgColor ) -{ - QRect clipRect = view; - clipRect.setTop(0); - painter.setClipRect( clipRect ); - painter.translate( view.left() , 0 ); - QFontMetrics fm = painter.fontMetrics(); - //if ( fm.width(headerText) > view.width() ) - { - // A simple wrapline algorithm - int l=0; - for (int p=0; pview.width()) - { - --i; - break; - } - //QString s2 = s.left(i); - painter.drawText( 0, l*fm.height() + fm.ascent(), s.left(i) ); - p+=i; - ++l; - } - painter.setPen( fgColor ); - painter.drawLine( 0, view.top()-2, view.width(), view.top()-2 ); - } - - painter.translate( 0, view.top() ); - pDiffTextWindow->print( painter, view, line, linesPerPage ); - painter.resetXForm(); -} - -void KDiff3App::slotFilePrint() -{ - if ( !m_pDiffTextWindow1 ) - return; - - KPrinter printer; - - int firstSelectionD3LIdx = -1; - int lastSelectionD3LIdx = -1; - if ( m_pDiffTextWindow1 ) { m_pDiffTextWindow1->getSelectionRange(&firstSelectionD3LIdx, &lastSelectionD3LIdx, eD3LLineCoords); } - if ( firstSelectionD3LIdx<0 && m_pDiffTextWindow2 ) { m_pDiffTextWindow2->getSelectionRange(&firstSelectionD3LIdx, &lastSelectionD3LIdx, eD3LLineCoords); } - if ( firstSelectionD3LIdx<0 && m_pDiffTextWindow3 ) { m_pDiffTextWindow3->getSelectionRange(&firstSelectionD3LIdx, &lastSelectionD3LIdx, eD3LLineCoords); } -#ifdef KREPLACEMENTS_H // Currently PrintSelection is not supported in KDEs print dialog. - if ( firstSelectionD3LIdx>=0 ) - { - printer.setOptionEnabled(KPrinter::PrintSelection,true); - } -#endif - - printer.setPageSelection(KPrinter::ApplicationSide); - printer.setMinMax(1,10000); - printer.setCurrentPage(10000); - - int currentFirstLine = m_pDiffTextWindow1->getFirstLine(); - int currentFirstD3LIdx = m_pDiffTextWindow1->convertLineToDiff3LineIdx( currentFirstLine ); - - // do some printer initialization - printer.setFullPage( false ); - - // initialize the printer using the print dialog - if ( printer.setup( this ) ) - { - slotStatusMsg( i18n( "Printing..." ) ); - // create a painter to paint on the printer object - MyPainter painter( 0, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontMetrics().width('W') ); - - // start painting - if( !painter.begin( &printer ) ) { // paint on printer - slotStatusMsg( i18n( "Printing aborted." ) ); - return; - } - Q3PaintDeviceMetrics metrics( painter.device() ); - int dpiy = metrics.logicalDpiY(); - int columnDistance = (int) ( (0.5/2.54)*dpiy ); // 0.5 cm between the columns - - int columns = m_bTripleDiff ? 3 : 2; - int columnWidth = ( metrics.width() - (columns-1)*columnDistance ) / columns; - - QFont f = m_pOptionDialog->m_font; - f.setPointSizeFloat(f.pointSizeFloat()-1); // Print with slightly smaller font. - painter.setFont( f ); - QFontMetrics fm = painter.fontMetrics(); - - QString topLineText = i18n("Top line"); - - //int headerWidth = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" ); - int headerLines = fm.width( m_sd1.getAliasName() + ", "+topLineText+": 01234567" )/columnWidth+1; - - int headerMargin = headerLines * fm.height() + 3; // Text + one horizontal line - int footerMargin = fm.height() + 3; - - QRect view ( 0, headerMargin, metrics.width(), metrics.height() - (headerMargin + footerMargin) ); - QRect view1( 0*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); - QRect view2( 1*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); - QRect view3( 2*(columnWidth + columnDistance), view.top(), columnWidth, view.height() ); - - int linesPerPage = view.height() / fm.height(); - int charactersPerLine = columnWidth / fm.width("W"); - if ( m_pOptionDialog->m_bWordWrap ) - { - // For printing the lines are wrapped differently (this invalidates the first line) - recalcWordWrap( charactersPerLine ); - } - - int totalNofLines = max2(m_pDiffTextWindow1->getNofLines(), m_pDiffTextWindow2->getNofLines()); - if ( m_bTripleDiff && m_pDiffTextWindow3) - totalNofLines = max2(totalNofLines, m_pDiffTextWindow3->getNofLines()); - - Q3ValueList pageList = printer.pageList(); - - bool bPrintCurrentPage=false; - bool bFirstPrintedPage = false; - - bool bPrintSelection = false; - int totalNofPages = (totalNofLines+linesPerPage-1) / linesPerPage; - int line=-1; - int selectionEndLine = -1; - -#ifdef KREPLACEMENTS_H - if ( printer.printRange()==KPrinter::AllPages ) - { - pageList.clear(); - for(int i=0; i=0 ) - { - line = m_pDiffTextWindow1->convertDiff3LineIdxToLine( firstSelectionD3LIdx ); - selectionEndLine = m_pDiffTextWindow1->convertDiff3LineIdxToLine( lastSelectionD3LIdx+1 ); - totalNofPages = (selectionEndLine-line+linesPerPage-1) / linesPerPage; - } - } - - int page = 1; - - Q3ValueList::iterator pageListIt = pageList.begin(); - for(;;) - { - if (!bPrintSelection) - { - if (pageListIt==pageList.end()) - break; - page = *pageListIt; - line = (page - 1) * linesPerPage; - if (page==10000) // This means "Print the current page" - { - bPrintCurrentPage=true; - // Detect the first visible line in the window. - line = m_pDiffTextWindow1->convertDiff3LineIdxToLine( currentFirstD3LIdx ); - } - } - else - { - if ( line>=selectionEndLine ) - { - break; - } - else - { - if ( selectionEndLine-line < linesPerPage ) - linesPerPage=selectionEndLine-line; - } - } - if (line>=0 && linem_colorA ); - QString headerText1 = m_sd1.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow1->calcTopLineInFile(line)+1); - printDiffTextWindow( painter, view1, headerText1, m_pDiffTextWindow1, line, linesPerPage, m_pOptionDialog->m_fgColor ); - - painter.setPen( m_pOptionDialog->m_colorB ); - QString headerText2 = m_sd2.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow2->calcTopLineInFile(line)+1); - printDiffTextWindow( painter, view2, headerText2, m_pDiffTextWindow2, line, linesPerPage, m_pOptionDialog->m_fgColor ); - - if ( m_bTripleDiff && m_pDiffTextWindow3 ) - { - painter.setPen( m_pOptionDialog->m_colorC ); - QString headerText3 = m_sd3.getAliasName() + ", "+topLineText+": " + QString::number(m_pDiffTextWindow3->calcTopLineInFile(line)+1); - printDiffTextWindow( painter, view3, headerText3, m_pDiffTextWindow3, line, linesPerPage, m_pOptionDialog->m_fgColor ); - } - painter.setClipping(false); - - painter.setPen( m_pOptionDialog->m_fgColor ); - painter.drawLine( 0, view.bottom()+3, view.width(), view.bottom()+3 ); - QString s = bPrintCurrentPage ? QString("") - : QString::number( page ) + "/" + QString::number(totalNofPages); - if ( bPrintSelection ) s+=" (" + i18n("Selection") + ")"; - painter.drawText( (view.right() - painter.fontMetrics().width( s ))/2, - view.bottom() + painter.fontMetrics().ascent() + 5, s ); - - bFirstPrintedPage = true; - } - - if ( bPrintSelection ) - { - line+=linesPerPage; - ++page; - } - else - { - ++pageListIt; - } - } - - painter.end(); - - if ( m_pOptionDialog->m_bWordWrap ) - { - recalcWordWrap(); - m_pDiffVScrollBar->setValue( m_pDiffTextWindow1->convertDiff3LineIdxToLine( currentFirstD3LIdx ) ); - } - - slotStatusMsg( i18n( "Printing completed." ) ); - } - else - { - slotStatusMsg( i18n( "Printing aborted." ) ); - } -} - -void KDiff3App::slotFileQuit() -{ - slotStatusMsg(i18n("Exiting...")); - - if( !queryClose() ) - return; // Don't quit - - KApplication::exit( isFileSaved() ? 0 : 1 ); -} - - - -void KDiff3App::slotViewToolBar() -{ - slotStatusMsg(i18n("Toggling toolbar...")); - m_pOptionDialog->m_bShowToolBar = viewToolBar->isChecked(); - /////////////////////////////////////////////////////////////////// - // turn Toolbar on or off - if ( toolBar("mainToolBar") !=0 ) - { - if(!m_pOptionDialog->m_bShowToolBar) - { - toolBar("mainToolBar")->hide(); - } - else - { - toolBar("mainToolBar")->show(); - } - } - - slotStatusMsg(i18n("Ready.")); -} - -void KDiff3App::slotViewStatusBar() -{ - slotStatusMsg(i18n("Toggle the statusbar...")); - m_pOptionDialog->m_bShowStatusBar = viewStatusBar->isChecked(); - /////////////////////////////////////////////////////////////////// - //turn Statusbar on or off - if (statusBar() !=0 ) - { - if(!viewStatusBar->isChecked()) - { - statusBar()->hide(); - } - else - { - statusBar()->show(); - } - } - - slotStatusMsg(i18n("Ready.")); -} - - -void KDiff3App::slotStatusMsg(const QString &text) -{ - /////////////////////////////////////////////////////////////////// - // change status message permanently - if (statusBar() !=0 ) - { - statusBar()->clear(); - statusBar()->message( text ); - } -} - - - - -//#include "kdiff3.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3.desktop --- a/kdiff3/src/kdiff3.desktop Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ - -[Desktop Entry] -Encoding=UTF-8 -Name=KDiff3 -Name[hi]=के-डिफ3 -Name[sv]=Kdiff3 -Name[ta]=கேடிஃபà¯3 -Name[xx]=xxKDiff3xx -GenericName=Diff/Patch Frontend -GenericName[bg]=Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð½Ð° Diff/Patch -GenericName[bs]=Interfejs za Diff/Patch -GenericName[ca]=Interfície per a diff/patch -GenericName[cs]=Rozhraní pro Diff/Patch -GenericName[cy]=Blaen Gwahaniaethau/Clytiau -GenericName[da]=Forende for diff/patch -GenericName[de]=Graphische Oberfläche zu Diff/Patch -GenericName[el]=ΣÏστημα υποστήÏιξης χÏήστη για τα Diff/Patch -GenericName[es]=Interfaz Diff/Patch -GenericName[et]=Võrdlemise ja liitmise rakendus -GenericName[fr]=Interface graphique à diff / patch -GenericName[ga]=Comhéadan Diff/Patch -GenericName[hi]=डिफ/पैच फà¥à¤°à¤¨à¥à¤Ÿà¤à¤£à¥à¤¡ -GenericName[hu]=Grafikus diff/patch -GenericName[is]=Diff/Patch viðmót -GenericName[it]=Interfaccia per diff/patch -GenericName[ja]=Diff/Patch フロントエンド -GenericName[lt]=Diff/Patch naudotojo sÄ…saja -GenericName[ms]=Bahagian Depan Beza/Tampal -GenericName[nb]=Endrings-/lappeprogram -GenericName[nl]=Een schil voor Diff/Patch -GenericName[pa]=Diff/Patch ਮà©à©±à¨– -GenericName[pl]=Interfejs do programów Diff/Patch -GenericName[pt]=Interface do Diff/Patch -GenericName[pt_BR]=Um front-end para Diff/Patch -GenericName[ru]=ГрафичеÑкий Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ðº Diff и Patch -GenericName[sr]=Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÑ˜Ñ Ð·Ð° diff и patch -GenericName[sr@Latn]=Interfejs za diff i patch -GenericName[sv]=Jämförelse- och programfixgränssnitt -GenericName[ta]= Diff/Patch Frontend -GenericName[tg]=ИнтерфейÑи графикӣ ба Diff ва Patch -GenericName[tr]=Diff/Patch Arayüzü -GenericName[uk]=Ð†Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð´Ð¾ diff/patch -GenericName[xx]=xxDiff/Patch Frontendxx -GenericName[zh_CN]=Diff/Patch å‰ç«¯ -GenericName[zu]=Diff/PatchIsiqalo sokugcina -Exec=kdiff3 %i %m -caption "%c" -Icon=kdiff3 -Type=Application -DocPath=kdiff3/index.html -Comment=A File And Directory Comparison And Merge Tool -Comment[bg]=ИнÑтрумент за ÑравнÑване и Ñливане на файлове и директории -Comment[bs]=Alat za uporeÄ‘ivanje i spajanje datoteka i direktorija -Comment[ca]=Una eina per a comparar i fusionar fitxers o directoris -Comment[cs]=Nástroj pro porovnávání a sluÄování souborů a adresářů -Comment[da]=Et indfletningsværktøj for filer og mapper -Comment[de]=Programm zum Vergleichen und Zusammenführen von Dateien und Ordnern -Comment[el]=Ένα εÏγαλείο σÏγκÏισης και συγχώνευσης αÏχείων και καταλόγων -Comment[es]=Una herramienta para mezclar y comparar archivos y directorios -Comment[et]=Failide ja kataloogide võrdlemise ja liitmise tööriist -Comment[fr]=Un outil de comparaison et de fusion de fichiers et dossiers -Comment[hi]=à¤à¤• फाइल तथा डिरेकà¥à¤Ÿà¥à¤°à¥€ तà¥à¤²à¤¨à¤¾ तथा विलीन उपकरण -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 -Comment[ja]=ファイル/ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®æ¯”較/çµ±åˆãƒ„ール -Comment[ka]=ფáƒáƒ˜áƒšáƒ—რდრსáƒáƒ¥áƒáƒ¦áƒáƒšáƒ“ეთრშედáƒáƒ áƒ”ბის დრშერწყმის ხელსáƒáƒ¬áƒ§áƒ -Comment[ms]=Perbandingan Fail Dan Direktori Dan Alatan Gabungan -Comment[nb]=Et verktøy for Ã¥ sammenlikne og slÃ¥ sammen filer og mapper -Comment[nl]=Hulpmiddel voor het vergelijken en samenvoegen van bestanden en mappen -Comment[pa]=ਇੱਕ ਫਾਇਲ ਅਤੇ ਡਾਇਰੈਕਟਰੀ ਤà©à¨²à¨¨à¨¾ ਅਤੇ ਮਿਲਾਨ ਸੰਦ ਹੈ -Comment[pl]=NarzÄ™dzie do porównywania oraz łączenia plików i katalogów -Comment[pt]=Uma Ferramenta de Comparação e Junção de Ficheiros e Pastas -Comment[pt_BR]=Uma Ferramenta de Comparação e Mesclagem de Arquivos e Diretórios -Comment[ru]=Утилита ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ Ð¸ Ð¾Ð±ÑŠÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² и каталогов -Comment[sr]=Ðлат за поређење и Ñтапање фајлова и директоријума -Comment[sr@Latn]=Alat za poreÄ‘enje i stapanje fajlova i direktorijuma -Comment[sv]=Ett jämförelseverktyg för fil- och katalogjämförelser -Comment[tg]=ÐÑбоби баробаркунӣ ва пайванди файлҳо ва каталогҳо -Comment[tr]=Bir Dosya Ve Klasör KarşılaÅŸtırma Ve BirleÅŸtirme Aracı -Comment[uk]=ЗаÑіб-утиліта Ð´Ð»Ñ Ð¿Ð¾Ñ€Ñ–Ð²Ð½ÑÐ½Ð½Ñ Ñ– Ð¿Ð¾Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² та каталогів -Comment[xx]=xxA File And Directory Comparison And Merge Toolxx -Comment[zh_CN]=一个文件和目录的比较åŠåˆå¹¶å·¥å…· -Terminal=false diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3.h --- a/kdiff3/src/kdiff3.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,411 +0,0 @@ -/*************************************************************************** - kdiff3.h - description - ------------------- - begin : Don Jul 11 12:31:29 CEST 2002 - copyright : (C) 2002-2004 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef KDIFF3_H -#define KDIFF3_H - -#include "diff.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -// include files for Qt -#include -#include -#include -//Added by qt3to4: -#include -#include -#include - -// include files for KDE -#include -#include -#include -#include -#include -#include - - -// forward declaration of the KDiff3 classes -class OptionDialog; -class FindDialog; -class ManualDiffHelpDialog; -class DiffTextWindow; -class DiffTextWindowFrame; -class MergeResultWindow; -class Overview; - -class QScrollBar; -class QComboBox; -class QLineEdit; -class QCheckBox; -class QSplitter; - - -class KDiff3Part; -class DirectoryMergeWindow; -class DirectoryMergeInfo; - - -class ReversibleScrollBar : public QScrollBar -{ - Q_OBJECT - bool* m_pbRightToLeftLanguage; - int m_realVal; -public: - ReversibleScrollBar( Qt::Orientation o, QWidget* pParent, bool* pbRightToLeftLanguage ) - : QScrollBar( o, pParent ) - { - m_pbRightToLeftLanguage=pbRightToLeftLanguage; - m_realVal=0; - connect( this, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int))); - } - void setAgain(){ setValue(m_realVal); } -public slots: - void slotValueChanged(int i) - { - m_realVal = i; - if(m_pbRightToLeftLanguage && *m_pbRightToLeftLanguage) - m_realVal = maxValue()-(i-minValue()); - emit valueChanged2(m_realVal); - } - void setValue(int i) - { - if(m_pbRightToLeftLanguage && *m_pbRightToLeftLanguage) - QScrollBar::setValue( maxValue()-(i-minValue()) ); - else - QScrollBar::setValue( i ); - } -signals: - void valueChanged2(int); -}; - -class KDiff3App : public QSplitter -{ - Q_OBJECT - - public: - /** constructor of KDiff3App, calls all init functions to create the application. - */ - KDiff3App( QWidget* parent, const char* name, KDiff3Part* pKDiff3Part ); - ~KDiff3App(); - - bool isPart(); - - /** initializes the KActions of the application */ - void initActions( KActionCollection* ); - - /** save general Options like all bar positions and status as well as the geometry - and the recent file list to the configuration file */ - void saveOptions( KConfig* ); - - /** read general Options again and initialize all variables like the recent file list */ - void readOptions( KConfig* ); - - // Finish initialisation (virtual, so that it can be called from the shell too.) - virtual void completeInit(const QString& fn1="", const QString& fn2="", const QString& fn3=""); - - /** queryClose is called by KMainWindow on each closeEvent of a window. Against the - * default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall - * be saved if Modified; on cancel the closeEvent is rejected. - * @see KMainWindow#queryClose - * @see KMainWindow#closeEvent - */ - virtual bool queryClose(); - virtual bool isFileSaved(); - - signals: - void createNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ); - protected: - void initDirectoryMergeActions(); - /** sets up the statusbar for the main window by initialzing a statuslabel. */ - void initStatusBar(); - - /** creates the centerwidget of the KMainWindow instance and sets it as the view */ - void initView(); - - public slots: - - /** open a file and load it into the document*/ - void slotFileOpen(); - void slotFileOpen2( QString fn1, QString fn2, QString fn3, QString ofn, - QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ); - - void slotFileNameChanged(const QString& fileName, int winIdx); - - /** save a document */ - void slotFileSave(); - /** save a document by a new filename*/ - void slotFileSaveAs(); - - void slotFilePrint(); - - /** closes all open windows by calling close() on each memberList item until the list is empty, then quits the application. - * If queryClose() returns false because the user canceled the saveModified() dialog, the closing breaks. - */ - void slotFileQuit(); - /** put the marked text/object into the clipboard and remove - * it from the document - */ - void slotEditCut(); - /** put the marked text/object into the clipboard - */ - void slotEditCopy(); - /** paste the clipboard into the document - */ - void slotEditPaste(); - /** toggles the toolbar - */ - void slotViewToolBar(); - /** toggles the statusbar - */ - void slotViewStatusBar(); - /** changes the statusbar contents for the standard label permanently, used to indicate current actions. - * @param text the text that is displayed in the statusbar - */ - void slotStatusMsg(const QString &text); - - private: - /** the configuration object of the application */ - //KConfig *config; - - // KAction pointers to enable/disable actions - KAction* fileOpen; - KAction* fileSave; - KAction* fileSaveAs; - KAction* filePrint; - KAction* fileQuit; - KAction* fileReload; - KAction* editCut; - KAction* editCopy; - KAction* editPaste; - KAction* editSelectAll; - KToggleAction* viewToolBar; - KToggleAction* viewStatusBar; - -//////////////////////////////////////////////////////////////////////// -// Special KDiff3 specific stuff starts here - KAction *editFind; - KAction *editFindNext; - - KAction *goCurrent; - KAction *goTop; - KAction *goBottom; - KAction *goPrevUnsolvedConflict; - KAction *goNextUnsolvedConflict; - KAction *goPrevConflict; - KAction *goNextConflict; - KAction *goPrevDelta; - KAction *goNextDelta; - KToggleAction *chooseA; - KToggleAction *chooseB; - KToggleAction *chooseC; - KToggleAction *autoAdvance; - KToggleAction *wordWrap; - KAction* splitDiff; - KAction* joinDiffs; - KAction* addManualDiffHelp; - KAction* clearManualDiffHelpList; - KToggleAction *showWhiteSpaceCharacters; - KToggleAction *showWhiteSpace; - KToggleAction *showLineNumbers; - KAction* chooseAEverywhere; - KAction* chooseBEverywhere; - KAction* chooseCEverywhere; - KAction* chooseAForUnsolvedConflicts; - KAction* chooseBForUnsolvedConflicts; - KAction* chooseCForUnsolvedConflicts; - KAction* chooseAForUnsolvedWhiteSpaceConflicts; - KAction* chooseBForUnsolvedWhiteSpaceConflicts; - KAction* chooseCForUnsolvedWhiteSpaceConflicts; - KAction* autoSolve; - KAction* unsolve; - KAction* mergeHistory; - KAction* mergeRegExp; - KToggleAction *showWindowA; - KToggleAction *showWindowB; - KToggleAction *showWindowC; - KAction *winFocusNext; - KAction *winFocusPrev; - KAction* winToggleSplitOrientation; - KToggleAction *dirShowBoth; - KAction *dirViewToggle; - KToggleAction *overviewModeNormal; - KToggleAction *overviewModeAB; - KToggleAction *overviewModeAC; - KToggleAction *overviewModeBC; - - - Q3PopupMenu* m_pMergeEditorPopupMenu; - - QSplitter* m_pMainSplitter; - QWidget* m_pMainWidget; - QWidget* m_pMergeWindowFrame; - ReversibleScrollBar* m_pHScrollBar; - QScrollBar* m_pDiffVScrollBar; - QScrollBar* m_pMergeVScrollBar; - - DiffTextWindow* m_pDiffTextWindow1; - DiffTextWindow* m_pDiffTextWindow2; - DiffTextWindow* m_pDiffTextWindow3; - DiffTextWindowFrame* m_pDiffTextWindowFrame1; - DiffTextWindowFrame* m_pDiffTextWindowFrame2; - DiffTextWindowFrame* m_pDiffTextWindowFrame3; - QSplitter* m_pDiffWindowSplitter; - - MergeResultWindow* m_pMergeResultWindow; - bool m_bTripleDiff; - - QSplitter* m_pDirectoryMergeSplitter; - DirectoryMergeWindow* m_pDirectoryMergeWindow; - DirectoryMergeInfo* m_pDirectoryMergeInfo; - bool m_bDirCompare; - - Overview* m_pOverview; - - QWidget* m_pCornerWidget; - - TotalDiffStatus m_totalDiffStatus; - - SourceData m_sd1; - SourceData m_sd2; - SourceData m_sd3; - - QString m_outputFilename; - bool m_bDefaultFilename; - - DiffList m_diffList12; - DiffList m_diffList23; - DiffList m_diffList13; - - DiffBufferInfo m_diffBufferInfo; - Diff3LineList m_diff3LineList; - Diff3LineVector m_diff3LineVector; - //ManualDiffHelpDialog* m_pManualDiffHelpDialog; - ManualDiffHelpList m_manualDiffHelpList; - - int m_neededLines; - int m_maxWidth; - int m_DTWHeight; - bool m_bOutputModified; - bool m_bFileSaved; - bool m_bTimerBlock; // Synchronisation - - OptionDialog* m_pOptionDialog; - FindDialog* m_pFindDialog; - - void init( bool bAuto=false, TotalDiffStatus* pTotalDiffStatus=0, bool bLoadFiles=true ); - - virtual bool eventFilter( QObject* o, QEvent* e ); - virtual void resizeEvent(QResizeEvent*); - - bool improveFilenames(bool bCreateNewInstance); - - bool runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList, int winIdx1, int winIdx2 ); - bool runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList ); - bool canContinue(); - - void choose(int choice); - - KActionCollection* actionCollection(); - KStatusBar* statusBar(); - KToolBar* toolBar(const char*); - KDiff3Part* m_pKDiff3Part; - KParts::MainWindow* m_pKDiff3Shell; - bool m_bAuto; - void recalcWordWrap(int nofVisibleColumns=-1); - -public slots: - void resizeDiffTextWindow(int newWidth, int newHeight); - void resizeMergeResultWindow(); - void slotRecalcWordWrap(); - - void showPopupMenu( const QPoint& point ); - - void scrollDiffTextWindow( int deltaX, int deltaY ); - void scrollMergeResultWindow( int deltaX, int deltaY ); - void setDiff3Line( int line ); - void sourceMask( int srcMask, int enabledMask ); - - void slotDirShowBoth(); - void slotDirViewToggle(); - - void slotUpdateAvailabilities(); - void slotEditSelectAll(); - void slotEditFind(); - void slotEditFindNext(); - void slotGoCurrent(); - void slotGoTop(); - void slotGoBottom(); - void slotGoPrevUnsolvedConflict(); - void slotGoNextUnsolvedConflict(); - void slotGoPrevConflict(); - void slotGoNextConflict(); - void slotGoPrevDelta(); - void slotGoNextDelta(); - void slotChooseA(); - void slotChooseB(); - void slotChooseC(); - void slotAutoSolve(); - void slotUnsolve(); - void slotMergeHistory(); - void slotRegExpAutoMerge(); - void slotChooseAEverywhere(); - void slotChooseBEverywhere(); - void slotChooseCEverywhere(); - void slotChooseAForUnsolvedConflicts(); - void slotChooseBForUnsolvedConflicts(); - void slotChooseCForUnsolvedConflicts(); - void slotChooseAForUnsolvedWhiteSpaceConflicts(); - void slotChooseBForUnsolvedWhiteSpaceConflicts(); - void slotChooseCForUnsolvedWhiteSpaceConflicts(); - void slotConfigure(); - void slotConfigureKeys(); - void slotRefresh(); - void slotSelectionEnd(); - void slotSelectionStart(); - void slotClipboardChanged(); - void slotOutputModified(); - void slotAfterFirstPaint(); - void slotMergeCurrentFile(); - void slotReload(); - void slotCheckIfCanContinue( bool* pbContinue ); - void slotShowWhiteSpaceToggled(); - void slotShowLineNumbersToggled(); - void slotAutoAdvanceToggled(); - void slotWordWrapToggled(); - void slotShowWindowAToggled(); - void slotShowWindowBToggled(); - void slotShowWindowCToggled(); - void slotWinFocusNext(); - void slotWinFocusPrev(); - void slotWinToggleSplitterOrientation(); - void slotOverviewNormal(); - void slotOverviewAB(); - void slotOverviewAC(); - void slotOverviewBC(); - void slotSplitDiff(); - void slotJoinDiffs(); - void slotAddManualDiffHelp(); - void slotClearManualDiffHelpList(); - - void slotNoRelevantChangesDetected(); -}; - -#endif // KDIFF3_H diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3.ico Binary file kdiff3/src/kdiff3.ico has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3.lsm --- a/kdiff3/src/kdiff3.lsm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -Begin3 -Title: kdiff3 -- Comparison and Merge of Files and Directories -Version: 0.9.89 -Entered-date: -Description: Tool for comparison and merge of two or three files or directories -Keywords: KDE Qt -Author: Joachim Eibl -Maintained-by: Joachim Eibl -Home-page: http://kdiff3.sourceforge.net -Alternate-site: http://extragear.kde.org/apps/kdiff3 -Primary-site: http://sourceforge.net/project/showfiles.php?group_id=58666 - xxxxxx kdiff3-0.9.89.tar.gz - xxx kdiff3-0.9.89.lsm -Platform: Linux. Needs Qt, runs even better on KDE -Copying-policy: GPL -End diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3.pro --- a/kdiff3/src/kdiff3.pro Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -TEMPLATE = app -# When unresolved items remain during linking: Try adding "shared" in the CONFIG. -CONFIG += qt warn_on thread release -HEADERS = version.h \ - diff.h \ - difftextwindow.h \ - mergeresultwindow.h \ - kdiff3.h \ - merger.h \ - optiondialog.h \ - kreplacements/kreplacements.h \ - directorymergewindow.h \ - fileaccess.h \ - kdiff3_shell.h \ - kdiff3_part.h \ - smalldialogs.h -SOURCES = main.cpp \ - diff.cpp \ - difftextwindow.cpp \ - kdiff3.cpp \ - merger.cpp \ - mergeresultwindow.cpp \ - optiondialog.cpp \ - pdiff.cpp \ - directorymergewindow.cpp \ - fileaccess.cpp \ - smalldialogs.cpp \ - kdiff3_shell.cpp \ - kdiff3_part.cpp \ - gnudiff_analyze.cpp \ - gnudiff_io.cpp \ - gnudiff_xmalloc.cpp \ - common.cpp \ - kreplacements/kreplacements.cpp \ - kreplacements/ShellContextMenu.cpp -TARGET = kdiff3 -INCLUDEPATH += . ./kreplacements - -win32 { -# QMAKE_CXXFLAGS_DEBUG -= -Zi -# QMAKE_CXXFLAGS_DEBUG += -GX -GR -Z7 /FR -DQT_NO_ASCII_CAST -# QMAKE_LFLAGS_DEBUG += /PDB:NONE -# QMAKE_CXXFLAGS_RELEASE += -GX -GR -DNDEBUG -DQT_NO_ASCII_CAST - - QMAKE_CXXFLAGS_DEBUG += -DQT_NO_ASCII_CAST - QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -DQT_NO_ASCII_CAST - RC_FILE = kdiff3win.rc -} -unix { - documentation.path = /usr/local/share/doc/kdiff3 - documentation.files = ../doc/* - - INSTALLS += documentation - - target.path = /usr/local/bin - INSTALLS += target -} -#The following line was inserted by qt3to4 -QT += qt3support diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3_meta_unload.cpp --- a/kdiff3/src/kdiff3_meta_unload.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3_part.cpp --- a/kdiff3/src/kdiff3_part.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,311 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2003-2006 Joachim Eibl * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "kdiff3_part.h" - -#include -#include -#include -#include - -#include -#include -//Added by qt3to4: -#include -#include "kdiff3.h" -#include "fileaccess.h" - -#include -#include -#include - -#include "version.h" - -KDiff3Part::KDiff3Part( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name ) - : KParts::ReadOnlyPart(parent, name) -{ - // we need an instance - setInstance( KDiff3PartFactory::instance() ); - - // this should be your custom internal widget - m_widget = new KDiff3App( parentWidget, widgetName, this ); - - // This hack is necessary to avoid a crash when the program terminates. - m_bIsShell = dynamic_cast(parentWidget)!=0; - - // notify the part that this is our internal widget - setWidget(m_widget); - - // create our actions - //KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - //KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); - //KStdAction::save(this, SLOT(save()), actionCollection()); - - setXMLFile("kdiff3_part.rc"); - - // we are read-write by default - setReadWrite(true); - - // we are not modified since we haven't done anything yet - setModified(false); -} - -KDiff3Part::~KDiff3Part() -{ - if ( m_widget!=0 && ! m_bIsShell ) - { - m_widget->saveOptions( m_widget->isPart() ? instance()->config() : kapp->config() ); - } -} - -void KDiff3Part::setReadWrite(bool /*rw*/) -{ -// ReadWritePart::setReadWrite(rw); -} - -void KDiff3Part::setModified(bool /*modified*/) -{ -/* - // get a handle on our Save action and make sure it is valid - KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save)); - if (!save) - return; - - // if so, we either enable or disable it based on the current - // state - if (modified) - save->setEnabled(true); - else - save->setEnabled(false); - - // in any event, we want our parent to do it's thing - ReadWritePart::setModified(modified); -*/ -} - -static void getNameAndVersion( const QString& str, const QString& lineStart, QString& fileName, QString& version ) -{ - if ( str.left( lineStart.length() )==lineStart && fileName.isEmpty() ) - { - int pos = lineStart.length(); - while ( pospos ) - { - while (pos2>pos && str[pos2]!=' ' && str[pos2]!='\t') --pos2; - fileName = str.mid( pos, pos2-pos ); - std::cerr << "KDiff3: " << fileName.latin1() << std::endl; - if ( FileAccess(fileName).exists() ) break; - --pos2; - } - - int vpos = str.findRev("\t", -1); - if ( vpos>0 && vpos>(int)pos2 ) - { - version = str.mid( vpos+1 ); - while( !version.right(1)[0].isLetterOrNumber() ) - version.truncate( version.length()-1 ); - } - } -} - - -bool KDiff3Part::openFile() -{ - // 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(QIODevice::ReadOnly) == false) - return false; - - // our example widget is text-based, so we use QTextStream instead - // of a raw QDataStream - QTextStream stream(&file); - QString str; - QString fileName1; - QString fileName2; - QString version1; - QString version2; - while (!stream.atEnd() && (fileName1.isEmpty() || fileName2.isEmpty()) ) - { - str = stream.readLine() + "\n"; - getNameAndVersion( str, "---", fileName1, version1 ); - getNameAndVersion( str, "+++", fileName2, version2 ); - } - - file.close(); - - if ( fileName1.isEmpty() && fileName2.isEmpty() ) - { - KMessageBox::sorry(m_widget, i18n("Couldn't find files for comparison.")); - return false; - } - - FileAccess f1(fileName1); - FileAccess f2(fileName2); - - if ( f1.exists() && f2.exists() && fileName1!=fileName2 ) - { - m_widget->slotFileOpen2( fileName1, fileName2, "", "", "", "", "", 0 ); - return true; - } - else if ( version1.isEmpty() && f1.exists() ) - { - // Normal patch - // patch -f -u --ignore-whitespace -i [inputfile] -o [outfile] [patchfile] - QString tempFileName = FileAccess::tempFileName(); - QString cmd = "patch -f -u --ignore-whitespace -i \"" + m_file + - "\" -o \""+tempFileName + "\" \"" + fileName1+ "\""; - - ::system( cmd.ascii() ); - - m_widget->slotFileOpen2( fileName1, tempFileName, "", "", - "", version2.isEmpty() ? fileName2 : "REV:"+version2+":"+fileName2, "", 0 ); // alias names -// std::cerr << "KDiff3: f1:" << fileName1.latin1() <<"<->"<slotFileOpen2( tempFileName, fileName2, "", "", - version1.isEmpty() ? fileName1 : "REV:"+version1+":"+fileName1, "", "", 0 ); // alias name -// std::cerr << "KDiff3: f2:" << fileName2.latin1() <<"<->"<"< [OUTPUTFILE] - - QString tempFileName1 = FileAccess::tempFileName(); - QString cmd1 = "cvs update -p -r " + version1 + " \"" + fileName1 + "\" >\""+tempFileName1+"\""; - ::system( cmd1.ascii() ); - - QString tempFileName2 = FileAccess::tempFileName(); - QString cmd2 = "cvs update -p -r " + version2 + " \"" + fileName2 + "\" >\""+tempFileName2+"\""; - ::system( cmd2.ascii() ); - - m_widget->slotFileOpen2( tempFileName1, tempFileName2, "", "", - "REV:"+version1+":"+fileName1, - "REV:"+version2+":"+fileName2, - "", 0 - ); - -// std::cerr << "KDiff3: f1/2:" << tempFileName1.latin1() <<"<->"<text(); - - file.close(); - return true; -*/ - return false; // Not implemented -} - - -// It's usually safe to leave the factory code alone.. with the -// notable exception of the KAboutData data -#include -#include - -KInstance* KDiff3PartFactory::s_instance = 0L; -KAboutData* KDiff3PartFactory::s_about = 0L; - -KDiff3PartFactory::KDiff3PartFactory() - : KParts::Factory() -{ -} - -KDiff3PartFactory::~KDiff3PartFactory() -{ - delete s_instance; - delete s_about; - - s_instance = 0L; -} - -KParts::Part* KDiff3PartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList&/*args*/ ) -{ - // Create an instance of our Part - KDiff3Part* obj = new KDiff3Part( parentWidget, widgetName, parent, name ); - - // See if we are to be read-write or not - if (Q3CString(classname) == "KParts::ReadOnlyPart") - obj->setReadWrite(false); - - return obj; -} - -KInstance* KDiff3PartFactory::instance() -{ - if( !s_instance ) - { - s_about = new KAboutData("kdiff3part", I18N_NOOP("KDiff3Part"), VERSION); - s_about->addAuthor("Joachim Eibl", 0, "joachim.eibl at gmx.de"); - s_instance = new KInstance(s_about); - } - return s_instance; -} - -extern "C" -{ - void* init_libkdiff3part() - { - return new KDiff3PartFactory; - } -} - -// Suppress warning with --enable-final -#undef VERSION - -//#include "kdiff3_part.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3_part.h --- a/kdiff3/src/kdiff3_part.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2003-2006 Joachim Eibl * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef _KDIFF3PART_H_ -#define _KDIFF3PART_H_ - -#include -#include - -class QWidget; -class QPainter; -class KURL; -class KDiff3App; - -/** - * This is a "Part". It that does all the real work in a KPart - * application. - * - * @short Main Part - * @author Joachim Eibl - */ -class KDiff3Part : public KParts::ReadOnlyPart -{ - Q_OBJECT -public: - /** - * Default constructor - */ - KDiff3Part(QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name); - - /** - * Destructor - */ - virtual ~KDiff3Part(); - - /** - * This is a virtual function inherited from KParts::ReadWritePart. - * A shell will use this to inform this Part if it should act - * read-only - */ - virtual void setReadWrite(bool rw); - - /** - * Reimplemented to disable and enable Save action - */ - virtual void setModified(bool modified); - -protected: - /** - * This must be implemented by each part - */ - virtual bool openFile(); - - /** - * This must be implemented by each read-write part - */ - virtual bool saveFile(); - -private: - KDiff3App* m_widget; - bool m_bIsShell; -}; - -class KInstance; -class KAboutData; - -class KDiff3PartFactory : public KParts::Factory -{ - Q_OBJECT -public: - KDiff3PartFactory(); - virtual ~KDiff3PartFactory(); - virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args ); - static KInstance* instance(); - -private: - static KInstance* s_instance; - static KAboutData* s_about; -}; - -#endif // _KDIFF3PART_H_ diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3_part.rc --- a/kdiff3/src/kdiff3_part.rc Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - &KDiff3 - - - - - - - - - Configure KDiff3 - - -KDiff3 - - - - - - - - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3_shell.cpp --- a/kdiff3/src/kdiff3_shell.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2003-2006 Joachim Eibl * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "kdiff3_shell.h" -#include "kdiff3.h" - -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include - -#include -//Added by qt3to4: -#include - -KDiff3Shell::KDiff3Shell(bool bCompleteInit) - : KParts::MainWindow( 0L, "kdiff3" ) -{ - m_bUnderConstruction = true; - // set the shell's ui resource file - setXMLFile("kdiff3_shell.rc"); - - // and a status bar - statusBar()->show(); - - // this routine will find and load our Part. it finds the Part by - // name which is a bad idea usually.. but it's alright in this - // case since our Part is made for this Shell - KLibFactory *factory = KLibLoader::self()->factory("libkdiff3part"); - if (factory) - { - // now that the Part is loaded, we cast it to a Part to get - // our hands on it - m_part = static_cast(factory->create(this, - "kdiff3_part", "KParts::ReadWritePart" )); - - if (m_part) - { - // and integrate the part's GUI with the shell's - createGUI(m_part); - - // tell the KParts::MainWindow that this is indeed the main widget - setCentralWidget(m_part->widget()); - - if (bCompleteInit) - ((KDiff3App*)m_part->widget())->completeInit(); - connect(((KDiff3App*)m_part->widget()), SIGNAL(createNewInstance(const QString&, const QString&, const QString&)), this, SLOT(slotNewInstance(const QString&, const QString&, const QString&))); - } - } - else - { - // if we couldn't find our Part, we exit since the Shell by - // itself can't do anything useful - KMessageBox::error(this, i18n("Could not find our part!\n" - "This usually happens due to an installation problem. " - "Please read the README-file in the source package for details.") - ); - //kapp->quit(); - - ::exit(-1); //kapp->quit() doesn't work here yet. - - // we return here, cause kapp->quit() only means "exit the - // next time we enter the event loop... - - return; - } - - // apply the saved mainwindow settings, if any, and ask the mainwindow - // to automatically save settings if changed: window size, toolbar - // position, icon size, etc. - setAutoSaveSettings(); - m_bUnderConstruction = false; -} - -KDiff3Shell::~KDiff3Shell() -{ -} - -bool KDiff3Shell::queryClose() -{ - if (m_part) - return ((KDiff3App*)m_part->widget())->queryClose(); - else - return true; -} - -bool KDiff3Shell::queryExit() -{ - return true; -} - -void KDiff3Shell::closeEvent(QCloseEvent*e) -{ - if ( queryClose() ) - { - e->accept(); - bool bFileSaved = ((KDiff3App*)m_part->widget())->isFileSaved(); - KApplication::exit( bFileSaved ? 0 : 1 ); - } - else - e->ignore(); -} - -void KDiff3Shell::optionsShowToolbar() -{ - // this is all very cut and paste code for showing/hiding the - // toolbar - if (m_toolbarAction->isChecked()) - toolBar()->show(); - else - toolBar()->hide(); -} - -void KDiff3Shell::optionsShowStatusbar() -{ - // this is all very cut and paste code for showing/hiding the - // statusbar - if (m_statusbarAction->isChecked()) - statusBar()->show(); - else - statusBar()->hide(); -} - -void KDiff3Shell::optionsConfigureKeys() -{ - KKeyDialog::configure(actionCollection(), "kdiff3_shell.rc"); -} - -void KDiff3Shell::optionsConfigureToolbars() -{ -#if defined(KDE_MAKE_VERSION) -# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0) - saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); -# else - saveMainWindowSettings(KGlobal::config() ); -# endif -#else - saveMainWindowSettings(KGlobal::config() ); -#endif - - // use the standard toolbar editor - KEditToolbar dlg(factory()); - connect(&dlg, SIGNAL(newToolbarConfig()), - this, SLOT(applyNewToolbarConfig())); - dlg.exec(); -} - -void KDiff3Shell::applyNewToolbarConfig() -{ -#if defined(KDE_MAKE_VERSION) -# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0) - applyMainWindowSettings(KGlobal::config(), autoSaveGroup()); -# else - applyMainWindowSettings(KGlobal::config()); -# endif -#else - applyMainWindowSettings(KGlobal::config()); -#endif -} - -void KDiff3Shell::slotNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ) -{ - KDiff3Shell* pKDiff3Shell = new KDiff3Shell(false); - ((KDiff3App*)pKDiff3Shell->m_part->widget())->completeInit(fn1,fn2,fn3); -} - -//#include "kdiff3_shell.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3_shell.h --- a/kdiff3/src/kdiff3_shell.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2003-2006 Joachim Eibl * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef _KDIFF3SHELL_H_ -#define _KDIFF3SHELL_H_ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -//Added by qt3to4: -#include - -class KToggleAction; - -/** - * This is the application "Shell". It has a menubar, toolbar, and - * statusbar but relies on the "Part" to do all the real work. - * - * @short Application Shell - * @author Joachim Eibl - */ -class KDiff3Shell : public KParts::MainWindow -{ - Q_OBJECT -public: - /** - * Default Constructor - */ - KDiff3Shell(bool bCompleteInit=true); - - /** - * Default Destructor - */ - virtual ~KDiff3Shell(); - - bool queryClose(); - bool queryExit(); - virtual void closeEvent(QCloseEvent*e); - -private slots: - void optionsShowToolbar(); - void optionsShowStatusbar(); - void optionsConfigureKeys(); - void optionsConfigureToolbars(); - - void applyNewToolbarConfig(); - void slotNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 ); - -private: - KParts::ReadWritePart *m_part; - - KToggleAction *m_toolbarAction; - KToggleAction *m_statusbarAction; - bool m_bUnderConstruction; -}; - -#endif // _KDIFF3_H_ diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3_shell.rc --- a/kdiff3/src/kdiff3_shell.rc Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ - - - - &File - - - &Directory - - - - - - - - - - - - - - - - - - - - - - Current Item Merge Operation - - - - - - - - Current Item Sync Operation - - - - - - - - - - - - &Movement - - - - - - - - - - - D&iffview - - - - - - - - - - - - &Merge - - - - - - - - - - - - - - - - - - - - - - &Window - - - - - - - - - - -Main Toolbar - - - - - - - - - - - - - - - - - - - - - - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3part.desktop --- a/kdiff3/src/kdiff3part.desktop Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=KDiff3Part -Name[cs]=Komponenta KDiff3 -Name[fr]=Composant KDiff3 -Name[hi]=के-डिफ3पारà¥à¤Ÿ -Name[nb]=KDiff3-del -Name[pt_BR]=Componente KDiff3 -Name[sv]=Kdiff3-del -Name[ta]=கேடிஃபà¯3 பகà¯à®¤à®¿ -Name[tg]=ҚиÑмиKDiff3 -Name[xx]=xxKDiff3Partxx -Name[zh_CN]=KDiff3 组件 -MimeType=text/x-diff -ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart -X-KDE-Library=libkdiff3part -Type=Service diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kdiff3win.rc --- a/kdiff3/src/kdiff3win.rc Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "kdiff3.ico" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/README --- a/kdiff3/src/kreplacements/README Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -About the "kreplacements"-directory: -==================================== - -I want to be able to compile and use KDiff3 without KDE too. -Since KDiff3 is a KDE program, which uses many KDE-classes and -functions there must be some replacement. - -In many cases this is just the corresponding Qt-class, but often -I wrote something myself. For several very KDE-specific functions -there is no real replacement, but only stub functions that allow -the program to compile and link. - -This stuff is not intended to be used for anything else but KDiff3. -Think of it rather as a big hack, that only has the advantage -that I need not mess up the normal program with many ugly -#ifdef/#endif-clauses. - -Most include files in this directory only include kreplacements.h -where the actual declarations are. The implementions are in -kreplacements.cpp. - -The *.moc-files are dummies. The new KDE-philosophy seems to be -that *.moc-files are directly included into the sources. -The Qt-philosophy still is to generate moc*.cpp files which will -be compiled seperately. With these dummy-moc-files both versions -can be compiled. - - -Joachim -(2003-10-02) diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/ShellContextMenu.cpp --- a/kdiff3/src/kreplacements/ShellContextMenu.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,474 +0,0 @@ -// ShellContextMenu.cpp: Implementierung der Klasse CShellContextMenu. -// -////////////////////////////////////////////////////////////////////// -#ifdef _WIN32 -#include -#include -#include -#include -#include -#include -#include -#include -#include "ShellContextMenu.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -////////////////////////////////////////////////////////////////////// -// Konstruktion/Destruktion -////////////////////////////////////////////////////////////////////// - -#define MIN_ID 100 -#define MAX_ID 10000 - - -void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QMenu* pMenu ) -{ - CShellContextMenu scm; - scm.SetObjects(QDir::convertSeparators(itemPath)); - int id = scm.ShowContextMenu (pParentWidget, pt, pMenu); - if (id>=1) - pMenu->activateItemAt(id-1); -} - -IContextMenu2 * g_IContext2 = NULL; -IContextMenu3 * g_IContext3 = NULL; - -CShellContextMenu::CShellContextMenu() -{ - m_psfFolder = NULL; - m_pidlArray = NULL; - m_hMenu = NULL; -} - -CShellContextMenu::~CShellContextMenu() -{ - // free all allocated datas - if (m_psfFolder && bDelete) - m_psfFolder->Release (); - m_psfFolder = NULL; - FreePIDLArray (m_pidlArray); - m_pidlArray = NULL; - - if (m_hMenu) - DestroyMenu( m_hMenu ); -} - - - -// this functions determines which version of IContextMenu is avaibale for those objects (always the highest one) -// and returns that interface -BOOL CShellContextMenu::GetContextMenu (void ** ppContextMenu, int & iMenuType) -{ - *ppContextMenu = NULL; - LPCONTEXTMENU icm1 = NULL; - - // first we retrieve the normal IContextMenu interface (every object should have it) - m_psfFolder->GetUIObjectOf (NULL, nItems, (LPCITEMIDLIST *) m_pidlArray, IID_IContextMenu, NULL, (void**) &icm1); - - if (icm1) - { // since we got an IContextMenu interface we can now obtain the higher version interfaces via that - if (icm1->QueryInterface (IID_IContextMenu3, ppContextMenu) == NOERROR) - iMenuType = 3; - else if (icm1->QueryInterface (IID_IContextMenu2, ppContextMenu) == NOERROR) - iMenuType = 2; - - if (*ppContextMenu) - icm1->Release(); // we can now release version 1 interface, cause we got a higher one - else - { - iMenuType = 1; - *ppContextMenu = icm1; // since no higher versions were found - } // redirect ppContextMenu to version 1 interface - } - else - return (FALSE); // something went wrong - - return (TRUE); // success -} - - -LRESULT CALLBACK CShellContextMenu::HookWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_MENUCHAR: // only supported by IContextMenu3 - if (g_IContext3) - { - LRESULT lResult = 0; - g_IContext3->HandleMenuMsg2 (message, wParam, lParam, &lResult); - return (lResult); - } - break; - - case WM_DRAWITEM: - case WM_MEASUREITEM: - if (wParam) - break; // if wParam != 0 then the message is not menu-related - - case WM_INITMENUPOPUP: - if (g_IContext2) - g_IContext2->HandleMenuMsg (message, wParam, lParam); - else // version 3 - g_IContext3->HandleMenuMsg (message, wParam, lParam); - return (message == WM_INITMENUPOPUP ? 0 : TRUE); // inform caller that we handled WM_INITPOPUPMENU by ourself - break; - - default: - break; - } - - // call original WndProc of window to prevent undefined bevhaviour of window - return ::CallWindowProc ((WNDPROC) GetProp ( hWnd, TEXT ("OldWndProc")), hWnd, message, wParam, lParam); -} - - -UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QMenu* pMenu ) -{ - HWND hWnd = pParentWidget->winId(); - int iMenuType = 0; // to know which version of IContextMenu is supported - LPCONTEXTMENU pContextMenu; // common pointer to IContextMenu and higher version interface - - if (!GetContextMenu ((void**) &pContextMenu, iMenuType)) - return (0); // something went wrong - - if (!m_hMenu) - { - DestroyMenu( m_hMenu ); - m_hMenu = CreatePopupMenu (); - } - - UINT_PTR i; - for( i=0; icount(); ++i ) - { - QString s = pMenu->text(pMenu->idAt(i)); - if (!s.isEmpty()) - AppendMenuW( m_hMenu, MF_STRING, i+1, (LPCWSTR)s.ucs2() ); - } - AppendMenuW( m_hMenu, MF_SEPARATOR, i+1, L"" ); - - // lets fill the our popupmenu - pContextMenu->QueryContextMenu (m_hMenu, GetMenuItemCount (m_hMenu), MIN_ID, MAX_ID, CMF_NORMAL | CMF_EXPLORE); - - // subclass window to handle menurelated messages in CShellContextMenu - WNDPROC OldWndProc; - if (iMenuType > 1) // only subclass if its version 2 or 3 - { - OldWndProc = (WNDPROC) SetWindowLong (hWnd, GWL_WNDPROC, (DWORD) HookWndProc); - if (iMenuType == 2) - g_IContext2 = (LPCONTEXTMENU2) pContextMenu; - else // version 3 - g_IContext3 = (LPCONTEXTMENU3) pContextMenu; - } - else - OldWndProc = NULL; - - UINT idCommand = TrackPopupMenu (m_hMenu,TPM_RETURNCMD | TPM_LEFTALIGN, pt.x(), pt.y(), 0, pParentWidget->winId(), 0); - - if (OldWndProc) // unsubclass - SetWindowLong (hWnd, GWL_WNDPROC, (DWORD) OldWndProc); - - if (idCommand >= MIN_ID && idCommand <= MAX_ID) // see if returned idCommand belongs to shell menu entries - { - InvokeCommand (pContextMenu, idCommand - MIN_ID); // execute related command - idCommand = 0; - } - - pContextMenu->Release(); - g_IContext2 = NULL; - g_IContext3 = NULL; - - return (idCommand); -} - - -void CShellContextMenu::InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand) -{ - CMINVOKECOMMANDINFO cmi = {0}; - cmi.cbSize = sizeof (CMINVOKECOMMANDINFO); - cmi.lpVerb = (LPSTR) MAKEINTRESOURCE (idCommand); - cmi.nShow = SW_SHOWNORMAL; - - pContextMenu->InvokeCommand (&cmi); -} - - -void CShellContextMenu::SetObjects(const QString& strObject) -{ - // only one object is passed - QStringList strArray; - strArray << strObject; // create a CStringArray with one element - - SetObjects (strArray); // and pass it to SetObjects (CStringArray &strArray) - // for further processing -} - - -void CShellContextMenu::SetObjects(const QStringList &strList) -{ - // free all allocated datas - if (m_psfFolder && bDelete) - m_psfFolder->Release (); - m_psfFolder = NULL; - FreePIDLArray (m_pidlArray); - m_pidlArray = NULL; - - // get IShellFolder interface of Desktop (root of shell namespace) - IShellFolder * psfDesktop = NULL; - SHGetDesktopFolder (&psfDesktop); // needed to obtain full qualified pidl - - // ParseDisplayName creates a PIDL from a file system path relative to the IShellFolder interface - // but since we use the Desktop as our interface and the Desktop is the namespace root - // that means that it's a fully qualified PIDL, which is what we need - LPITEMIDLIST pidl = NULL; - - psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[0].ucs2(), NULL, &pidl, NULL); - - // now we need the parent IShellFolder interface of pidl, and the relative PIDL to that interface - LPITEMIDLIST pidlItem = NULL; // relative pidl - SHBindToParentEx (pidl, IID_IShellFolder, (void **) &m_psfFolder, NULL); - free (pidlItem); - // get interface to IMalloc (need to free the PIDLs allocated by the shell functions) - LPMALLOC lpMalloc = NULL; - SHGetMalloc (&lpMalloc); - lpMalloc->Free (pidl); - - // now we have the IShellFolder interface to the parent folder specified in the first element in strArray - // since we assume that all objects are in the same folder (as it's stated in the MSDN) - // we now have the IShellFolder interface to every objects parent folder - - IShellFolder * psfFolder = NULL; - nItems = strList.size (); - for (int i = 0; i < nItems; i++) - { - pidl=0; - psfDesktop->ParseDisplayName (NULL, 0, (LPOLESTR)strList[i].ucs2(), NULL, &pidl, NULL); - if (pidl) - { - m_pidlArray = (LPITEMIDLIST *) realloc (m_pidlArray, (i + 1) * sizeof (LPITEMIDLIST)); - // get relative pidl via SHBindToParent - SHBindToParentEx (pidl, IID_IShellFolder, (void **) &psfFolder, (LPCITEMIDLIST *) &pidlItem); - m_pidlArray[i] = CopyPIDL (pidlItem); // copy relative pidl to pidlArray - free (pidlItem); - lpMalloc->Free (pidl); // free pidl allocated by ParseDisplayName - psfFolder->Release (); - } - } - lpMalloc->Release (); - psfDesktop->Release (); - - bDelete = TRUE; // indicates that m_psfFolder should be deleted by CShellContextMenu -} - - -// only one full qualified PIDL has been passed -void CShellContextMenu::SetObjects(LPITEMIDLIST /*pidl*/) -{ -/* - // free all allocated datas - if (m_psfFolder && bDelete) - m_psfFolder->Release (); - m_psfFolder = NULL; - FreePIDLArray (m_pidlArray); - m_pidlArray = NULL; - - // full qualified PIDL is passed so we need - // its parent IShellFolder interface and its relative PIDL to that - LPITEMIDLIST pidlItem = NULL; - SHBindToParent ((LPCITEMIDLIST) pidl, IID_IShellFolder, (void **) &m_psfFolder, (LPCITEMIDLIST *) &pidlItem); - - m_pidlArray = (LPITEMIDLIST *) malloc (sizeof (LPITEMIDLIST)); // allocate ony for one elemnt - m_pidlArray[0] = CopyPIDL (pidlItem); - - - // now free pidlItem via IMalloc interface (but not m_psfFolder, that we need later - LPMALLOC lpMalloc = NULL; - SHGetMalloc (&lpMalloc); - lpMalloc->Free (pidlItem); - lpMalloc->Release(); - - nItems = 1; - bDelete = TRUE; // indicates that m_psfFolder should be deleted by CShellContextMenu -*/ -} - - -// IShellFolder interface with a relative pidl has been passed -void CShellContextMenu::SetObjects(IShellFolder *psfFolder, LPITEMIDLIST pidlItem) -{ - // free all allocated datas - if (m_psfFolder && bDelete) - m_psfFolder->Release (); - m_psfFolder = NULL; - FreePIDLArray (m_pidlArray); - m_pidlArray = NULL; - - m_psfFolder = psfFolder; - - m_pidlArray = (LPITEMIDLIST *) malloc (sizeof (LPITEMIDLIST)); - m_pidlArray[0] = CopyPIDL (pidlItem); - - nItems = 1; - bDelete = FALSE; // indicates wheter m_psfFolder should be deleted by CShellContextMenu -} - -void CShellContextMenu::SetObjects(IShellFolder * psfFolder, LPITEMIDLIST *pidlArray, int nItemCount) -{ - // free all allocated datas - if (m_psfFolder && bDelete) - m_psfFolder->Release (); - m_psfFolder = NULL; - FreePIDLArray (m_pidlArray); - m_pidlArray = NULL; - - m_psfFolder = psfFolder; - - m_pidlArray = (LPITEMIDLIST *) malloc (nItemCount * sizeof (LPITEMIDLIST)); - - for (int i = 0; i < nItemCount; i++) - m_pidlArray[i] = CopyPIDL (pidlArray[i]); - - nItems = nItemCount; - bDelete = FALSE; // indicates wheter m_psfFolder should be deleted by CShellContextMenu -} - - -void CShellContextMenu::FreePIDLArray(LPITEMIDLIST *pidlArray) -{ - if (!pidlArray) - return; - - int iSize = _msize (pidlArray) / sizeof (LPITEMIDLIST); - - for (int i = 0; i < iSize; i++) - free (pidlArray[i]); - free (pidlArray); -} - - -LPITEMIDLIST CShellContextMenu::CopyPIDL (LPCITEMIDLIST pidl, int cb) -{ - if (cb == -1) - cb = GetPIDLSize (pidl); // Calculate size of list. - - LPITEMIDLIST pidlRet = (LPITEMIDLIST) calloc (cb + sizeof (USHORT), sizeof (BYTE)); - if (pidlRet) - CopyMemory(pidlRet, pidl, cb); - - return (pidlRet); -} - - -UINT CShellContextMenu::GetPIDLSize (LPCITEMIDLIST pidl) -{ - if (!pidl) - return 0; - int nSize = 0; - LPITEMIDLIST pidlTemp = (LPITEMIDLIST) pidl; - while (pidlTemp->mkid.cb) - { - nSize += pidlTemp->mkid.cb; - pidlTemp = (LPITEMIDLIST) (((LPBYTE) pidlTemp) + pidlTemp->mkid.cb); - } - return nSize; -} - -HMENU CShellContextMenu::GetMenu() -{ - if (!m_hMenu) - { - m_hMenu = CreatePopupMenu(); // create the popupmenu (its empty) - } - return (m_hMenu); -} - - -// this is workaround function for the Shell API Function SHBindToParent -// SHBindToParent is not available under Win95/98 -HRESULT CShellContextMenu::SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast) -{ - HRESULT hr = 0; - if (!pidl || !ppv) - return E_POINTER; - - int nCount = GetPIDLCount (pidl); - if (nCount == 0) // desktop pidl of invalid pidl - return E_POINTER; - - IShellFolder * psfDesktop = NULL; - SHGetDesktopFolder (&psfDesktop); - if (nCount == 1) // desktop pidl - { - if ((hr = psfDesktop->QueryInterface(riid, ppv)) == S_OK) - { - if (ppidlLast) - *ppidlLast = CopyPIDL (pidl); - } - psfDesktop->Release (); - return hr; - } - - LPBYTE pRel = GetPIDLPos (pidl, nCount - 1); - LPITEMIDLIST pidlParent = NULL; - pidlParent = CopyPIDL (pidl, pRel - (LPBYTE) pidl); - IShellFolder * psfFolder = NULL; - - if ((hr = psfDesktop->BindToObject (pidlParent, NULL, IID_IShellFolder, (void **) &psfFolder)) != S_OK) - { - free (pidlParent); - psfDesktop->Release (); - return hr; - } - if ((hr = psfFolder->QueryInterface (riid, ppv)) == S_OK) - { - if (ppidlLast) - *ppidlLast = CopyPIDL ((LPCITEMIDLIST) pRel); - } - free (pidlParent); - psfFolder->Release (); - psfDesktop->Release (); - return hr; -} - - -LPBYTE CShellContextMenu::GetPIDLPos (LPCITEMIDLIST pidl, int nPos) -{ - if (!pidl) - return 0; - int nCount = 0; - - BYTE * pCur = (BYTE *) pidl; - while (((LPCITEMIDLIST) pCur)->mkid.cb) - { - if (nCount == nPos) - return pCur; - nCount++; - pCur += ((LPCITEMIDLIST) pCur)->mkid.cb; // + sizeof(pidl->mkid.cb); - } - if (nCount == nPos) - return pCur; - return NULL; -} - - -int CShellContextMenu::GetPIDLCount (LPCITEMIDLIST pidl) -{ - if (!pidl) - return 0; - - int nCount = 0; - BYTE* pCur = (BYTE *) pidl; - while (((LPCITEMIDLIST) pCur)->mkid.cb) - { - nCount++; - pCur += ((LPCITEMIDLIST) pCur)->mkid.cb; - } - return nCount; -} - -#endif - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/ShellContextMenu.h --- a/kdiff3/src/kreplacements/ShellContextMenu.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -// ShellContextMenu.h: Schnittstelle für die Klasse CShellContextMenu. -// -////////////////////////////////////////////////////////////////////// - -#ifndef SHELLCONTEXTMENU_H -#define SHELLCONTEXTMENU_H - -///////////////////////////////////////////////////////////////////// -// class to show shell contextmenu of files/folders/shell objects -// developed by R. Engels 2003 -///////////////////////////////////////////////////////////////////// - -class CShellContextMenu -{ -public: - HMENU GetMenu (); - void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST pidlItem); - void SetObjects (IShellFolder * psfFolder, LPITEMIDLIST * pidlArray, int nItemCount); - void SetObjects (LPITEMIDLIST pidl); - void SetObjects (const QString& strObject); - void SetObjects (const QStringList& strList); - UINT ShowContextMenu (QWidget* pParent, QPoint pt, QMenu* pMenu); - CShellContextMenu(); - virtual ~CShellContextMenu(); - -private: - int nItems; - BOOL bDelete; - HMENU m_hMenu; - IShellFolder * m_psfFolder; - LPITEMIDLIST * m_pidlArray; - - void InvokeCommand (LPCONTEXTMENU pContextMenu, UINT idCommand); - BOOL GetContextMenu (void ** ppContextMenu, int & iMenuType); - HRESULT SHBindToParentEx (LPCITEMIDLIST pidl, REFIID riid, VOID **ppv, LPCITEMIDLIST *ppidlLast); - static LRESULT CALLBACK HookWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - void FreePIDLArray (LPITEMIDLIST * pidlArray); - LPITEMIDLIST CopyPIDL (LPCITEMIDLIST pidl, int cb = -1); - UINT GetPIDLSize (LPCITEMIDLIST pidl); - LPBYTE GetPIDLPos (LPCITEMIDLIST pidl, int nPos); - int GetPIDLCount (LPCITEMIDLIST pidl); -}; - -#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kaboutdata.h --- a/kdiff3/src/kreplacements/kaboutdata.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kaccel.h --- a/kdiff3/src/kreplacements/kaccel.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kaction.h --- a/kdiff3/src/kreplacements/kaction.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kapplication.h --- a/kdiff3/src/kreplacements/kapplication.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kcmdlineargs.h --- a/kdiff3/src/kreplacements/kcmdlineargs.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kcolorbtn.h --- a/kdiff3/src/kreplacements/kcolorbtn.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kconfig.h --- a/kdiff3/src/kreplacements/kconfig.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kdialogbase.h --- a/kdiff3/src/kreplacements/kdialogbase.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kedittoolbar.h --- a/kdiff3/src/kreplacements/kedittoolbar.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kfiledialog.h --- a/kdiff3/src/kreplacements/kfiledialog.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kfontdialog.h --- a/kdiff3/src/kreplacements/kfontdialog.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kiconloader.h --- a/kdiff3/src/kreplacements/kiconloader.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kinstance.h --- a/kdiff3/src/kreplacements/kinstance.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kio/global.h --- a/kdiff3/src/kreplacements/kio/global.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kio/job.h --- a/kdiff3/src/kreplacements/kio/job.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kio/jobclasses.h --- a/kdiff3/src/kreplacements/kio/jobclasses.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kkeydialog.h --- a/kdiff3/src/kreplacements/kkeydialog.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/klibloader.h --- a/kdiff3/src/kreplacements/klibloader.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/klocale.h --- a/kdiff3/src/kreplacements/klocale.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kmainwindow.h --- a/kdiff3/src/kreplacements/kmainwindow.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kmenubar.h --- a/kdiff3/src/kreplacements/kmenubar.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kmessagebox.h --- a/kdiff3/src/kreplacements/kmessagebox.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/konq_popupmenu.h --- a/kdiff3/src/kreplacements/konq_popupmenu.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kparts/factory.h --- a/kdiff3/src/kreplacements/kparts/factory.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kparts/mainwindow.h --- a/kdiff3/src/kreplacements/kparts/mainwindow.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kparts/part.h --- a/kdiff3/src/kreplacements/kparts/part.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kpopupmenu.h --- a/kdiff3/src/kreplacements/kpopupmenu.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kprinter.h --- a/kdiff3/src/kreplacements/kprinter.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kprogress.h --- a/kdiff3/src/kreplacements/kprogress.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kreplacements.cpp --- a/kdiff3/src/kreplacements/kreplacements.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1204 +0,0 @@ -/*************************************************************************** - kreplacements.cpp - description - ------------------- - begin : Sat Aug 3 2002 - copyright : (C) 2002-2006 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - - -#include "kreplacements.h" -#include "common.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -static QString s_copyright; -static QString s_email; -static QString s_description; -static QString s_appName; -static QString s_version; -static QString s_homepage; -static KAboutData* s_pAboutData; - - -#ifdef _WIN32 -#include -#include -#endif - -static void showHelp() -{ - #ifdef _WIN32 - char buf[200]; - int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); - - QString exePath; - if (r!=0) { exePath = buf; } - else { exePath = "."; } - - QFileInfo helpFile( exePath + "\\doc\\en\\index.html" ); - if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\en\\index.html" ); } - if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\doc\\index.html" ); } - if ( ! helpFile.exists() ) { helpFile.setFile( exePath + "\\..\\doc\\index.html" ); } - if ( ! helpFile.exists() ) - { - QMessageBox::warning( 0, "KDiff3 documentation not found", - "Couldn't find the documentation. \n\n" - "The documentation can also be found at the homepage:\n\n " - " http://kdiff3.sourceforge.net/"); - return; - } - - HINSTANCE hi = FindExecutableA( helpFile.fileName().ascii(), helpFile.dirPath(true).ascii(), buf ); - if ( int(hi)<=32 ) - { - static Q3TextBrowser* pBrowser = 0; - if (pBrowser==0) - { - pBrowser = new Q3TextBrowser( 0 ); - pBrowser->setMinimumSize( 600, 400 ); - } - pBrowser->setSource(helpFile.filePath()); - pBrowser->show(); - } - else - { - QFileInfo prog( buf ); - _spawnlp( _P_NOWAIT , prog.filePath().ascii(), prog.fileName().ascii(), ("file:///"+helpFile.absFilePath()).ascii(), NULL ); - } - - #else - static Q3TextBrowser* pBrowser = 0; - if (pBrowser==0) - { - pBrowser = new Q3TextBrowser( 0 ); - pBrowser->setMinimumSize( 600, 400 ); - } - pBrowser->setSource("/usr/local/share/doc/kdiff3/en/index.html"); - pBrowser->show(); - #endif -} - -QString getTranslationDir() -{ - #ifdef _WIN32 - char buf[200]; - int r= SearchPathA( 0, ".", 0, sizeof(buf), buf, 0 ); - - QString exePath; - if (r!=0) { exePath = buf; } - else { exePath = "."; } - return exePath+"/translations"; - #else - return "."; - #endif -} - -// static -void KMessageBox::error( QWidget* parent, const QString& text, const QString& caption ) -{ - QMessageBox::critical( parent, caption, text ); -} - -int KMessageBox::warningContinueCancel( QWidget* parent, const QString& text, const QString& caption, - const QString& button1 ) -{ - return 0 == QMessageBox::warning( parent, caption, text, button1, "Cancel" ) ? Continue : Cancel; -} - -void KMessageBox::sorry( QWidget* parent, const QString& text, const QString& caption ) -{ - QMessageBox::information( parent, caption, text ); -} - -void KMessageBox::information( QWidget* parent, const QString& text, const QString& caption ) -{ - QMessageBox::information( parent, caption, text ); -} - -int KMessageBox::warningYesNo( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ) -{ - return 0 == QMessageBox::warning( parent, caption, text, button1, button2, QString::null, 1, 1 ) ? Yes : No; -} - -int KMessageBox::warningYesNoCancel( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ) -{ - int val = QMessageBox::warning( parent, caption, text, - button1, button2, i18n("Cancel") ); - if ( val==0 ) return Yes; - if ( val==1 ) return No; - else return Cancel; -} - - -KDialogBase::KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, - bool /*modal*/, bool ) -: Q3TabDialog( parent, name, true /* modal */ ) -{ - setCaption( caption ); - setDefaultButton(); - setHelpButton(); - setCancelButton(); - //setApplyButton(); - setOkButton(); - setDefaultButton(); - - connect( this, SIGNAL( defaultButtonPressed() ), this, SLOT(slotDefault()) ); - connect( this, SIGNAL( helpButtonPressed() ), this, SLOT(slotHelp())); - connect( this, SIGNAL( applyButtonPressed() ), this, SLOT( slotApply() )); -} - -KDialogBase::~KDialogBase() -{ -} - -void KDialogBase::incInitialSize ( const QSize& ) -{ -} - -void KDialogBase::setHelp(const QString&, const QString& ) -{ -} - - -int KDialogBase::BarIcon(const QString& /*iconName*/, int ) -{ - return 0; // Not used for replacement. -} - - -Q3VBox* KDialogBase::addVBoxPage( const QString& name, const QString& /*info*/, int ) -{ - Q3VBox* p = new Q3VBox(this, name.ascii()); - addTab( p, name ); - return p; -} - -QFrame* KDialogBase::addPage( const QString& name, const QString& /*info*/, int ) -{ - QFrame* p = new QFrame(); - p->setObjectName( name ); - addTab( p, name ); - return p; -} - -int KDialogBase::spacingHint() -{ - return 5; -} - -static bool s_inAccept = false; -static bool s_bAccepted = false; -void KDialogBase::accept() -{ - if( ! s_inAccept ) - { - s_bAccepted = false; - s_inAccept = true; - slotOk(); - s_inAccept = false; - if ( s_bAccepted ) - Q3TabDialog::accept(); - } - else - { - s_bAccepted = true; - } -} - -void KDialogBase::slotDefault( ) -{ -} -void KDialogBase::slotOk() -{ -} -void KDialogBase::slotCancel( ) -{ -} -void KDialogBase::slotApply( ) -{ - emit applyClicked(); -} -void KDialogBase::slotHelp( ) -{ - showHelp(); -} - -KURL KFileDialog::getSaveURL( const QString &startDir, - const QString &filter, - QWidget *parent, const QString &caption) -{ - QString s = Q3FileDialog::getSaveFileName(startDir, filter, parent, 0, caption); - return KURL(s); -} - -KURL KFileDialog::getOpenURL( const QString & startDir, - const QString & filter, - QWidget * parent, - const QString & caption ) -{ - QString s = Q3FileDialog::getOpenFileName(startDir, filter, parent, 0, caption); - return KURL(s); -} - -KURL KFileDialog::getExistingURL( const QString & startDir, - QWidget * parent, - const QString & caption) -{ - QString s = Q3FileDialog::getExistingDirectory(startDir, parent, 0, caption); - return KURL(s); -} - -QString KFileDialog::getSaveFileName (const QString &startDir, - const QString &filter, - QWidget *parent, - const QString &caption) -{ - return Q3FileDialog::getSaveFileName( startDir, filter, parent, 0, caption ); -} - - -KToolBar::BarPosition KToolBar::barPos() -{ - if ( m_pMainWindow->leftDock()->hasDockWindow(this) ) return Left; - if ( m_pMainWindow->rightDock()->hasDockWindow(this) ) return Right; - if ( m_pMainWindow->topDock()->hasDockWindow(this) ) return Top; - if ( m_pMainWindow->bottomDock()->hasDockWindow(this) ) return Bottom; - return Top; -} - -void KToolBar::setBarPos(BarPosition bp) -{ - 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( Q3MainWindow* parent ) -: Q3ToolBar( parent ) -{ - m_pMainWindow = parent; -} - - -KMainWindow::KMainWindow( QWidget* parent, const char* name ) -: Q3MainWindow( parent, name ), m_actionCollection(this) -{ - fileMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&File"), fileMenu); - editMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&Edit"), editMenu); - directoryMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&Directory"), directoryMenu); - dirCurrentItemMenu = 0; - dirCurrentSyncItemMenu = 0; - movementMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&Movement"), movementMenu); - diffMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("D&iffview"), diffMenu); - mergeMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&Merge"), mergeMenu); - windowsMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&Window"), windowsMenu); - settingsMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&Settings"), settingsMenu); - helpMenu = new Q3PopupMenu(); - menuBar()->insertItem(i18n("&Help"), helpMenu); - - m_pToolBar = new KToolBar(this); - - memberList = new QList; - memberList->append(this); -} - -KToolBar* KMainWindow::toolBar(const QString&) -{ - return m_pToolBar; -} - -KActionCollection* KMainWindow::actionCollection() -{ - return &m_actionCollection; -} - -void KMainWindow::createGUI() -{ - KStdAction::help(this, SLOT(slotHelp()), actionCollection()); - KStdAction::about(this, SLOT(slotAbout()), actionCollection()); - KStdAction::aboutQt(actionCollection()); -} - -void KMainWindow::slotAbout() -{ - QDialog d; - QVBoxLayout* l = new QVBoxLayout( &d ); - QTabWidget* pTabWidget = new QTabWidget; - l->addWidget( pTabWidget ); - - QPushButton* pOkButton = new QPushButton(i18n("Ok")); - connect( pOkButton, SIGNAL(clicked()), &d, SLOT(accept())); - l->addWidget( pOkButton ); - - d.setCaption("About " + s_appName); - Q3TextBrowser* tb1 = new Q3TextBrowser(); - tb1->setWordWrap( Q3TextEdit::NoWrap ); - tb1->setText( - s_appName + " Version " + s_version + - "\n\n" + s_description + - "\n\n" + s_copyright + - "\n\nHomepage: " + s_homepage + - "\n\nLicence: GNU GPL Version 2" - ); - pTabWidget->addTab(tb1,i18n("&About")); - - std::list::iterator i; - - QString s2; - for( i=s_pAboutData->m_authorList.begin(); i!=s_pAboutData->m_authorList.end(); ++i ) - { - if ( !i->m_name.isEmpty() ) s2 += i->m_name + "\n"; - if ( !i->m_task.isEmpty() ) s2 += " " + i->m_task + "\n"; - if ( !i->m_email.isEmpty() ) s2 += " " + i->m_email + "\n"; - if ( !i->m_weblink.isEmpty() ) s2 += " " + i->m_weblink + "\n"; - s2 += "\n"; - } - Q3TextBrowser* tb2 = new Q3TextBrowser(); - tb2->setWordWrap( Q3TextEdit::NoWrap ); - tb2->setText(s2); - pTabWidget->addTab(tb2,i18n("A&uthor")); - - QString s3; - for( i=s_pAboutData->m_creditList.begin(); i!=s_pAboutData->m_creditList.end(); ++i ) - { - if ( !i->m_name.isEmpty() ) s3 += i->m_name + "\n"; - if ( !i->m_task.isEmpty() ) s3 += " " + i->m_task + "\n"; - if ( !i->m_email.isEmpty() ) s3 += " " + i->m_email + "\n"; - if ( !i->m_weblink.isEmpty() ) s3 += " " + i->m_weblink + "\n"; - s3 += "\n"; - } - Q3TextBrowser* tb3 = new Q3TextBrowser(); - tb3->setWordWrap( Q3TextEdit::NoWrap ); - tb3->setText(s3); - pTabWidget->addTab(tb3,i18n("&Thanks To")); - - d.resize(400,300); - d.exec(); -/* - QMessageBox::information( - this, - "About " + s_appName, - s_appName + " Version " + s_version + - "\n\n" + s_description + - "\n\n" + s_copyright + - "\n\nHomepage: " + s_homepage + - "\n\nLicence: GNU GPL Version 2" - ); -*/ -} - -void KMainWindow::slotHelp() -{ - showHelp(); -} - - -QString KStandardDirs::findResource(const QString& resource, const QString& /*appName*/) -{ - if (resource=="config") - { - QString home = QDir::homeDirPath(); - return home + "/.kdiff3rc"; - } - return QString(); -} - -KConfig::KConfig() -{ -} - -void KConfig::readConfigFile( const QString& configFileName ) -{ - if ( !configFileName.isEmpty() ) - { - m_fileName = configFileName; - } - else - { - m_fileName = KStandardDirs().findResource("config","kdiff3rc"); - } - - QFile f( m_fileName ); - if ( f.open(QIODevice::ReadOnly) ) - { // file opened successfully - QTextStream t( &f ); // use a text stream - load(t); - f.close(); - } -} - -KConfig::~KConfig() -{ - QFile f(m_fileName); - if ( f.open( QIODevice::WriteOnly | QIODevice::Text ) ) - { // file opened successfully - QTextStream t( &f ); // use a text stream - save(t); - f.close(); - } -} - -void KConfig::setGroup(const QString&) -{ -} - -void KAction::init(QObject* receiver, const char* slot, KActionCollection* actionCollection, - const char* name, bool bToggle, bool bMenu) -{ - QString n(name); - KMainWindow* p = actionCollection->m_pMainWindow; - if( slot!=0 ) - { - if (!bToggle) - connect(this, SIGNAL(activated()), receiver, slot); - else - { - connect(this, SIGNAL(toggled(bool)), receiver, slot); - } - } - - if (bMenu) - { - if( n[0]=='g') addTo( p->movementMenu ); - else if( n.left(16)=="dir_current_sync") - { - if ( p->dirCurrentItemMenu==0 ) - { - p->dirCurrentItemMenu = new Q3PopupMenu(); - p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new Q3PopupMenu(); - p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); - } - addTo( p->dirCurrentItemMenu ); - } - else if( n.left(11)=="dir_current") - { - if ( p->dirCurrentItemMenu==0 ) - { - p->dirCurrentItemMenu = new Q3PopupMenu(); - p->directoryMenu->insertItem(i18n("Current Item Merge Operation"), p->dirCurrentItemMenu); - p->dirCurrentSyncItemMenu = new Q3PopupMenu(); - p->directoryMenu->insertItem(i18n("Current Item Sync Operation"), p->dirCurrentSyncItemMenu); - } - addTo( p->dirCurrentSyncItemMenu ); - } - else if( n.left(4)=="diff") addTo( p->diffMenu ); - else if( name[0]=='d') addTo( p->directoryMenu ); - else if( name[0]=='f') addTo( p->fileMenu ); - else if( name[0]=='w') addTo( p->windowsMenu ); - else addTo( p->mergeMenu ); - } -} - - -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 ( icon, text, accel, actionCollection->m_pMainWindow, name ) -{ - setToggleAction( bToggle ); - KMainWindow* p = actionCollection->m_pMainWindow; - if ( !icon.isNull() && p ) this->addTo( p->m_pToolBar ); - - init(receiver,slot,actionCollection,name,bToggle,bMenu); -} - -KAction::KAction(const QString& text, int accel, - QObject* receiver, const char* slot, KActionCollection* actionCollection, - const char* name, bool bToggle, bool bMenu - ) -: QAction ( text, accel, actionCollection->m_pMainWindow, name ) -{ - setToggleAction( bToggle ); - init(receiver,slot,actionCollection,name,bToggle,bMenu); -} - -void KAction::setStatusText(const QString&) -{ -} - -void KAction::plug(Q3PopupMenu* menu) -{ - addTo(menu); -} - - -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) -{ -} - -KToggleAction::KToggleAction(const QString& text, int accel, QObject* receiver, const char* slot, KActionCollection* actionCollection, const char* name, bool bMenu) -: KAction( text, accel, receiver, slot, actionCollection, name, true, 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) -{ -} - -void KToggleAction::setChecked(bool bChecked) -{ - blockSignals( true ); - setOn( bChecked ); - blockSignals( false ); -} - -bool KToggleAction::isChecked() -{ - return isOn(); -} - - - -//static -KAction* KStdAction::open( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - #include "../xpm/fileopen.xpm" - KMainWindow* p = actionCollection->m_pMainWindow; - 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; -} - -KAction* KStdAction::save( QWidget* parent, const char* slot, KActionCollection* actionCollection ) -{ - #include "../xpm/filesave.xpm" - KMainWindow* p = actionCollection->m_pMainWindow; - 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; -} - -KAction* KStdAction::saveAs( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Save As..."), 0, parent, slot, actionCollection, "saveas", false, false); - if(p) a->addTo( p->fileMenu ); - return a; -} - -KAction* KStdAction::print( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - #include "../xpm/fileprint.xpm" - KMainWindow* p = actionCollection->m_pMainWindow; - 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; -} - -KAction* KStdAction::quit( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Quit"), Qt::CTRL+Qt::Key_Q, parent, slot, actionCollection, "quit", false, false); - if(p) a->addTo( p->fileMenu ); - return a; -} - -KAction* KStdAction::cut( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Cut"), Qt::CTRL+Qt::Key_X, parent, slot, actionCollection, "cut", false, false ); - if(p) a->addTo( p->editMenu ); - return a; -} - -KAction* KStdAction::copy( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Copy"), Qt::CTRL+Qt::Key_C, parent, slot, actionCollection, "copy", false, false ); - if(p) a->addTo( p->editMenu ); - return a; -} - -KAction* KStdAction::paste( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Paste"), Qt::CTRL+Qt::Key_V, parent, slot, actionCollection, "paste", false, false ); - if(p) a->addTo( p->editMenu ); - return a; -} - -KAction* KStdAction::selectAll( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Select All"), Qt::CTRL+Qt::Key_A, parent, slot, actionCollection, "selectall", false, false ); - if(p) a->addTo( p->editMenu ); - return a; -} - -KToggleAction* KStdAction::showToolbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KToggleAction* a = new KToggleAction( i18n("Show Toolbar"), 0, parent, slot, actionCollection, "showtoolbar", false ); - if(p) a->addTo( p->settingsMenu ); - return a; -} - -KToggleAction* KStdAction::showStatusbar( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KToggleAction* a = new KToggleAction( i18n("Show &Statusbar"), 0, parent, slot, actionCollection, "showstatusbar", false ); - if(p) a->addTo( p->settingsMenu ); - return a; -} - -KAction* KStdAction::preferences( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("&Configure %1...").arg("KDiff3"), 0, parent, slot, actionCollection, "settings", false, false ); - if(p) a->addTo( p->settingsMenu ); - return a; -} -KAction* KStdAction::keyBindings( QWidget*, const char*, KActionCollection*) -{ - return 0; -} - -KAction* KStdAction::about( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("About")+" KDiff3", 0, parent, slot, actionCollection, "about_kdiff3", false, false ); - if(p) a->addTo( p->helpMenu ); - return a; -} - -KAction* KStdAction::aboutQt( KActionCollection* actionCollection ) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("About")+" Qt", 0, qApp, SLOT(aboutQt()), actionCollection, "about_qt", false, false ); - if(p) a->addTo( p->helpMenu ); - return a; -} - -KAction* KStdAction::help( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Help"), Qt::Key_F1, parent, slot, actionCollection, "help", false, false ); - if(p) a->addTo( p->helpMenu ); - return a; -} -KAction* KStdAction::find( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Find"), Qt::CTRL+Qt::Key_F, parent, slot, actionCollection, "find", false, false ); - if(p) a->addTo( p->editMenu ); - return a; -} - -KAction* KStdAction::findNext( QWidget* parent, const char* slot, KActionCollection* actionCollection) -{ - KMainWindow* p = actionCollection->m_pMainWindow; - KAction* a = new KAction( i18n("Find Next"), Qt::Key_F3, parent, slot, actionCollection, "findNext", false, false ); - if(p) a->addTo( p->editMenu ); - return a; -} - - - - -KFontChooser::KFontChooser( QWidget* pParent, const QString& /*name*/, bool, const QStringList&, bool, int ) -: QWidget(pParent) -{ - m_pParent = pParent; - 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); - - m_pLabel = new QLabel( "", this ); - m_pLabel->setFont( m_font ); - m_pLabel->setMinimumWidth(200); - m_pLabel->setText( "The quick brown fox jumps over the river\n" - "but the little red hen escapes with a shiver.\n" - ":-)"); - pLayout->addWidget(m_pLabel); -} - -QFont KFontChooser::font() -{ - return m_font;//QFont("courier",10); -} - -void KFontChooser::setFont( const QFont& font, bool ) -{ - m_font = font; - m_pLabel->setFont( m_font ); - //update(); -} - -void KFontChooser::slotSelectFont() -{ - for(;;) - { - bool bOk; - m_font = QFontDialog::getFont(&bOk, m_font ); - m_pLabel->setFont( m_font ); - QFontMetrics fm(m_font); - - // Variable width font. - if ( fm.width('W')!=fm.width('i') ) - { - int result = KMessageBox::warningYesNo(m_pParent, i18n( - "You selected a variable width font.\n\n" - "Because this program doesn't handle variable width fonts\n" - "correctly, you might experience problems while editing.\n\n" - "Do you want to continue or do you want to select another font."), - i18n("Incompatible font."), - i18n("Continue at my own risk"), i18n("Select another font")); - if (result==KMessageBox::Yes) - return; - } - else - return; - } -} - - -KColorButton::KColorButton(QWidget* parent) -: QPushButton(parent) -{ - connect( this, SIGNAL(clicked()), this, SLOT(slotClicked())); -} - -QColor KColorButton::color() -{ - return m_color; -} - -void KColorButton::setColor( const QColor& color ) -{ - m_color = color; - update(); -} - -void KColorButton::paintEvent( QPaintEvent* e ) -{ - QPushButton::paintEvent(e); - QPainter p(this); - - int w = width(); - int h = height(); - p.fillRect( 10, 5, w-20, h-10, m_color ); - p.drawRect( 10, 5, w-20, h-10 ); -} - -void KColorButton::slotClicked() -{ - // Under Windows ChooseColor() should be used. (Nicer if few colors exist.) - QColor c = QColorDialog::getColor ( m_color, this ); - if ( c.isValid() ) m_color = c; - update(); -} - -KPrinter::KPrinter() -{ -} -Q3ValueList KPrinter::pageList() -{ - Q3ValueList vl; - int to = toPage(); - for(int i=fromPage(); i<=to; ++i) - { - vl.push_back(i); - } - return vl; -} -void KPrinter::setCurrentPage(int) -{ -} -void KPrinter::setPageSelection(e_PageSelection) -{ -} - - -QPixmap KIconLoader::loadIcon( const QString&, int ) -{ - return QPixmap(); -} - -KAboutData::KAboutData( const QString& /*name*/, const QString& appName, const QString& version, - const QString& description, int, - const QString& copyright, int, const QString& homepage, const QString& email) -{ - s_copyright = copyright; - s_email = email; - s_appName = appName; - s_description = description; - s_version = version; - s_homepage = homepage; -} - -KAboutData::KAboutData( const QString& /*name*/, const QString& /*appName*/, const QString& /*version*/ ) -{ -} - -void KAboutData::addAuthor(const char* name, const char* task, const char* email, const char* weblink) -{ - m_authorList.push_back( AboutDataEntry( name, task, email, weblink) ); -} - -void KAboutData::addCredit(const char* name, const char* task, const char* email, const char* weblink) -{ - m_creditList.push_back( AboutDataEntry( name, task, email, weblink) ); -} - -/* Option structure: e.g.: - { "m", 0, 0 }, - { "merge", I18N_NOOP("Automatically merge the input."), 0 }, - { "o", 0, 0 }, - { "output file", I18N_NOOP("Output file. Implies -m. E.g.: -o newfile.txt"), 0 }, - { "+[File1]", I18N_NOOP("file1 to open (base)"), 0 }, - { "+[File2]", I18N_NOOP("file2 to open"), 0 }, - { "+[File3]", I18N_NOOP("file3 to open"), 0 }, -*/ -//////////////// -static KCmdLineArgs s_cmdLineArgs; -static int s_argc; -static char** s_argv; -static KCmdLineOptions* s_pOptions; - -static std::vector s_vOption; -static std::vector s_vArg; - -KCmdLineArgs* KCmdLineArgs::parsedArgs() // static -{ - return &s_cmdLineArgs; -} - -void KCmdLineArgs::init( int argc, char**argv, KAboutData* pAboutData ) // static -{ - s_argc = argc; - s_argv = argv; - s_pAboutData = pAboutData; -} - -void KCmdLineArgs::addCmdLineOptions( KCmdLineOptions* options ) // static -{ - s_pOptions = options; -} - -int KCmdLineArgs::count() -{ - return s_vArg.size(); -} - -QString KCmdLineArgs::arg(int idx) -{ - return QString::fromLocal8Bit( s_vArg[idx] ); -} - -void KCmdLineArgs::clear() -{ -} - -QString KCmdLineArgs::getOption( const QString& s ) -{ - // Find the option - int j=0; - for( j=0; j<(int)s_vOption.size(); ++j ) - { - const char* optName = s_pOptions[j].name; - const char* pos = strchr( optName,' ' ); - int len = pos==0 ? strlen( optName ) : pos - optName; - - if( s == (const char*)( Q3CString( optName, len+1) ) ) - { - return s_vOption[j].isEmpty() ? QString() : s_vOption[j].last(); - } - } - assert(false); - return QString(); -} - -QCStringList KCmdLineArgs::getOptionList( const QString& s ) -{ - // Find the option - int j=0; - for( j=0; j<(int)s_vOption.size(); ++j ) - { - const char* optName = s_pOptions[j].name; - const char* pos = strchr( optName,' ' ); - int len = pos==0 ? strlen( optName ) : pos - optName; - - if( s == (const char*)( Q3CString( optName, len+1) ) ) - { - return s_vOption[j]; - } - } - - assert(false); - return QCStringList(); -} - -bool KCmdLineArgs::isSet(const QString& s) -{ - // Find the option - int j=0; - for( j=0; j<(int)s_vOption.size(); ++j ) - { - const char* optName = s_pOptions[j].name; - if( s == QString( optName ) ) - { - return ! s_vOption[j].isEmpty(); - } - } - assert(false); - return false; -} - -/////////////////// -KApplication* kapp; - -KApplication::KApplication() -: QApplication( s_argc,s_argv ) -{ - kapp = this; - - int nofOptions=0; - int nofArgs=0; - int i=0; - while( s_pOptions[i].name != 0 ) - { - if ( s_pOptions[i].name[0]=='[' ) - nofArgs++; - else - nofOptions++; - - ++i; - } - - // First find the option "-config" or "--config" to allow loading of options - QString configFileName; - for( i=1; i0 && ( s_argv[i][1]=='-' && len2-2==len && memcmp( &s_argv[i][2], optName, len )==0 || - len2-1==len && memcmp( &s_argv[i][1], optName, len )==0 )) - { - if (s_pOptions[j].description == 0) // alias, because without description. - { - ++j; - optName = s_pOptions[j].name; - pos = strchr( optName,' ' ); - } - if (pos!=0){ ++i; s_vOption[j].append(s_argv[i]); } //use param - else { s_vOption[j].append("1"); } //set state - break; - } - } - if (j==nofOptions) - { - QString s; - 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"; - - s += "KDiff3-Usage when starting via commandline: \n"; - s += "- Comparing 2 files:\t\tkdiff3 file1 file2\n"; - s += "- Merging 2 files: \t\tkdiff3 file1 file2 -o outputfile\n"; - s += "- Comparing 3 files:\t\tkdiff3 file1 file2 file3\n"; - s += "- Merging 3 files: \t\tkdiff3 file1 file2 file3 -o outputfile\n"; - s += " Note that file1 will be treated as base of file2 and file3.\n"; - s += "\n"; - s += "If you start without arguments, then a dialog will appear\n"; - s += "where you can select your files via a filebrowser.\n"; - s += "\n"; - - s += "Options:\n"; - - j=0; - int pos=s.length(); - for( j=0; j1 ) s += "-"; - } - s += s_pOptions[j].name; - s += QString().fill(' ', minMaxLimiter( 20 - ((int)s.length()-pos), 3, 20 ) ); - s += s_pOptions[j].description; - s +="\n"; - pos=s.length(); - } - else - { - s += "-"; - if ( strlen(s_pOptions[j].name)>1 ) s += "-"; - s += s_pOptions[j].name; - s += ", "; - } - } - - s += "\n"+i18n("For more documentation, see the help-menu or the subdirectory doc.")+"\n"; -#ifdef _WIN32 - // A windows program has no console - if ( 0==QMessageBox::information(0, i18n("KDiff3-Usage"), s, i18n("Ignore"),i18n("Exit") ) ) - continue; -#else - std::cerr << s.latin1() << std::endl; -#endif - - ::exit(-1); - } - } - else - s_vArg.push_back( s_argv[i] ); - } -} - -KConfig* KApplication::config() -{ - return &m_config; -} - -bool KApplication::isRestored() -{ - return false; -} - -KApplication* KApplication::kApplication() -{ - return kapp; -} - -KIconLoader* KApplication::iconLoader() -{ - return &m_iconLoader; -} - - -namespace KIO -{ - SimpleJob* mkdir( KURL ){return 0;} - SimpleJob* rmdir( KURL ){return 0;} - SimpleJob* file_delete( KURL, bool ){return 0;} - FileCopyJob* file_move( KURL, KURL, int, bool, bool, bool ) {return 0;} - FileCopyJob* file_copy( KURL, KURL, int, bool, bool, bool ) {return 0;} - CopyJob* link( KURL, KURL, bool ) {return 0;} - ListJob* listRecursive( KURL, bool, bool ){return 0;} - ListJob* listDir( KURL, bool, bool ){return 0;} - StatJob* stat( KURL, bool, int, bool ){return 0;} - TransferJob* get( KURL, bool, bool ){return (TransferJob*)0;} - TransferJob* put( KURL, int, bool, bool, bool ){return (TransferJob*)0;} -}; - -KActionCollection* KParts::Part::actionCollection() -{ - return 0; -} - -KApplication* KParts::Part::instance() -{ - return kapp; -} - - -KLibLoader* KLibLoader::self() -{ - static KLibLoader ll; - return ≪ -} - -extern "C" void* init_libkdiff3part(); -KLibFactory* KLibLoader::factory(QString const&) -{ - return (KLibFactory*) init_libkdiff3part(); -} - -QObject* KLibFactory::create(QObject* pParent, const QString& name, const QString& classname ) -{ - KParts::Factory* f = dynamic_cast(this); - if (f!=0) - return f->createPartObject( (QWidget*)pParent, name.ascii(), - pParent, name.ascii(), - classname.ascii(), QStringList() ); - else - return 0; -} - - - - -#include "kreplacements.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kreplacements.h --- a/kdiff3/src/kreplacements/kreplacements.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,512 +0,0 @@ -/*************************************************************************** - kreplacements.h - description - ------------------- - begin : Sat Aug 3 2002 - copyright : (C) 2002-2006 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef KREPLACEMENTS_H -#define KREPLACEMENTS_H - -#include "common.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include - -#include -#include - -QString getTranslationDir(); - -class KMainWindow; - -class KURL -{ -public: - KURL(){} - KURL(const QString& s){ m_s = s; } - static KURL fromPathOrURL( const QString& s ){ return KURL(s); } - QString url() const { return m_s; } - bool isEmpty() const { return m_s.isEmpty(); } - QString prettyURL() const { return m_s; } - bool isLocalFile() const { return true; } - bool isValid() const { return true; } - QString path() const { return m_s; } - void setPath( const QString& s ){ m_s=s; } - QString fileName() const { return m_s; } // not really needed - void addPath( const QString& s ){ m_s += "/" + s; } -private: - QString m_s; -}; - -class KMessageBox -{ -public: - static void error( QWidget* parent, const QString& text, const QString& caption=QString() ); - static int warningContinueCancel( QWidget* parent, const QString& text, const QString& caption=QString(), - const QString& button1=QString("Continue") ); - static void sorry( QWidget* parent, const QString& text, const QString& caption=QString() ); - static void information( QWidget* parent, const QString& text, const QString& caption=QString() ); - static int warningYesNo( QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ); - static int warningYesNoCancel( - QWidget* parent, const QString& text, const QString& caption, - const QString& button1, const QString& button2 ); - - enum {Cancel=-1, No=0, Yes=1, Continue=1}; -}; - -#define i18n(x) QObject::tr(x) -#define I18N_NOOP(x) x -#define RESTORE(x) -#define _UNLOAD(x) - -typedef Q3PopupMenu KPopupMenu; - -class KDialogBase : public Q3TabDialog -{ - Q_OBJECT -public: - KDialogBase( int, const QString& caption, int, int, QWidget* parent, const char* name, - bool /*modal*/, bool ); - ~KDialogBase(); - - void incInitialSize ( const QSize& ); - void setHelp(const QString& helpfilename, const QString& ); - enum {IconList, Help, Default, Apply, Ok, Cancel }; - - int BarIcon(const QString& iconName, int ); - - Q3VBox* addVBoxPage( const QString& name, const QString& info, int ); - QFrame* addPage( const QString& name, const QString& info, int ); - int spacingHint(); - - virtual void accept(); -signals: - void applyClicked(); - -protected slots: - virtual void slotOk( void ); - virtual void slotApply( void ); - virtual void slotHelp( void ); - virtual void slotCancel( void ); - virtual void slotDefault( void ); -}; - -class KFileDialog : public Q3FileDialog -{ -public: - static KURL getSaveURL( const QString &startDir=QString::null, - const QString &filter=QString::null, - QWidget *parent=0, const QString &caption=QString::null); - static KURL getOpenURL( const QString & startDir = QString::null, - const QString & filter = QString::null, - QWidget * parent = 0, - const QString & caption = QString::null ); - static KURL getExistingURL( const QString & startDir = QString::null, - QWidget * parent = 0, - const QString & caption = QString::null ); - static QString getSaveFileName (const QString &startDir=QString::null, - const QString &filter=QString::null, - QWidget *parent=0, - const QString &caption=QString::null); -}; - -typedef QStatusBar KStatusBar; - -class KToolBar : public Q3ToolBar -{ -public: - KToolBar(Q3MainWindow* parent); - - enum BarPosition {Top, Bottom, Left, Right}; - BarPosition barPos(); - void setBarPos(BarPosition); -private: - Q3MainWindow* m_pMainWindow; -}; - -class KActionCollection -{ -public: - KMainWindow* m_pMainWindow; - KActionCollection( KMainWindow* p){ m_pMainWindow=p; } -}; - -class KKeyDialog -{ -public: - static void configure(void*, QWidget*){} - static void configureKeys(KActionCollection*, const QString&){} - static void configure(KActionCollection*, const QString&){} -}; - -namespace KParts -{ - class ReadWritePart; -} - -class KMainWindow : public Q3MainWindow -{ - Q_OBJECT -private: - KStatusBar m_statusBar; - KActionCollection m_actionCollection; -protected: - virtual bool queryClose() = 0; - virtual bool queryExit() = 0; -public: - 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; - - KMainWindow( QWidget* parent, const char* name ); - KToolBar* toolBar(const QString& s = QString::null); - KActionCollection* actionCollection(); - void createGUI(); - void createGUI(KParts::ReadWritePart*){createGUI();} - - QList* memberList; -public slots: - void slotHelp(); - void slotAbout(); -}; - -class KConfig : public ValueMap -{ - QString m_fileName; -public: - KConfig(); - ~KConfig(); - void readConfigFile(const QString& configFileName); - - void setGroup(const QString&); -}; - -class KAction : public QAction -{ - Q_OBJECT -public: - 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(Q3PopupMenu*); -}; - -class KToggleAction : public KAction -{ -public: - 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 QIcon& icon, int accel, KActionCollection* actionCollection, const char* name, bool bMenu=true); - void setChecked(bool); - bool isChecked(); -}; - - -class KStdAction -{ -public: - static KAction* open( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* save( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* saveAs( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* print( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* quit( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* cut( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* copy( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* paste( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* selectAll( QWidget* parent, const char* slot, KActionCollection* ); - static KToggleAction* showToolbar( QWidget* parent, const char* slot, KActionCollection* ); - static KToggleAction* showStatusbar( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* preferences( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* about( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* aboutQt( KActionCollection* ); - static KAction* help( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* find( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* findNext( QWidget* parent, const char* slot, KActionCollection* ); - static KAction* keyBindings( QWidget* parent, const char* slot, KActionCollection* ); -}; - -class KIcon -{ -public: - enum {SizeMedium,Small}; -}; - -class KFontChooser : public QWidget -{ - Q_OBJECT - QFont m_font; - QPushButton* m_pSelectFont; - QLabel* m_pLabel; - QWidget* m_pParent; -public: - KFontChooser( QWidget* pParent, const QString& name, bool, const QStringList&, bool, int ); - QFont font(); - void setFont( const QFont&, bool ); -private slots: - void slotSelectFont(); -}; - -class KColorButton : public QPushButton -{ - Q_OBJECT - QColor m_color; -public: - KColorButton(QWidget* parent); - QColor color(); - void setColor(const QColor&); - virtual void paintEvent(QPaintEvent* e); -public slots: - void slotClicked(); -}; - -class KPrinter : public QPrinter -{ -public: - KPrinter(); - enum e_PageSelection {ApplicationSide}; - Q3ValueList pageList(); - void setCurrentPage(int); - void setPageSelection(e_PageSelection); -}; - -class KStandardDirs -{ -public: - QString findResource(const QString& resource, const QString& appName); -}; - -struct KCmdLineOptions -{ - const char* name; - const char* description; - int def; -}; - -#define KCmdLineLastOption {0,0,0} - -class KAboutData -{ -public: - KAboutData( const QString& name, const QString& appName, const QString& version, - const QString& description, int licence, - const QString& copyright, int w, const QString& homepage, const QString& email); - KAboutData( const QString& name, const QString& appName, const QString& version ); - void addAuthor(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); - void addCredit(const char* name=0, const char* task=0, const char* email=0, const char* weblink=0); - enum { License_GPL }; - - struct AboutDataEntry - { - AboutDataEntry(const QString& name, const QString& task, const QString& email, const QString& weblink) - : m_name(name), m_task(task), m_email(email), m_weblink(weblink) - {} - QString m_name; - QString m_task; - QString m_email; - QString m_weblink; - }; - - std::list m_authorList; - std::list m_creditList; -}; - -typedef Q3ValueList QCStringList; - -class KCmdLineArgs -{ -public: - static KCmdLineArgs* parsedArgs(); - static void init( int argc, char**argv, KAboutData* ); - static void addCmdLineOptions( KCmdLineOptions* options ); // Add our own options. - - int count(); - QString arg(int); - KURL url(int i){ return KURL(arg(i)); } - void clear(); - QString getOption(const QString&); - QCStringList getOptionList( const QString& ); - bool isSet(const QString&); -}; - -class KIconLoader -{ -public: - QPixmap loadIcon(const QString& name, int); -}; - -class KApplication : public QApplication -{ - KConfig m_config; - KIconLoader m_iconLoader; -public: - KApplication(); - static KApplication* kApplication(); - KIconLoader* iconLoader(); - KConfig* config(); - bool isRestored(); -}; - -extern KApplication* kapp; - -class KLibFactory : public QObject -{ - Q_OBJECT -public: - QObject* create(QObject*,const QString&,const QString&); -}; - -class KLibLoader -{ -public: - static KLibLoader* self(); - KLibFactory* factory(const QString&); -}; - -class KEditToolbar : public QDialog -{ -public: - KEditToolbar( int ){} -}; - -class KGlobal -{ -public: - static KConfig* config() { return 0; } -}; - -namespace KIO -{ - enum UDSEntry {}; - typedef Q3ValueList UDSEntryList; - class Job : public QObject - { - public: - void kill(bool){} - bool error() {return false;} - void showErrorDialog( QWidget* ) {} - }; - class SimpleJob : public Job {}; - SimpleJob* mkdir( KURL ); - SimpleJob* rmdir( KURL ); - SimpleJob* file_delete( KURL, bool ); - class FileCopyJob : public Job {}; - FileCopyJob* file_move( KURL, KURL, int, bool, bool, bool ); - FileCopyJob* file_copy( KURL, KURL, int, bool, bool, bool ); - class CopyJob : public Job {}; - CopyJob* link( KURL, KURL, bool ); - class ListJob : public Job {}; - ListJob* listRecursive( KURL, bool, bool ); - ListJob* listDir( KURL, bool, bool ); - class StatJob : public Job { - public: UDSEntry statResult(){ return (UDSEntry)0; } - }; - StatJob* stat( KURL, bool, int, bool ); - class TransferJob : public Job {}; - TransferJob* get( KURL, bool, bool ); - TransferJob* put( KURL, int, bool, bool, bool ); -}; - -typedef Q3ProgressBar KProgress; - -class KInstance : public QObject -{ -public: - KInstance(KAboutData*){} -}; - -namespace KParts -{ - class MainWindow : public KMainWindow - { - public: - MainWindow( QWidget* parent, const char* name ) : KMainWindow(parent,name) {} - void setXMLFile(const QString&){} - void setAutoSaveSettings(){} - void saveMainWindowSettings(KConfig*){} - void applyMainWindowSettings(KConfig*){} - int factory(){return 0;} - }; - - class Part : public QObject - { - public: - KActionCollection* actionCollection(); - KApplication* instance(); - void setWidget( QWidget* w ){ m_pWidget=w; } - QWidget* widget(){return m_pWidget;} - void setXMLFile(const QString&){} - private: - QWidget* m_pWidget; - }; - - class ReadOnlyPart : public Part - { - public: - ReadOnlyPart(){} - ReadOnlyPart(QObject*,const Q3CString&){} - void setInstance( KInstance* ){} - QString m_file; - }; - - class ReadWritePart : public ReadOnlyPart - { - public: - ReadWritePart(QObject*,const Q3CString&){} - void setReadWrite(bool){} - }; - - class Factory : public KLibFactory - { - Q_OBJECT - public: - virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args )=0; - }; -}; -#endif - - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kstandarddirs.h --- a/kdiff3/src/kreplacements/kstandarddirs.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kstatusbar.h --- a/kdiff3/src/kreplacements/kstatusbar.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kstdaction.h --- a/kdiff3/src/kreplacements/kstdaction.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/ktempfile.h --- a/kdiff3/src/kreplacements/ktempfile.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kunload.h --- a/kdiff3/src/kreplacements/kunload.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kurl.h --- a/kdiff3/src/kreplacements/kurl.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/kreplacements/kurldrag.h --- a/kdiff3/src/kreplacements/kurldrag.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#include "kreplacements.h" - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/lo16-app-kdiff3.png Binary file kdiff3/src/lo16-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/lo32-app-kdiff3.png Binary file kdiff3/src/lo32-app-kdiff3.png has changed diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/main.cpp --- a/kdiff3/src/main.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ -/*************************************************************************** - main.cpp - Where everything starts. - ------------------- - begin : Don Jul 11 12:31:29 CEST 2002 - copyright : (C) 2002-2006 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include -#include -#include -#include "kdiff3_shell.h" -#include -#include "version.h" -#include -#include -#include -//Added by qt3to4: -#include -#include - -#ifdef KREPLACEMENTS_H -#include "optiondialog.h" -#endif -#include "common.h" - -static const char *description = - I18N_NOOP("Tool for Comparison and Merge of Files and Directories"); - -static KCmdLineOptions options[] = -{ - { "m", 0, 0 }, - { "merge", I18N_NOOP("Merge the input."), 0 }, - { "b", 0, 0 }, - { "base file", I18N_NOOP("Explicit base file. For compatibility with certain tools."), 0 }, - { "o", 0, 0 }, - { "output file", I18N_NOOP("Output file. Implies -m. E.g.: -o newfile.txt"), 0 }, - { "out file", I18N_NOOP("Output file, again. (For compatibility with certain tools.)"), 0 }, - { "auto", I18N_NOOP("No GUI if all conflicts are auto-solvable. (Needs -o file)"), 0 }, - { "qall", I18N_NOOP("Don't solve conflicts automatically. (For compatibility...)"), 0 }, - { "L1 alias1", I18N_NOOP("Visible name replacement for input file 1 (base)."), 0 }, - { "L2 alias2", I18N_NOOP("Visible name replacement for input file 2."), 0 }, - { "L3 alias3", I18N_NOOP("Visible name replacement for input file 3."), 0 }, - { "L", 0, 0 }, - { "fname alias", I18N_NOOP("Alternative visible name replacement. Supply this once for every input."), 0 }, - { "cs string", I18N_NOOP("Override a config setting. Use once for every setting. E.g.: --cs \"AutoAdvance=1\""), 0 }, - { "confighelp", I18N_NOOP("Show list of config settings and current values."), 0 }, - { "config file", I18N_NOOP("Use a different config file."), 0 } -}; -static KCmdLineOptions options2[] = -{ - { "+[File1]", I18N_NOOP("file1 to open (base, if not specified via --base)"), 0 }, - { "+[File2]", I18N_NOOP("file2 to open"), 0 }, - { "+[File3]", I18N_NOOP("file3 to open"), 0 } -}; - - -void initialiseCmdLineArgs(std::vector& vOptions, QStringList& ignorableOptions) -{ - vOptions.insert( vOptions.end(), options, (KCmdLineOptions*)((char*)options+sizeof(options))); - QString configFileName = KStandardDirs().findResource("config","kdiff3rc"); - QFile configFile( configFileName ); - if ( configFile.open( QIODevice::ReadOnly ) ) - { - QTextStream ts( &configFile ); - while(!ts.atEnd()) - { - QString line = ts.readLine(); - if ( line.startsWith("IgnorableCmdLineOptions=") ) - { - int pos = line.find('='); - if (pos>=0) - { - QString s = line.mid(pos+1); - QStringList sl = QStringList::split( '|', s ); - if (!sl.isEmpty()) - { - ignorableOptions = QStringList::split( ';', sl.front() ); - for (QStringList::iterator i=ignorableOptions.begin(); i!=ignorableOptions.end(); ++i) - { - KCmdLineOptions ignoreOption; - (*i).remove('-'); - if (!(*i).isEmpty()) - { - ignoreOption.name = (*i).latin1(); - ignoreOption.description = I18N_NOOP("Ignored. (User defined.)"); - ignoreOption.def = 0; - vOptions.push_back(ignoreOption); - } - } - } - } - break; - } - } - } - vOptions.insert(vOptions.end(),options2,(KCmdLineOptions*)((char*)options2+sizeof(options2))); - - KCmdLineOptions last = KCmdLineLastOption; - vOptions.push_back(last); - KCmdLineArgs::addCmdLineOptions( &vOptions[0] ); // Add our own options. -} - - -#ifdef _WIN32 -#include -// This command checks the comm -static bool isOptionUsed(const QString& s, int argc, char* argv[]) -{ - for(int j=0; j vOptions; - QStringList ignorableOptions; - initialiseCmdLineArgs(vOptions, ignorableOptions); - - KApplication app; - -#ifdef KREPLACEMENTS_H - QString locale; - - locale = app.config()->readEntry("Language", "Auto"); - int spacePos = locale.find(' '); - if (spacePos>0) locale = locale.left(spacePos); - QTranslator kdiff3Translator( 0 ); - QTranslator qtTranslator( 0 ); - if (locale != "en_orig") - { - if ( locale == "Auto" || locale.isEmpty() ) - locale = QTextCodec::locale(); - - QString translationDir = getTranslationDir(); - kdiff3Translator.load( QString("kdiff3_")+locale, translationDir ); - app.installTranslator( &kdiff3Translator ); - - qtTranslator.load( QString("qt_")+locale, translationDir ); - app.installTranslator( &qtTranslator ); - } -#endif - - if (app.isRestored()) - { - RESTORE(KDiff3Shell); - } - else - { - new KDiff3Shell(); - } - - int retVal = app.exec(); - return retVal; -} - -// Suppress warning with --enable-final -#undef VERSION diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/merger.cpp --- a/kdiff3/src/merger.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/*************************************************************************** - merger.cpp - description - ------------------- - begin : Sun Mar 24 2002 - copyright : (C) 2002-2004 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "merger.h" -#include -#include -#include - -Merger::Merger( const DiffList* pDiffListAB, const DiffList* pDiffListCA ) -: md1( pDiffListAB, 0 ), md2( pDiffListCA, 1 ) -{ -} - - -Merger::MergeData::MergeData( const DiffList* p, int i ) -: d(0,0,0) -{ - idx=i; - pDiffList = p; - if ( p!=0 ) - { - it=p->begin(); - update(); - } -} - -bool Merger::MergeData::eq() -{ - return pDiffList==0 || d.nofEquals > 0; -} - -bool Merger::MergeData::isEnd() -{ - return ( pDiffList==0 || ( it==pDiffList->end() && d.nofEquals==0 && - ( idx == 0 ? d.diff1==0 : d.diff2==0 ) - ) ); -} - -void Merger::MergeData::update() -{ - if ( d.nofEquals > 0 ) - --d.nofEquals; - else if ( idx==0 && d.diff1 > 0 ) - --d.diff1; - else if ( idx==1 && d.diff2 > 0 ) - --d.diff2; - - while( d.nofEquals == 0 && (idx==0 && d.diff1 == 0 || idx==1 && d.diff2 == 0) - && pDiffList!=0 && it != pDiffList->end() ) - { - d = *it; - ++it; - } -} - -void Merger::next() -{ - md1.update(); - md2.update(); -} - -int Merger::whatChanged() -{ - int changed = 0; - changed |= md1.eq() ? 0 : 1; - changed |= md2.eq() ? 0 : 2; - return changed; -} - -bool Merger::isEndReached() -{ - return md1.isEnd() && md2.isEnd(); -} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/merger.h --- a/kdiff3/src/merger.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/*************************************************************************** - merger.h - description - ------------------- - begin : Sun Mar 24 2002 - copyright : (C) 2002-2004 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef MERGER_H -#define MERGER_H - -#include "diff.h" - - -class Merger -{ -public: - - Merger( const DiffList* pDiffList1, const DiffList* pDiffList2 ); - - /** Go one step. */ - void next(); - - /** Information about what changed. Can be used for coloring. - The return value is 0 if nothing changed here, - bit 1 is set if a difference from pDiffList1 was detected, - bit 2 is set if a difference from pDiffList2 was detected. - */ - int whatChanged(); - - /** End of both diff lists reached. */ - bool isEndReached(); -private: - - struct MergeData - { - DiffList::const_iterator it; - const DiffList* pDiffList; - Diff d; - int idx; - - MergeData( const DiffList* p, int i ); - bool eq(); - void update(); - bool isEnd(); - }; - - MergeData md1; - MergeData md2; -}; - -#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/mergeresultwindow.cpp --- a/kdiff3/src/mergeresultwindow.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3041 +0,0 @@ -/*************************************************************************** - mergeresultwindow.cpp - description - ------------------- - begin : Sun Apr 14 2002 - copyright : (C) 2002-2006 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "mergeresultwindow.h" -#include "optiondialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -int g_bAutoSolve = true; - -#undef leftInfoWidth -#define leftInfoWidth 3 - -MergeResultWindow::MergeResultWindow( - QWidget* pParent, - OptionDialog* pOptionDialog, - QStatusBar* pStatusBar - ) -: QWidget( pParent, 0, Qt::WNoAutoErase ) -{ - setFocusPolicy( Qt::ClickFocus ); - - m_firstLine = 0; - m_firstColumn = 0; - m_nofColumns = 0; - m_nofLines = 0; - m_totalSize = 0; - m_bMyUpdate = false; - m_bInsertMode = true; - m_scrollDeltaX = 0; - m_scrollDeltaY = 0; - m_bModified = false; - m_eOverviewMode=Overview::eOMNormal; - - m_fileName = ""; - m_pldA = 0; - m_pldB = 0; - m_pldC = 0; - m_sizeA = 0; - m_sizeB = 0; - m_sizeC = 0; - - m_pDiff3LineList = 0; - m_pTotalDiffStatus = 0; - m_pStatusBar = pStatusBar; - - m_pOptionDialog = pOptionDialog; - m_bPaintingAllowed = false; - m_delayedDrawTimer = 0; - - m_cursorXPos=0; - m_cursorOldXPos=0; - m_cursorYPos=0; - m_bCursorOn = true; - m_bCursorUpdate = false; - connect( &m_cursorTimer, SIGNAL(timeout()), this, SLOT( slotCursorUpdate() ) ); - m_cursorTimer.start( 500 /*ms*/, true /*single shot*/ ); - m_selection.reset(); - - setMinimumSize( QSize(20,20) ); - setFont( m_pOptionDialog->m_font ); -} - -void MergeResultWindow::init( - const LineData* pLineDataA, int sizeA, - const LineData* pLineDataB, int sizeB, - const LineData* pLineDataC, int sizeC, - const Diff3LineList* pDiff3LineList, - TotalDiffStatus* pTotalDiffStatus, - QString fileName - ) -{ - m_firstLine = 0; - m_firstColumn = 0; - m_nofColumns = 0; - m_nofLines = 0; - m_bMyUpdate = false; - m_bInsertMode = true; - m_scrollDeltaX = 0; - m_scrollDeltaY = 0; - m_bModified = false; - - m_fileName = fileName; - m_pldA = pLineDataA; - m_pldB = pLineDataB; - m_pldC = pLineDataC; - m_sizeA = sizeA; - m_sizeB = sizeB; - m_sizeC = sizeC; - - m_pDiff3LineList = pDiff3LineList; - m_pTotalDiffStatus = pTotalDiffStatus; - - m_selection.reset(); - m_cursorXPos=0; - m_cursorOldXPos=0; - m_cursorYPos=0; - - merge( g_bAutoSolve, -1 ); - g_bAutoSolve = true; - update(); - updateSourceMask(); - - int wsc; - int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); - if (m_pStatusBar) - m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); -} - -void MergeResultWindow::reset() -{ - m_pDiff3LineList = 0; - m_pTotalDiffStatus = 0; - m_pldA = 0; - m_pldB = 0; - m_pldC = 0; - m_fileName = ""; -} - -// Calculate the merge information for the given Diff3Line. -// Results will be stored in mergeDetails, bConflict, bLineRemoved and src. -void mergeOneLine( - const Diff3Line& d, e_MergeDetails& mergeDetails, bool& bConflict, - bool& bLineRemoved, int& src, bool bTwoInputs - ) -{ - mergeDetails = eDefault; - bConflict = false; - bLineRemoved = false; - src = 0; - - if ( bTwoInputs ) // Only two input files - { - if ( d.lineA!=-1 && d.lineB!=-1 ) - { - if ( d.pFineAB == 0 ) - { - mergeDetails = eNoChange; src = A; - } - else - { - mergeDetails = eBChanged; bConflict = true; - } - } - else - { - if ( d.lineA!=-1 && d.lineB==-1 ) - { - mergeDetails = eBDeleted; bConflict = true; - } - else if ( d.lineA==-1 && d.lineB!=-1 ) - { - mergeDetails = eBDeleted; bConflict = true; - } - } - return; - } - - // A is base. - if ( d.lineA!=-1 && d.lineB!=-1 && d.lineC!=-1 ) - { - if ( d.pFineAB == 0 && d.pFineBC == 0 && d.pFineCA == 0) - { - mergeDetails = eNoChange; src = A; - } - else if( d.pFineAB == 0 && d.pFineBC != 0 && d.pFineCA != 0 ) - { - mergeDetails = eCChanged; src = C; - } - else if( d.pFineAB != 0 && d.pFineBC != 0 && d.pFineCA == 0 ) - { - mergeDetails = eBChanged; src = B; - } - else if( d.pFineAB != 0 && d.pFineBC == 0 && d.pFineCA != 0 ) - { - mergeDetails = eBCChangedAndEqual; src = C; - } - else if( d.pFineAB != 0 && d.pFineBC != 0 && d.pFineCA != 0 ) - { - mergeDetails = eBCChanged; bConflict = true; - } - else - assert(false); - } - else if ( d.lineA!=-1 && d.lineB!=-1 && d.lineC==-1 ) - { - if( d.pFineAB != 0 ) - { - mergeDetails = eBChanged_CDeleted; bConflict = true; - } - else - { - mergeDetails = eCDeleted; bLineRemoved = true; src = C; - } - } - else if ( d.lineA!=-1 && d.lineB==-1 && d.lineC!=-1 ) - { - if( d.pFineCA != 0 ) - { - mergeDetails = eCChanged_BDeleted; bConflict = true; - } - else - { - mergeDetails = eBDeleted; bLineRemoved = true; src = B; - } - } - else if ( d.lineA==-1 && d.lineB!=-1 && d.lineC!=-1 ) - { - if( d.pFineBC != 0 ) - { - mergeDetails = eBCAdded; bConflict = true; - } - else // B==C - { - mergeDetails = eBCAddedAndEqual; src = C; - } - } - else if ( d.lineA==-1 && d.lineB==-1 && d.lineC!= -1 ) - { - mergeDetails = eCAdded; src = C; - } - else if ( d.lineA==-1 && d.lineB!=-1 && d.lineC== -1 ) - { - mergeDetails = eBAdded; src = B; - } - else if ( d.lineA!=-1 && d.lineB==-1 && d.lineC==-1 ) - { - mergeDetails = eBCDeleted; bLineRemoved = true; src = C; - } - else - assert(false); -} - -bool MergeResultWindow::sameKindCheck( const MergeLine& ml1, const MergeLine& ml2 ) -{ - if ( ml1.bConflict && ml2.bConflict ) - { - // Both lines have conflicts: If one is only a white space conflict and - // the other one is a real conflict, then this line returns false. - return ml1.id3l->bAEqC == ml2.id3l->bAEqC && ml1.id3l->bAEqB == ml2.id3l->bAEqB; - } - else - return ( - !ml1.bConflict && !ml2.bConflict && ml1.bDelta && ml2.bDelta && ml1.srcSelect == ml2.srcSelect || - !ml1.bDelta && !ml2.bDelta - ); -} - -void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly, bool bWhiteSpaceOnly ) -{ - if ( !bConflictsOnly ) - { - if(m_bModified) - { - int result = KMessageBox::warningYesNo(this, - i18n("The output has been modified.\n" - "If you continue your changes will be lost."), - i18n("Warning"), i18n("C&ontinue"), i18n("&Cancel")); - if ( result==KMessageBox::No ) - return; - } - - m_mergeLineList.clear(); - m_totalSize = 0; - int lineIdx = 0; - Diff3LineList::const_iterator it; - for( it=m_pDiff3LineList->begin(); it!=m_pDiff3LineList->end(); ++it, ++lineIdx ) - { - const Diff3Line& d = *it; - - MergeLine ml; - bool bLineRemoved; - mergeOneLine( d, ml.mergeDetails, ml.bConflict, bLineRemoved, ml.srcSelect, m_pldC==0 ); - - // Automatic solving for only whitespace changes. - if ( ml.bConflict && - ( m_pldC==0 && (d.bAEqB || d.bWhiteLineA && d.bWhiteLineB) || - m_pldC!=0 && (d.bAEqB && d.bAEqC || d.bWhiteLineA && d.bWhiteLineB && d.bWhiteLineC ) ) ) - { - ml.bWhiteSpaceConflict = true; - } - - ml.d3lLineIdx = lineIdx; - ml.bDelta = ml.srcSelect != A; - ml.id3l = it; - ml.srcRangeLength = 1; - - MergeLine* back = m_mergeLineList.empty() ? 0 : &m_mergeLineList.back(); - - bool bSame = back!=0 && sameKindCheck( ml, *back ); - if( bSame ) - { - ++back->srcRangeLength; - if ( back->bWhiteSpaceConflict && !ml.bWhiteSpaceConflict ) - back->bWhiteSpaceConflict = false; - } - else - { - if (back!=0 && back->bWhiteSpaceConflict ) - { - if ( m_pldC==0 && m_pOptionDialog->m_whiteSpace2FileMergeDefault != 0 ) // Only two inputs - { - back->srcSelect = m_pOptionDialog->m_whiteSpace2FileMergeDefault; - back->bConflict = false; - } - else if ( m_pldC!=0 && m_pOptionDialog->m_whiteSpace3FileMergeDefault != 0 ) - { - back->srcSelect = m_pOptionDialog->m_whiteSpace3FileMergeDefault; - back->bConflict = false; - } - } - ml.mergeEditLineList.setTotalSizePtr(&m_totalSize); - m_mergeLineList.push_back( ml ); - } - - if ( ! ml.bConflict ) - { - MergeLine& tmpBack = m_mergeLineList.back(); - MergeEditLine mel(ml.id3l); - mel.setSource( ml.srcSelect, bLineRemoved ); - tmpBack.mergeEditLineList.push_back(mel); - } - else if ( back==0 || ! back->bConflict || !bSame ) - { - MergeLine& tmpBack = m_mergeLineList.back(); - MergeEditLine mel(ml.id3l); - mel.setConflict(); - tmpBack.mergeEditLineList.push_back(mel); - } - } - } - - if ( !bAutoSolve ) - { - // Change all auto selections - MergeLineList::iterator mlIt; - for( mlIt=m_mergeLineList.begin(); mlIt!=m_mergeLineList.end(); ++mlIt ) - { - MergeLine& ml = *mlIt; - bool bConflict = ml.mergeEditLineList.empty() || ml.mergeEditLineList.begin()->isConflict(); - if ( ml.bDelta && ( !bConflictsOnly || bConflict ) && (!bWhiteSpaceOnly || ml.bWhiteSpaceConflict )) - { - ml.mergeEditLineList.clear(); - if ( defaultSelector==-1 && ml.bDelta ) - { - MergeEditLine mel(ml.id3l);; - mel.setConflict(); - ml.bConflict = true; - ml.mergeEditLineList.push_back(mel); - } - else - { - Diff3LineList::const_iterator d3llit=ml.id3l; - int j; - - for( j=0; jlineA : - defaultSelector==2 ? d3llit->lineB : - defaultSelector==3 ? d3llit->lineC : -1; - - if ( srcLine != -1 ) - { - ml.mergeEditLineList.push_back(mel); - } - - ++d3llit; - } - - if ( ml.mergeEditLineList.empty() ) // Make a line nevertheless - { - MergeEditLine mel(ml.id3l); - mel.setRemoved( defaultSelector ); - ml.mergeEditLineList.push_back(mel); - } - } - } - } - } - - MergeLineList::iterator mlIt; - for( mlIt=m_mergeLineList.begin(); mlIt!=m_mergeLineList.end(); ++mlIt ) - { - MergeLine& ml = *mlIt; - // Remove all lines that are empty, because no src lines are there. - - int oldSrcLine = -1; - int oldSrc = -1; - MergeEditLineList::iterator melIt; - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ) - { - MergeEditLine& mel = *melIt; - int melsrc = mel.src(); - - int srcLine = mel.isRemoved() ? -1 : - melsrc==1 ? mel.id3l()->lineA : - melsrc==2 ? mel.id3l()->lineB : - melsrc==3 ? mel.id3l()->lineC : -1; - - // At least one line remains because oldSrc != melsrc for first line in list - // Other empty lines will be removed - if ( srcLine == -1 && oldSrcLine==-1 && oldSrc == melsrc ) - melIt = ml.mergeEditLineList.erase( melIt ); - else - ++melIt; - - oldSrcLine = srcLine; - oldSrc = melsrc; - } - } - - if ( bAutoSolve && !bConflictsOnly ) - { - if ( m_pOptionDialog->m_bRunHistoryAutoMergeOnMergeStart ) - slotMergeHistory(); - if ( m_pOptionDialog->m_bRunRegExpAutoMergeOnMergeStart ) - slotRegExpAutoMerge(); - if ( m_pldC != 0 && ! doRelevantChangesExist() ) - emit noRelevantChangesDetected(); - } - - int nrOfSolvedConflicts = 0; - int nrOfUnsolvedConflicts = 0; - int nrOfWhiteSpaceConflicts = 0; - - MergeLineList::iterator i; - for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) - { - if ( i->bConflict ) - ++nrOfUnsolvedConflicts; - else if ( i->bDelta ) - ++nrOfSolvedConflicts; - - if ( i->bWhiteSpaceConflict ) - ++nrOfWhiteSpaceConflicts; - } - - m_pTotalDiffStatus->nofUnsolvedConflicts = nrOfUnsolvedConflicts; - m_pTotalDiffStatus->nofSolvedConflicts = nrOfSolvedConflicts; - m_pTotalDiffStatus->nofWhitespaceConflicts = nrOfWhiteSpaceConflicts; - - - m_cursorXPos=0; - m_cursorOldXPos=0; - m_cursorYPos=0; - //m_firstLine = 0; // Must not set line/column without scrolling there - //m_firstColumn = 0; - - m_bModified = false; - - m_currentMergeLineIt = m_mergeLineList.begin(); - slotGoTop(); - - updateAvailabilities(); - update(); -} - -void MergeResultWindow::setFirstLine(int firstLine) -{ - m_firstLine = max2(0,firstLine); - update(); -} - -void MergeResultWindow::setFirstColumn(int firstCol) -{ - m_firstColumn = max2(0,firstCol); - update(); -} - -int MergeResultWindow::getNofColumns() -{ - return m_nofColumns; -} - -int MergeResultWindow::getNofLines() -{ - return m_totalSize; -} - -int MergeResultWindow::getNofVisibleColumns() -{ - QFontMetrics fm = fontMetrics(); - return width()/fm.width('W')-4; -} - -int MergeResultWindow::getNofVisibleLines() -{ - QFontMetrics fm = fontMetrics(); - return (height()-3)/fm.height()-2; -} - -void MergeResultWindow::resizeEvent( QResizeEvent* e ) -{ - QWidget::resizeEvent(e); - emit resizeSignal(); -} - -Overview::e_OverviewMode MergeResultWindow::getOverviewMode() -{ - return m_eOverviewMode; -} - -void MergeResultWindow::setOverviewMode( Overview::e_OverviewMode eOverviewMode ) -{ - m_eOverviewMode = eOverviewMode; -} - -// Check whether we should ignore current delta when moving to next/previous delta -bool MergeResultWindow::checkOverviewIgnore(MergeLineList::iterator &i) -{ - if (m_eOverviewMode == Overview::eOMNormal) return false; - if (m_eOverviewMode == Overview::eOMAvsB) - return i->mergeDetails == eCAdded || i->mergeDetails == eCDeleted || i->mergeDetails == eCChanged; - if (m_eOverviewMode == Overview::eOMAvsC) - return i->mergeDetails == eBAdded || i->mergeDetails == eBDeleted || i->mergeDetails == eBChanged; - if (m_eOverviewMode == Overview::eOMBvsC) - return i->mergeDetails == eBCAddedAndEqual || i->mergeDetails == eBCDeleted || i->mergeDetails == eBCChangedAndEqual; - return false; -} - -// Go to prev/next delta/conflict or first/last delta. -void MergeResultWindow::go( e_Direction eDir, e_EndPoint eEndPoint ) -{ - assert( eDir==eUp || eDir==eDown ); - MergeLineList::iterator i = m_currentMergeLineIt; - bool bSkipWhiteConflicts = ! m_pOptionDialog->m_bShowWhiteSpace; - if( eEndPoint==eEnd ) - { - if (eDir==eUp) i = m_mergeLineList.begin(); // first mergeline - else i = --m_mergeLineList.end(); // last mergeline - - while ( i!=m_mergeLineList.end() && ! i->bDelta ) - { - if ( eDir==eUp ) ++i; // search downwards - else --i; // search upwards - } - } - else if ( eEndPoint == eDelta && i!=m_mergeLineList.end()) - { - do - { - if ( eDir==eUp ) --i; - else ++i; - } - while ( i!=m_mergeLineList.end() && ( i->bDelta == false || checkOverviewIgnore(i) || bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ); - } - else if ( eEndPoint == eConflict && i!=m_mergeLineList.end() ) - { - do - { - if ( eDir==eUp ) --i; - else ++i; - } - while ( i!=m_mergeLineList.end() && (i->bConflict == false || bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ); - } - else if ( i!=m_mergeLineList.end() && eEndPoint == eUnsolvedConflict ) - { - do - { - if ( eDir==eUp ) --i; - else ++i; - } - while ( i!=m_mergeLineList.end() && ! i->mergeEditLineList.begin()->isConflict() ); - } - - if ( isVisible() ) - setFocus(); - - setFastSelector( i ); -} - -bool MergeResultWindow::isDeltaAboveCurrent() -{ - bool bSkipWhiteConflicts = ! m_pOptionDialog->m_bShowWhiteSpace; - if (m_mergeLineList.empty()) return false; - MergeLineList::iterator i = m_currentMergeLineIt; - if (i == m_mergeLineList.begin()) return false; - do - { - --i; - if ( i->bDelta && !( bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ) return true; - } - while (i!=m_mergeLineList.begin()); - - return false; -} - -bool MergeResultWindow::isDeltaBelowCurrent() -{ - bool bSkipWhiteConflicts = ! m_pOptionDialog->m_bShowWhiteSpace; - if (m_mergeLineList.empty()) return false; - - MergeLineList::iterator i = m_currentMergeLineIt; - if (i!=m_mergeLineList.end()) - { - ++i; - for( ; i!=m_mergeLineList.end(); ++i ) - { - if ( i->bDelta && !( bSkipWhiteConflicts && i->bWhiteSpaceConflict ) ) return true; - } - } - return false; -} - -bool MergeResultWindow::isConflictAboveCurrent() -{ - if (m_mergeLineList.empty()) return false; - MergeLineList::iterator i = m_currentMergeLineIt; - if (i == m_mergeLineList.begin()) return false; - - do - { - --i; - if ( i->bConflict ) return true; - } - while (i!=m_mergeLineList.begin()); - - return false; -} - -bool MergeResultWindow::isConflictBelowCurrent() -{ - MergeLineList::iterator i = m_currentMergeLineIt; - if (m_mergeLineList.empty()) return false; - - if (i!=m_mergeLineList.end()) - { - ++i; - for( ; i!=m_mergeLineList.end(); ++i ) - { - if ( i->bConflict ) return true; - } - } - return false; -} - -bool MergeResultWindow::isUnsolvedConflictAboveCurrent() -{ - if (m_mergeLineList.empty()) return false; - MergeLineList::iterator i = m_currentMergeLineIt; - if (i == m_mergeLineList.begin()) return false; - - do - { - --i; - if ( i->mergeEditLineList.begin()->isConflict() ) return true; - } - while (i!=m_mergeLineList.begin()); - - return false; -} - -bool MergeResultWindow::isUnsolvedConflictBelowCurrent() -{ - MergeLineList::iterator i = m_currentMergeLineIt; - if (m_mergeLineList.empty()) return false; - - if (i!=m_mergeLineList.end()) - { - ++i; - for( ; i!=m_mergeLineList.end(); ++i ) - { - if ( i->mergeEditLineList.begin()->isConflict() ) return true; - } - } - return false; -} - -void MergeResultWindow::slotGoTop() -{ - go( eUp, eEnd ); -} - -void MergeResultWindow::slotGoCurrent() -{ - setFastSelector( m_currentMergeLineIt ); -} - -void MergeResultWindow::slotGoBottom() -{ - go( eDown, eEnd ); -} - -void MergeResultWindow::slotGoPrevDelta() -{ - go( eUp, eDelta ); -} - -void MergeResultWindow::slotGoNextDelta() -{ - go( eDown, eDelta ); -} - -void MergeResultWindow::slotGoPrevConflict() -{ - go( eUp, eConflict ); -} - -void MergeResultWindow::slotGoNextConflict() -{ - go( eDown, eConflict ); -} - -void MergeResultWindow::slotGoPrevUnsolvedConflict() -{ - go( eUp, eUnsolvedConflict ); -} - -void MergeResultWindow::slotGoNextUnsolvedConflict() -{ - go( eDown, eUnsolvedConflict ); -} - -/** The line is given as a index in the Diff3LineList. - The function calculates the corresponding iterator. */ -void MergeResultWindow::slotSetFastSelectorLine( int line ) -{ - MergeLineList::iterator i; - for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) - { - if ( line>=i->d3lLineIdx && line < i->d3lLineIdx + i->srcRangeLength ) - { - //if ( i->bDelta ) - { - setFastSelector( i ); - } - break; - } - } -} - -int MergeResultWindow::getNrOfUnsolvedConflicts( int* pNrOfWhiteSpaceConflicts ) -{ - int nrOfUnsolvedConflicts = 0; - if (pNrOfWhiteSpaceConflicts!=0) - *pNrOfWhiteSpaceConflicts = 0; - - MergeLineList::iterator mlIt = m_mergeLineList.begin(); - for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) - { - MergeLine& ml = *mlIt; - MergeEditLineList::iterator melIt = ml.mergeEditLineList.begin(); - if ( melIt->isConflict() ) - { - ++nrOfUnsolvedConflicts; - if ( ml.bWhiteSpaceConflict && pNrOfWhiteSpaceConflicts!=0 ) - ++ *pNrOfWhiteSpaceConflicts; - } - } - - return nrOfUnsolvedConflicts; -} - -void MergeResultWindow::showNrOfConflicts() -{ - int nrOfConflicts = 0; - MergeLineList::iterator i; - for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) - { - if ( i->bConflict || i->bDelta ) - ++nrOfConflicts; - } - QString totalInfo; - if ( m_pTotalDiffStatus->bBinaryAEqB && m_pTotalDiffStatus->bBinaryAEqC ) - totalInfo += i18n("All input files are binary equal."); - else if ( m_pTotalDiffStatus->bTextAEqB && m_pTotalDiffStatus->bTextAEqC ) - totalInfo += i18n("All input files contain the same text."); - else { - if ( m_pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files A and B are binary equal.\n"); - else if ( m_pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files A and B have equal text. \n"); - if ( m_pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files A and C are binary equal.\n"); - else if ( m_pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files A and C have equal text. \n"); - if ( m_pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files B and C are binary equal.\n"); - else if ( m_pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files B and C have equal text. \n"); - } - - int nrOfUnsolvedConflicts = getNrOfUnsolvedConflicts(); - - KMessageBox::information( this, - i18n("Total number of conflicts: ") + QString::number(nrOfConflicts) + - i18n("\nNr of automatically solved conflicts: ") + QString::number(nrOfConflicts-nrOfUnsolvedConflicts) + - i18n("\nNr of unsolved conflicts: ") + QString::number(nrOfUnsolvedConflicts) + - "\n"+totalInfo, - i18n("Conflicts") - ); -} - -void MergeResultWindow::setFastSelector(MergeLineList::iterator i) -{ - if ( i==m_mergeLineList.end() ) - return; - m_currentMergeLineIt = i; - emit setFastSelectorRange( i->d3lLineIdx, i->srcRangeLength ); - - int line1 = 0; - - MergeLineList::iterator mlIt = m_mergeLineList.begin(); - for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) - { - if(mlIt==m_currentMergeLineIt) - break; - line1 += mlIt->mergeEditLineList.size(); - } - - int nofLines = m_currentMergeLineIt->mergeEditLineList.size(); - int newFirstLine = getBestFirstLine( line1, nofLines, m_firstLine, getNofVisibleLines() ); - if ( newFirstLine != m_firstLine ) - { - scroll( 0, newFirstLine - m_firstLine ); - } - - if ( m_selection.isEmpty() ) - { - m_cursorXPos = 0; - m_cursorOldXPos = 0; - m_cursorYPos = line1; - } - - update(); - updateSourceMask(); - emit updateAvailabilities(); -} - -void MergeResultWindow::choose( int selector ) -{ - if ( m_currentMergeLineIt==m_mergeLineList.end() ) - return; - - setModified(); - - // First find range for which this change works. - MergeLine& ml = *m_currentMergeLineIt; - - MergeEditLineList::iterator melIt; - - // Now check if selector is active for this range already. - bool bActive = false; - - // Remove unneeded lines in the range. - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ) - { - MergeEditLine& mel = *melIt; - if ( mel.src()==selector ) - bActive = true; - - if ( mel.src()==selector || !mel.isEditableText() || mel.isModified() ) - melIt = ml.mergeEditLineList.erase( melIt ); - else - ++melIt; - } - - if ( !bActive ) // Selected source wasn't active. - { // Append the lines from selected source here at rangeEnd. - Diff3LineList::const_iterator d3llit=ml.id3l; - int j; - - for( j=0; jlineA : - mel.src()==2 ? mel.id3l()->lineB : - mel.src()==3 ? mel.id3l()->lineC : -1; - - if ( srcLine == -1 ) - melIt = ml.mergeEditLineList.erase( melIt ); - else - ++melIt; - } - } - - if ( ml.mergeEditLineList.empty() ) - { - // Insert a dummy line: - MergeEditLine mel(ml.id3l); - - if ( bActive ) mel.setConflict(); // All src entries deleted => conflict - else mel.setRemoved(selector); // No lines in corresponding src found. - - ml.mergeEditLineList.push_back(mel); - } - - if ( m_cursorYPos >= m_totalSize ) - { - m_cursorYPos = m_totalSize-1; - m_cursorXPos = 0; - } - - update(); - updateSourceMask(); - emit updateAvailabilities(); - int wsc; - int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); - m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); -} - -// bConflictsOnly: automatically choose for conflicts only (true) or for everywhere (false) -void MergeResultWindow::chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ) -{ - resetSelection(); - - merge( false, selector, bConflictsOnly, bWhiteSpaceOnly ); - emit modified(); - update(); - int wsc; - int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); - m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); -} - -void MergeResultWindow::slotAutoSolve() -{ - resetSelection(); - merge( true, -1 ); - emit modified(); - update(); - int wsc; - int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); - m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); -} - -void MergeResultWindow::slotUnsolve() -{ - resetSelection(); - merge( false, -1 ); - emit modified(); - update(); - int wsc; - int nofUnsolved = getNrOfUnsolvedConflicts(&wsc); - m_pStatusBar->message( i18n("Number of remaining unsolved conflicts: %1 (of which %2 are whitespace)") - .arg(nofUnsolved).arg(wsc) ); -} - - -static void findHistoryRange( bool bThreeFiles, const Diff3LineList* pD3LList, - Diff3LineList::const_iterator& iBegin, Diff3LineList::const_iterator& iEnd, int& idxBegin, int& idxEnd ) -{ - QRegExp historyStart(".*\\$Log.*\\$.*"); - QString historyLead; - // Search for start of history - for( iBegin = pD3LList->begin(), idxBegin=0; iBegin!=pD3LList->end(); ++iBegin, ++idxBegin ) - { - if ( historyStart.exactMatch( iBegin->getString(A) ) && - historyStart.exactMatch( iBegin->getString(B) ) && - ( !bThreeFiles || historyStart.exactMatch( iBegin->getString(C) ) ) ) - { - historyLead = iBegin->getString(A).section(' ', 0, 0, QString::SectionIncludeLeadingSep); - break; - } - } - // Search for end of history - for( iEnd = iBegin, idxEnd = idxBegin; iEnd!=pD3LList->end(); ++iEnd, ++idxEnd ) - { - QString sA = iEnd->getString(A); - QString sB = iEnd->getString(B); - QString sC = iEnd->getString(C); - if ( ! ((sA.isNull() || historyLead == sA.section(' ',0,0,QString::SectionIncludeLeadingSep)) && - (sB.isNull() || historyLead == sB.section(' ',0,0,QString::SectionIncludeLeadingSep)) && - (!bThreeFiles || sC.isNull() || historyLead == sC.section(' ',0,0,QString::SectionIncludeLeadingSep)) - )) - { - break; // End of the history - } - } -} - -bool findParenthesesGroups( const QString& s, QStringList& sl ) -{ - sl.clear(); - int i=0; - std::list startPosStack; - int length = s.length(); - for( i=0; i(int)parenthesesGroupList.size() ) - continue; - QString s = matchedRegExpr.cap( groupIdx ); - if ( groupIdx == 0 ) - { - key += s + " "; - continue; - } - - QString groupRegExp = parenthesesGroupList[groupIdx-1]; - if( groupRegExp.find('|')<0 || groupRegExp.find('(')>=0 ) - { - bool bOk = false; - int i = s.toInt( &bOk ); - if ( bOk && i>=0 && i<10000 ) - s.sprintf("%04d", i); // This should help for correct sorting of numbers. - key += s + " "; - } - else - { - // Assume that the groupRegExp consists of something like "Jan|Feb|Mar|Apr" - // s is the string that managed to match. - // Now we want to know at which position it occurred. e.g. Jan=0, Feb=1, Mar=2, etc. - QStringList sl = QStringList::split( '|', groupRegExp ); - int idx = sl.findIndex( s ); - if (idx<0) - { - // Didn't match - } - else - { - QString sIdx; - sIdx.sprintf("%02d", idx+1 ); // Up to 99 words in the groupRegExp (more than 12 aren't expected) - key += sIdx + " "; - } - } - } - return key; -} - -void MergeResultWindow::collectHistoryInformation( - int src, Diff3LineList::const_iterator iHistoryBegin, Diff3LineList::const_iterator iHistoryEnd, - HistoryMap& historyMap, - std::list< HistoryMap::iterator >& hitList // list of iterators - ) -{ - std::list< HistoryMap::iterator >::iterator itHitListFront = hitList.begin(); - Diff3LineList::const_iterator id3l = iHistoryBegin; - QString historyLead; - { - const LineData* pld = id3l->getLineData(src); - QString s( pld->pLine, pld->size ); - historyLead = s.section(' ',0,0,QString::SectionIncludeLeadingSep); - } - QRegExp historyStart( m_pOptionDialog->m_historyStartRegExp ); - ++id3l; // Skip line with "$Log ... $" - QRegExp newHistoryEntry( m_pOptionDialog->m_historyEntryStartRegExp ); - QStringList parenthesesGroups; - findParenthesesGroups( m_pOptionDialog->m_historyEntryStartRegExp, parenthesesGroups ); - QString key; - MergeEditLineList melList; - bool bPrevLineIsEmpty = true; - bool bUseRegExp = !m_pOptionDialog->m_historyEntryStartRegExp.isEmpty(); - for(; id3l != iHistoryEnd; ++id3l ) - { - const LineData* pld = id3l->getLineData(src); - if ( !pld ) continue; - QString s( pld->pLine, pld->size ); - if (historyLead.isNull()) historyLead = s.section(' ',0,0,QString::SectionIncludeLeadingSep); - QString sLine = s.mid(historyLead.length()); - if ( ( !bUseRegExp && !sLine.stripWhiteSpace().isEmpty() && bPrevLineIsEmpty ) - || bUseRegExp && newHistoryEntry.exactMatch( sLine ) - ) - { - if ( !key.isEmpty() && !melList.empty() ) - { - // Only insert new HistoryMapEntry if key not found; in either case p.first is a valid iterator to element key. - std::pair p = historyMap.insert(HistoryMap::value_type(key,HistoryMapEntry())); - HistoryMapEntry& hme = p.first->second; - if ( src==A ) hme.mellA = melList; - if ( src==B ) hme.mellB = melList; - if ( src==C ) hme.mellC = melList; - if ( p.second ) // Not in list yet? - { - hitList.insert( itHitListFront, p.first ); - } - } - - if ( ! bUseRegExp ) - key = sLine; - else - key = calcHistorySortKey(m_pOptionDialog->m_historyEntryStartSortKeyOrder,newHistoryEntry,parenthesesGroups); - - melList.clear(); - melList.push_back( MergeEditLine(id3l,src) ); - } - else if ( ! historyStart.exactMatch( s ) ) - { - melList.push_back( MergeEditLine(id3l,src) ); - } - - bPrevLineIsEmpty = sLine.stripWhiteSpace().isEmpty(); - } - if ( !key.isEmpty() ) - { - // Only insert new HistoryMapEntry if key not found; in either case p.first is a valid iterator to element key. - std::pair p = historyMap.insert(HistoryMap::value_type(key,HistoryMapEntry())); - HistoryMapEntry& hme = p.first->second; - if ( src==A ) hme.mellA = melList; - if ( src==B ) hme.mellB = melList; - if ( src==C ) hme.mellC = melList; - if ( p.second ) // Not in list yet? - { - hitList.insert( itHitListFront, p.first ); - } - } - // End of the history -} - -MergeResultWindow::MergeEditLineList& MergeResultWindow::HistoryMapEntry::choice( bool bThreeInputs ) -{ - if ( !bThreeInputs ) - return mellA.empty() ? mellB : mellA; - else - { - if ( mellA.empty() ) - return mellC.empty() ? mellB : mellC; // A doesn't exist, return one that exists - else if ( ! mellB.empty() && ! mellC.empty() ) - { // A, B and C exist - return mellA; - } - else - return mellB.empty() ? mellB : mellC; // A exists, return the one that doesn't exist - } -} - -bool MergeResultWindow::HistoryMapEntry::staysInPlace( bool bThreeInputs, Diff3LineList::const_iterator& iHistoryEnd ) -{ - // The entry should stay in place if the decision made by the automerger is correct. - Diff3LineList::const_iterator& iHistoryLast = iHistoryEnd; - --iHistoryLast; - if ( !bThreeInputs ) - { - if ( !mellA.empty() && !mellB.empty() && mellA.begin()->id3l()==mellB.begin()->id3l() && - mellA.back().id3l() == iHistoryLast && mellB.back().id3l() == iHistoryLast ) - { - iHistoryEnd = mellA.begin()->id3l(); - return true; - } - else - { - return false; - } - } - else - { - if ( !mellA.empty() && !mellB.empty() && !mellC.empty() - && mellA.begin()->id3l()==mellB.begin()->id3l() && mellA.begin()->id3l()==mellC.begin()->id3l() - && mellA.back().id3l() == iHistoryLast && mellB.back().id3l() == iHistoryLast && mellC.back().id3l() == iHistoryLast ) - { - iHistoryEnd = mellA.begin()->id3l(); - return true; - } - else - { - return false; - } - } -} - -void MergeResultWindow::slotMergeHistory() -{ - Diff3LineList::const_iterator iD3LHistoryBegin; - Diff3LineList::const_iterator iD3LHistoryEnd; - int d3lHistoryBeginLineIdx = -1; - int d3lHistoryEndLineIdx = -1; - - // Search for history start, history end in the diff3LineList - findHistoryRange( m_pldC!=0, m_pDiff3LineList, iD3LHistoryBegin, iD3LHistoryEnd, d3lHistoryBeginLineIdx, d3lHistoryEndLineIdx ); - - if ( iD3LHistoryBegin != m_pDiff3LineList->end() ) - { - // Now collect the historyMap information - HistoryMap historyMap; - std::list< HistoryMap::iterator > hitList; - if (m_pldC==0) - { - collectHistoryInformation( A, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); - collectHistoryInformation( B, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); - } - else - { - collectHistoryInformation( A, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); - collectHistoryInformation( B, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); - collectHistoryInformation( C, iD3LHistoryBegin, iD3LHistoryEnd, historyMap, hitList ); - } - - Diff3LineList::const_iterator iD3LHistoryOrigEnd = iD3LHistoryEnd; - - bool bHistoryMergeSorting = m_pOptionDialog->m_bHistoryMergeSorting && ! m_pOptionDialog->m_historyEntryStartSortKeyOrder.isEmpty() && - ! m_pOptionDialog->m_historyEntryStartRegExp.isEmpty(); - - // Remove parts from the historyMap and hitList that stay in place - if ( bHistoryMergeSorting ) - { - while ( ! historyMap.empty() ) - { - HistoryMap::iterator hMapIt = historyMap.begin(); - if( hMapIt->second.staysInPlace( m_pldC!=0, iD3LHistoryEnd ) ) - historyMap.erase(hMapIt); - else - break; - } - } - else - { - while ( ! hitList.empty() ) - { - HistoryMap::iterator hMapIt = hitList.back(); - if( hMapIt->second.staysInPlace( m_pldC!=0, iD3LHistoryEnd ) ) - hitList.pop_back(); - else - break; - } - } - while (iD3LHistoryOrigEnd != iD3LHistoryEnd) - { - --iD3LHistoryOrigEnd; - --d3lHistoryEndLineIdx; - } - - MergeLineList::iterator iMLLStart = splitAtDiff3LineIdx(d3lHistoryBeginLineIdx); - MergeLineList::iterator iMLLEnd = splitAtDiff3LineIdx(d3lHistoryEndLineIdx); - // Now join all MergeLines in the history - MergeLineList::iterator i = iMLLStart; - if ( i != iMLLEnd ) - { - ++i; - while ( i!=iMLLEnd ) - { - iMLLStart->join(*i); - i = m_mergeLineList.erase( i ); - } - } - iMLLStart->mergeEditLineList.clear(); - // Now insert the complete history into the first MergeLine of the history - iMLLStart->mergeEditLineList.push_back( MergeEditLine( iD3LHistoryBegin, m_pldC == 0 ? B : C ) ); - QString lead = iD3LHistoryBegin->getString(A).section(' ',0,0,QString::SectionIncludeLeadingSep); - MergeEditLine mel( m_pDiff3LineList->end() ); - mel.setString( lead ); - iMLLStart->mergeEditLineList.push_back(mel); - - if ( bHistoryMergeSorting ) - { - // Create a sorted history - HistoryMap::reverse_iterator hmit; - for ( hmit = historyMap.rbegin(); hmit != historyMap.rend(); ++hmit ) - { - HistoryMapEntry& hme = hmit->second; - MergeEditLineList& mell = hme.choice(m_pldC!=0); - if (!mell.empty()) - iMLLStart->mergeEditLineList.splice( iMLLStart->mergeEditLineList.end(), mell, mell.begin(), mell.end() ); - } - } - else - { - // Create history in order of appearance - std::list< HistoryMap::iterator >::iterator hlit; - for ( hlit = hitList.begin(); hlit != hitList.end(); ++hlit ) - { - HistoryMapEntry& hme = (*hlit)->second; - MergeEditLineList& mell = hme.choice(m_pldC!=0); - if (!mell.empty()) - iMLLStart->mergeEditLineList.splice( iMLLStart->mergeEditLineList.end(), mell, mell.begin(), mell.end() ); - } - } - setFastSelector( iMLLStart ); - update(); - } -} - -void MergeResultWindow::slotRegExpAutoMerge() -{ - if ( m_pOptionDialog->m_autoMergeRegExp.isEmpty() ) - return; - - QRegExp vcsKeywords( m_pOptionDialog->m_autoMergeRegExp ); - MergeLineList::iterator i; - for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) - { - if (i->bConflict ) - { - Diff3LineList::const_iterator id3l = i->id3l; - if ( vcsKeywords.exactMatch( id3l->getString(A) ) && - vcsKeywords.exactMatch( id3l->getString(B) ) && - (m_pldC==0 || vcsKeywords.exactMatch( id3l->getString(C) ))) - { - MergeEditLine& mel = *i->mergeEditLineList.begin(); - mel.setSource( m_pldC==0 ? B : C, false ); - splitAtDiff3LineIdx( i->d3lLineIdx+1 ); - } - } - } - update(); -} - -// This doesn't detect user modifications and should only be called after automatic merge -// This will only do something for three file merge. -// Irrelevant changes are those where all contributions from B are already contained in C. -// Also irrelevant are conflicts automatically solved (automerge regexp and history automerge) -// Precondition: The VCS-keyword would also be C. -bool MergeResultWindow::doRelevantChangesExist() -{ - if ( m_pldC==0 || m_mergeLineList.size() <= 1 ) - return true; - - MergeLineList::iterator i; - for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) - { - if ( ( i->bConflict && i->mergeEditLineList.begin()->src()!=C ) - || i->srcSelect == B ) - { - return true; - } - } - - return false; -} - -// Returns the iterator to the MergeLine after the split -MergeResultWindow::MergeLineList::iterator MergeResultWindow::splitAtDiff3LineIdx( int d3lLineIdx ) -{ - MergeLineList::iterator i; - for ( i = m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) - { - if ( i->d3lLineIdx==d3lLineIdx ) - { - // No split needed, this is the beginning of a MergeLine - return i; - } - else if ( i->d3lLineIdx > d3lLineIdx ) - { - // The split must be in the previous MergeLine - --i; - MergeLine& ml = *i; - MergeLine newML; - ml.split(newML,d3lLineIdx); - ++i; - return m_mergeLineList.insert( i, newML ); - } - } - // The split must be in the previous MergeLine - --i; - MergeLine& ml = *i; - MergeLine newML; - ml.split(newML,d3lLineIdx); - ++i; - return m_mergeLineList.insert( i, newML ); -} - -void MergeResultWindow::slotSplitDiff( int firstD3lLineIdx, int lastD3lLineIdx ) -{ - if (lastD3lLineIdx>=0) - splitAtDiff3LineIdx( lastD3lLineIdx + 1 ); - setFastSelector( splitAtDiff3LineIdx(firstD3lLineIdx) ); -} - -void MergeResultWindow::slotJoinDiffs( int firstD3lLineIdx, int lastD3lLineIdx ) -{ - MergeLineList::iterator i; - MergeLineList::iterator iMLLStart = m_mergeLineList.end(); - MergeLineList::iterator iMLLEnd = m_mergeLineList.end(); - for ( i=m_mergeLineList.begin(); i!=m_mergeLineList.end(); ++i ) - { - MergeLine& ml = *i; - if ( firstD3lLineIdx >= ml.d3lLineIdx && firstD3lLineIdx < ml.d3lLineIdx + ml.srcRangeLength ) - { - iMLLStart = i; - } - if ( lastD3lLineIdx >= ml.d3lLineIdx && lastD3lLineIdx < ml.d3lLineIdx + ml.srcRangeLength ) - { - iMLLEnd = i; - ++iMLLEnd; - break; - } - } - - bool bJoined = false; - for( i=iMLLStart; i!=iMLLEnd && i!=m_mergeLineList.end(); ) - { - if ( i==iMLLStart ) - { - ++i; - } - else - { - iMLLStart->join(*i); - i = m_mergeLineList.erase( i ); - bJoined = true; - } - } - if (bJoined) - { - iMLLStart->mergeEditLineList.clear(); - // Insert a conflict line as placeholder - iMLLStart->mergeEditLineList.push_back( MergeEditLine( iMLLStart->id3l ) ); - } - setFastSelector( iMLLStart ); -} - -void MergeResultWindow::myUpdate(int afterMilliSecs) -{ - killTimer(m_delayedDrawTimer); - m_bMyUpdate = true; - m_delayedDrawTimer = startTimer( afterMilliSecs ); -} - -void MergeResultWindow::timerEvent(QTimerEvent*) -{ - killTimer(m_delayedDrawTimer); - m_delayedDrawTimer = 0; - - if ( m_bMyUpdate ) - { - update(); - m_bMyUpdate = false; - } - - if ( m_scrollDeltaX != 0 || m_scrollDeltaY != 0 ) - { - m_selection.end( m_selection.lastLine + m_scrollDeltaY, m_selection.lastPos + m_scrollDeltaX ); - emit scroll( m_scrollDeltaX, m_scrollDeltaY ); - killTimer(m_delayedDrawTimer); - m_delayedDrawTimer = startTimer(50); - } -} - -QString MergeResultWindow::MergeEditLine::getString( const MergeResultWindow* mrw ) -{ - if ( isRemoved() ) { return QString(); } - - if ( ! isModified() ) - { - int src = m_src; - const Diff3Line& d3l = *m_id3l; - if ( src == 0 ) { return QString(); } - - const LineData* pld = 0; - assert( src == A || src == B || src == C ); - if ( src == A && d3l.lineA!=-1 ) pld = &mrw->m_pldA[ d3l.lineA ]; - else if ( src == B && d3l.lineB!=-1 ) pld = &mrw->m_pldB[ d3l.lineB ]; - else if ( src == C && d3l.lineC!=-1 ) pld = &mrw->m_pldC[ d3l.lineC ]; - - if ( pld == 0 ) - { - // assert(false); This is no error. - return QString(); - } - - return QString( pld->pLine, pld->size ); - } - else - { - return m_str; - } - return 0; -} - -/// Converts the cursor-posOnScreen into a text index, considering tabulators. -int convertToPosInText( const QString& s, int posOnScreen, int tabSize ) -{ - int localPosOnScreen = 0; - int size=s.length(); - for ( int i=0; i=posOnScreen ) - return i; - - // All letters except tabulator have width one. - int letterWidth = s[i]!='\t' ? 1 : tabber( localPosOnScreen, tabSize ); - - localPosOnScreen += letterWidth; - - if ( localPosOnScreen>posOnScreen ) - return i; - } - return size; -} - - -/// Converts the index into the text to a cursor-posOnScreen considering tabulators. -int convertToPosOnScreen( const QString& p, int posInText, int tabSize ) -{ - int posOnScreen = 0; - for ( int i=0; i height() ) - return; - - yOffset += topLineYOffset; - - QString srcName = " "; - if ( bUserModified ) srcName = "m"; - else if ( srcSelect == A && mergeDetails != eNoChange ) srcName = "A"; - else if ( srcSelect == B ) srcName = "B"; - else if ( srcSelect == C ) srcName = "C"; - - if ( rangeMark & 4 ) - { - p.fillRect( xOffset, yOffset, width(), fontHeight, m_pOptionDialog->m_currentRangeBgColor ); - } - - if( (srcSelect > 0 || bUserModified ) && !bLineRemoved ) - { - int outPos = 0; - QString s; - int size = str.length(); - for ( int i=0; im_tabSize ); - for( int j=0; jm_tabSize ),m_pOptionDialog->m_tabSize ); - int lastPosInLine = convertToPosOnScreen( str, convertToPosInText( str, m_selection.lastPosInLine(line), m_pOptionDialog->m_tabSize ), m_pOptionDialog->m_tabSize ); - int lengthInLine = max2(0,lastPosInLine - firstPosInLine); - if (lengthInLine>0) m_selection.bSelectionContainsData = true; - - if ( lengthInLine < int(s.length()) ) - { // Draw a normal line first - p.setPen( m_pOptionDialog->m_fgColor ); - p.drawText( xOffset, yOffset+fontAscent, s.mid(m_firstColumn), true ); - } - int firstPosInLine2 = max2( firstPosInLine, m_firstColumn ); - int lengthInLine2 = max2(0,lastPosInLine - firstPosInLine2); - - if( m_selection.lineWithin( line+1 ) ) - p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset, - width(), fontHeight, colorGroup().highlight() ); - else if ( lengthInLine2>0 ) - p.fillRect( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset, - fontWidth*lengthInLine2, fontHeight, colorGroup().highlight() ); - - p.setPen( colorGroup().highlightedText() ); - p.drawText( xOffset + fontWidth*(firstPosInLine2-m_firstColumn), yOffset+fontAscent, - s.mid(firstPosInLine2,lengthInLine2), true ); - } - else - { - p.setPen( m_pOptionDialog->m_fgColor ); - p.drawText( xOffset, yOffset+fontAscent, s.mid(m_firstColumn), true ); - } - - p.setPen( m_pOptionDialog->m_fgColor ); - if ( m_cursorYPos==line ) - { - m_cursorXPos = minMaxLimiter( m_cursorXPos, 0, outPos ); - m_cursorXPos = convertToPosOnScreen( str, convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ),m_pOptionDialog->m_tabSize ); - } - - p.drawText( 1, yOffset+fontAscent, srcName, true ); - } - else if ( bLineRemoved ) - { - p.setPen( m_pOptionDialog->m_colorForConflict ); - p.drawText( xOffset, yOffset+fontAscent, i18n("") ); - p.drawText( 1, yOffset+fontAscent, srcName ); - if ( m_cursorYPos==line ) m_cursorXPos = 0; - } - else if ( srcSelect == 0 ) - { - p.setPen( m_pOptionDialog->m_colorForConflict ); - if ( bWhiteSpaceConflict ) - p.drawText( xOffset, yOffset+fontAscent, i18n("") ); - else - p.drawText( xOffset, yOffset+fontAscent, i18n("") ); - p.drawText( 1, yOffset+fontAscent, "?" ); - if ( m_cursorYPos==line ) m_cursorXPos = 0; - } - else assert(false); - - xOffset -= fontWidth; - p.setPen( m_pOptionDialog->m_fgColor ); - if ( rangeMark & 1 ) // begin mark - { - p.drawLine( xOffset, yOffset+1, xOffset, yOffset+fontHeight/2 ); - p.drawLine( xOffset, yOffset+1, xOffset-2, yOffset+1 ); - } - else - { - p.drawLine( xOffset, yOffset, xOffset, yOffset+fontHeight/2 ); - } - - if ( rangeMark & 2 ) // end mark - { - p.drawLine( xOffset, yOffset+fontHeight/2, xOffset, yOffset+fontHeight-1 ); - p.drawLine( xOffset, yOffset+fontHeight-1, xOffset-2, yOffset+fontHeight-1 ); - } - else - { - p.drawLine( xOffset, yOffset+fontHeight/2, xOffset, yOffset+fontHeight ); - } - - if ( rangeMark & 4 ) - { - p.fillRect( xOffset + 3, yOffset, 3, fontHeight, m_pOptionDialog->m_fgColor ); -/* p.setPen( blue ); - p.drawLine( xOffset+2, yOffset, xOffset+2, yOffset+fontHeight-1 ); - p.drawLine( xOffset+3, yOffset, xOffset+3, yOffset+fontHeight-1 );*/ - } -} - -void MergeResultWindow::setPaintingAllowed(bool bPaintingAllowed) -{ - m_bPaintingAllowed = bPaintingAllowed; - if ( !m_bPaintingAllowed ) - { - m_currentMergeLineIt = m_mergeLineList.end(); - reset(); - } -} - -void MergeResultWindow::paintEvent( QPaintEvent* ) -{ - if (m_pDiff3LineList==0 || !m_bPaintingAllowed) return; - - bool bOldSelectionContainsData = m_selection.bSelectionContainsData; - const QFontMetrics& fm = fontMetrics(); - int fontHeight = fm.height(); - int fontWidth = fm.width("W"); - int fontAscent = fm.ascent(); - - if ( !m_bCursorUpdate ) // Don't redraw everything for blinking cursor? - { - m_selection.bSelectionContainsData = false; - if ( size() != m_pixmap.size() ) - m_pixmap.resize(size()); - - MyPainter p(&m_pixmap, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); - p.setFont( font() ); - p.QPainter::fillRect( rect(), m_pOptionDialog->m_bgColor ); - - //int visibleLines = height() / fontHeight; - - { // Draw the topline - QString s = " " +i18n("Output") + " : " + m_fileName + " "; - if (m_bModified) - s += i18n("[Modified]"); - - int topLineYOffset = fontHeight + 3; - - if (hasFocus()) - { - p.fillRect( 0, 0, width(), topLineYOffset, Qt::lightGray /*m_pOptionDialog->m_diffBgColor*/ ); - } - else - { - p.fillRect( 0, 0, width(), topLineYOffset, m_pOptionDialog->m_bgColor ); - } - p.setPen( m_pOptionDialog->m_fgColor ); - p.QPainter::drawText( 0, fontAscent+1, s ); - p.drawLine( 0, fontHeight + 2, width(), fontHeight + 2 ); - } - - int lastVisibleLine = m_firstLine + getNofVisibleLines() + 5; - int nofColumns = 0; - int line = 0; - MergeLineList::iterator mlIt = m_mergeLineList.begin(); - for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) - { - MergeLine& ml = *mlIt; - if ( line > lastVisibleLine || line + ml.mergeEditLineList.size() < m_firstLine) - { - line += ml.mergeEditLineList.size(); - } - else - { - MergeEditLineList::iterator melIt; - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) - { - if (line>=m_firstLine && line<=lastVisibleLine) - { - MergeEditLine& mel = *melIt; - MergeEditLineList::iterator melIt1 = melIt; - ++melIt1; - - int rangeMark = 0; - if ( melIt==ml.mergeEditLineList.begin() ) rangeMark |= 1; // Begin range mark - if ( melIt1==ml.mergeEditLineList.end() ) rangeMark |= 2; // End range mark - - if ( mlIt == m_currentMergeLineIt ) rangeMark |= 4; // Mark of the current line - - QString s; - s = mel.getString( this ); - if ( convertToPosOnScreen(s,s.length(),m_pOptionDialog->m_tabSize) >nofColumns) - nofColumns = s.length(); - - writeLine( p, line, s, mel.src(), ml.mergeDetails, rangeMark, - mel.isModified(), mel.isRemoved(), ml.bWhiteSpaceConflict ); - } - ++line; - } - } - } - - if ( line != m_nofLines || nofColumns != m_nofColumns ) - { - m_nofLines = line; - assert( m_nofLines == m_totalSize ); - - m_nofColumns = nofColumns; - emit resizeSignal(); - } - - p.end(); - } - - QPainter painter(this); - - int topLineYOffset = fontHeight + 3; - int xOffset = fontWidth * leftInfoWidth; - int yOffset = ( m_cursorYPos - m_firstLine ) * fontHeight + topLineYOffset; - int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset; - - if ( !m_bCursorUpdate ) - painter.drawPixmap(0,0, m_pixmap); - else - { - if (!m_pOptionDialog->m_bRightToLeftLanguage) - painter.drawPixmap(xCursor-2, yOffset, m_pixmap, - xCursor-2, yOffset, 5, fontAscent+2 ); - else - painter.drawPixmap(width()-1-4-(xCursor-2), yOffset, m_pixmap, - width()-1-4-(xCursor-2), yOffset, 5, fontAscent+2 ); - m_bCursorUpdate = false; - } - painter.end(); - - if ( m_bCursorOn && hasFocus() && m_cursorYPos>=m_firstLine ) - { - MyPainter painter(this, m_pOptionDialog->m_bRightToLeftLanguage, width(), fontWidth); - int topLineYOffset = fontHeight + 3; - int xOffset = fontWidth * leftInfoWidth; - - int yOffset = ( m_cursorYPos-m_firstLine ) * fontHeight + topLineYOffset; - - int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset; - - painter.setPen( m_pOptionDialog->m_fgColor ); - - painter.drawLine( xCursor, yOffset, xCursor, yOffset+fontAscent ); - painter.drawLine( xCursor-2, yOffset, xCursor+2, yOffset ); - painter.drawLine( xCursor-2, yOffset+fontAscent+1, xCursor+2, yOffset+fontAscent+1 ); - } - - if( !bOldSelectionContainsData && m_selection.bSelectionContainsData ) - emit newSelection(); -} - -void MergeResultWindow::updateSourceMask() -{ - int srcMask=0; - int enabledMask = 0; - if( !hasFocus() || m_pDiff3LineList==0 || !m_bPaintingAllowed || m_currentMergeLineIt == m_mergeLineList.end() ) - { - srcMask = 0; - enabledMask = 0; - } - else - { - enabledMask = m_pldC==0 ? 3 : 7; - MergeLine& ml = *m_currentMergeLineIt; - - srcMask = 0; - bool bModified = false; - MergeEditLineList::iterator melIt; - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) - { - MergeEditLine& mel = *melIt; - if ( mel.src()==1 ) srcMask |= 1; - if ( mel.src()==2 ) srcMask |= 2; - if ( mel.src()==3 ) srcMask |= 4; - if ( mel.isModified() || !mel.isEditableText() ) bModified = true; - } - - if ( ml.mergeDetails == eNoChange ) - { - srcMask = 0; - enabledMask = bModified ? 1 : 0; - } - } - - emit sourceMask( srcMask, enabledMask ); -} - -void MergeResultWindow::focusInEvent( QFocusEvent* e ) -{ - updateSourceMask(); - QWidget::focusInEvent(e); -} - -void MergeResultWindow::convertToLinePos( int x, int y, int& line, int& pos ) -{ - const QFontMetrics& fm = fontMetrics(); - int fontHeight = fm.height(); - int fontWidth = fm.width('W'); - int xOffset = (leftInfoWidth-m_firstColumn)*fontWidth; - int topLineYOffset = fontHeight + 3; - - int yOffset = topLineYOffset - m_firstLine * fontHeight; - - line = min2( ( y - yOffset ) / fontHeight, m_totalSize-1 ); - if ( ! m_pOptionDialog->m_bRightToLeftLanguage ) - pos = ( x - xOffset ) / fontWidth; - else - pos = ( (width() - 1 - x) - xOffset ) / fontWidth; -} - -void MergeResultWindow::mousePressEvent ( QMouseEvent* e ) -{ - m_bCursorOn = true; - - int line; - int pos; - convertToLinePos( e->x(), e->y(), line, pos ); - - bool bLMB = e->button() == Qt::LeftButton; - bool bMMB = e->button() == Qt::MidButton; - bool bRMB = e->button() == Qt::RightButton; - - if ( bLMB && pos < m_firstColumn || bRMB ) // Fast range selection - { - m_cursorXPos = 0; - m_cursorOldXPos = 0; - m_cursorYPos = max2(line,0); - int l = 0; - MergeLineList::iterator i = m_mergeLineList.begin(); - for(i = m_mergeLineList.begin();i!=m_mergeLineList.end(); ++i) - { - if (l==line) - break; - - l += i->mergeEditLineList.size(); - if (l>line) - break; - } - m_selection.reset(); // Disable current selection - - m_bCursorOn = true; - setFastSelector( i ); - - if (bRMB) - { - showPopupMenu( QCursor::pos() ); - } - } - else if ( bLMB ) // Normal cursor placement - { - pos = max2(pos,0); - line = max2(line,0); - if ( e->state() & Qt::ShiftModifier ) - { - if (m_selection.firstLine==-1) - m_selection.start( line, pos ); - m_selection.end( line, pos ); - } - else - { - // Selection - m_selection.reset(); - m_selection.start( line, pos ); - m_selection.end( line, pos ); - } - m_cursorXPos = pos; - m_cursorOldXPos = pos; - m_cursorYPos = line; - - update(); - //showStatusLine( line, m_winIdx, m_pFilename, m_pDiff3LineList, m_pStatusBar ); - } - else if ( bMMB ) // Paste clipboard - { - pos = max2(pos,0); - line = max2(line,0); - - m_selection.reset(); - m_cursorXPos = pos; - m_cursorOldXPos = pos; - m_cursorYPos = line; - - pasteClipboard( true ); - } -} - -void MergeResultWindow::mouseDoubleClickEvent( QMouseEvent* e ) -{ - if ( e->button() == Qt::LeftButton ) - { - int line; - int pos; - convertToLinePos( e->x(), e->y(), line, pos ); - m_cursorXPos = pos; - m_cursorOldXPos = pos; - m_cursorYPos = line; - - // Get the string data of the current line - - MergeLineList::iterator mlIt; - MergeEditLineList::iterator melIt; - calcIteratorFromLineNr( line, mlIt, melIt ); - QString s = melIt->getString( this ); - - if ( !s.isEmpty() ) - { - int pos1, pos2; - - calcTokenPos( s, pos, pos1, pos2, m_pOptionDialog->m_tabSize ); - - resetSelection(); - m_selection.start( line, convertToPosOnScreen( s, pos1, m_pOptionDialog->m_tabSize ) ); - m_selection.end( line, convertToPosOnScreen( s, pos2, m_pOptionDialog->m_tabSize ) ); - - update(); - // emit selectionEnd() happens in the mouseReleaseEvent. - } - } -} - -void MergeResultWindow::mouseReleaseEvent ( QMouseEvent * e ) -{ - if ( e->button() == Qt::LeftButton ) - { - killTimer(m_delayedDrawTimer); - m_delayedDrawTimer = 0; - - if (m_selection.firstLine != -1 ) - { - emit selectionEnd(); - } - } -} - -void MergeResultWindow::mouseMoveEvent ( QMouseEvent * e ) -{ - int line; - int pos; - convertToLinePos( e->x(), e->y(), line, pos ); - m_cursorXPos = pos; - m_cursorOldXPos = pos; - m_cursorYPos = line; - if (m_selection.firstLine != -1 ) - { - m_selection.end( line, pos ); - myUpdate(0); - - //showStatusLine( line, m_winIdx, m_pFilename, m_pDiff3LineList, m_pStatusBar ); - - // Scroll because mouse moved out of the window - const QFontMetrics& fm = fontMetrics(); - int fontHeight = fm.height(); - int fontWidth = fm.width('W'); - int topLineYOffset = fontHeight + 3; - int deltaX=0; - int deltaY=0; - if ( ! m_pOptionDialog->m_bRightToLeftLanguage ) - { - if ( e->x() < leftInfoWidth*fontWidth ) deltaX=-1; - if ( e->x() > width() ) deltaX=+1; - } - else - { - if ( e->x() > width()-1-leftInfoWidth*fontWidth ) deltaX=-1; - if ( e->x() < fontWidth ) deltaX=+1; - } - if ( e->y() < topLineYOffset ) deltaY=-1; - if ( e->y() > height() ) deltaY=+1; - m_scrollDeltaX = deltaX; - m_scrollDeltaY = deltaY; - if ( deltaX != 0 || deltaY!= 0) - { - emit scroll( deltaX, deltaY ); - } - } -} - - -void MergeResultWindow::slotCursorUpdate() -{ - m_cursorTimer.stop(); - m_bCursorOn = !m_bCursorOn; - - if ( isVisible() ) - { - m_bCursorUpdate = true; - - const QFontMetrics& fm = fontMetrics(); - int fontWidth = fm.width("W"); - int topLineYOffset = fm.height() + 3; - int xOffset = fontWidth * leftInfoWidth; - int yOffset = ( m_cursorYPos - m_firstLine ) * fm.height() + topLineYOffset; - int xCursor = ( m_cursorXPos - m_firstColumn ) * fontWidth + xOffset; - - if (!m_pOptionDialog->m_bRightToLeftLanguage) - repaint( xCursor-2, yOffset, 5, fm.ascent()+2 ); - else - repaint( width()-1-4-(xCursor-2), yOffset, 5, fm.ascent()+2 ); - - m_bCursorUpdate=false; - } - - m_cursorTimer.start(500,true); -} - - -void MergeResultWindow::wheelEvent( QWheelEvent* e ) -{ - int d = -e->delta()*QApplication::wheelScrollLines()/120; - e->accept(); - scroll( 0, min2(d, getNofVisibleLines()) ); -} - - -void MergeResultWindow::keyPressEvent( QKeyEvent* e ) -{ - int y = m_cursorYPos; - MergeLineList::iterator mlIt; - MergeEditLineList::iterator melIt; - calcIteratorFromLineNr( y, mlIt, melIt ); - - QString str = melIt->getString( this ); - int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ); - - bool bCtrl = ( e->state() & Qt::ControlModifier ) != 0 ; - bool bShift = ( e->state() & Qt::ShiftModifier ) != 0 ; - #ifdef _WIN32 - bool bAlt = ( e->state() & Qt::AltModifier ) != 0 ; - if ( bCtrl && bAlt ){ bCtrl=false; bAlt=false; } // AltGr-Key pressed. - #endif - - bool bYMoveKey = false; - // Special keys - switch ( e->key() ) - { - case Qt::Key_Escape: break; - //case Key_Tab: break; - case Qt::Key_Backtab: break; - case Qt::Key_Delete: - { - if ( deleteSelection2( str, x, y, mlIt, melIt )) break; - if( !melIt->isEditableText() ) break; - if (x>=(int)str.length()) - { - if ( yisEditableText() ) - { - QString s2 = melIt1->getString( this ); - melIt->setString( str + s2 ); - - // Remove the line - if ( mlIt1->mergeEditLineList.size()>1 ) - mlIt1->mergeEditLineList.erase( melIt1 ); - else - melIt1->setRemoved(); - } - } - } - else - { - QString s = str.left(x); - s += str.mid( x+1 ); - melIt->setString( s ); - setModified(); - } - break; - } - case Qt::Key_Backspace: - { - if ( deleteSelection2( str, x, y, mlIt, melIt )) break; - if( !melIt->isEditableText() ) break; - if (x==0) - { - if ( y>0 ) - { - setModified(); - MergeLineList::iterator mlIt1; - MergeEditLineList::iterator melIt1; - calcIteratorFromLineNr( y-1, mlIt1, melIt1 ); - if ( melIt1->isEditableText() ) - { - QString s1 = melIt1->getString( this ); - melIt1->setString( s1 + str ); - - // Remove the previous line - if ( mlIt->mergeEditLineList.size()>1 ) - mlIt->mergeEditLineList.erase( melIt ); - else - melIt->setRemoved(); - - --y; - x=str.length(); - } - } - } - else - { - QString s = str.left( x-1 ); - s += str.mid( x ); - --x; - melIt->setString( s ); - setModified(); - } - break; - } - case Qt::Key_Return: - case Qt::Key_Enter: - { - if( !melIt->isEditableText() ) break; - deleteSelection2( str, x, y, mlIt, melIt ); - setModified(); - QString indentation; - if ( m_pOptionDialog->m_bAutoIndentation ) - { // calc last indentation - MergeLineList::iterator mlIt1 = mlIt; - MergeEditLineList::iterator melIt1 = melIt; - for(;;) { - const QString s = melIt1->getString(this); - if ( !s.isEmpty() ) { - int i; - for( i=0; imergeEditLineList.end() ) { - --mlIt1; - if ( mlIt1 == m_mergeLineList.end() ) break; - melIt1 = mlIt1->mergeEditLineList.end(); - --melIt1; - } - } - } - MergeEditLine mel(mlIt->id3l); // Associate every mel with an id3l, even if not really valid. - mel.setString( indentation + str.mid(x) ); - - if ( x<(int)str.length() ) // Cut off the old line. - { - // Since ps possibly points into melIt->str, first copy it into a temporary. - QString temp = str.left(x); - melIt->setString( temp ); - } - - ++melIt; - mlIt->mergeEditLineList.insert( melIt, mel ); - x = indentation.length(); - ++y; - break; - } - case Qt::Key_Insert: m_bInsertMode = !m_bInsertMode; break; - case Qt::Key_Pause: break; - case Qt::Key_Print: break; - case Qt::Key_SysReq: break; - case Qt::Key_Home: x=0; if(bCtrl){y=0; } break; // cursor movement - case Qt::Key_End: x=INT_MAX; if(bCtrl){y=INT_MAX;} break; - - case Qt::Key_Left: - case Qt::Key_Right: - if ( (e->key()==Qt::Key_Left) ^ m_pOptionDialog->m_bRightToLeftLanguage ) // operator^: XOR - { - if ( !bCtrl ) - { - --x; - if(x<0 && y>0){--y; x=INT_MAX;} - } - else - { - while( x>0 && (str[x-1]==' ' || str[x-1]=='\t') ) --x; - while( x>0 && (str[x-1]!=' ' && str[x-1]!='\t') ) --x; - } - } - else - { - if ( !bCtrl ) - { - ++x; if(x>(int)str.length() && ytext(); - if( t.isEmpty() || bCtrl ) - { e->ignore(); return; } - else - { - if( bCtrl ) - { - e->ignore(); return; - } - else - { - if( !melIt->isEditableText() ) break; - deleteSelection2( str, x, y, mlIt, melIt ); - - setModified(); - // Characters to insert - QString s=str; - if ( t[0]=='\t' && m_pOptionDialog->m_bReplaceTabs ) - { - int spaces = (m_cursorXPos / m_pOptionDialog->m_tabSize + 1)*m_pOptionDialog->m_tabSize - m_cursorXPos; - t.fill( ' ', spaces ); - } - if ( m_bInsertMode ) - s.insert( x, t ); - else - s.replace( x, t.length(), t ); - - melIt->setString( s ); - x += t.length(); - bShift = false; - } - } - } - } - - y = minMaxLimiter( y, 0, m_totalSize-1 ); - - calcIteratorFromLineNr( y, mlIt, melIt ); - str = melIt->getString( this ); - - x = minMaxLimiter( x, 0, (int)str.length() ); - - int newFirstLine = m_firstLine; - int newFirstColumn = m_firstColumn; - - if ( y m_firstLine + getNofVisibleLines() ) - newFirstLine = y - getNofVisibleLines(); - - if (bYMoveKey) - x=convertToPosInText( str, m_cursorOldXPos, m_pOptionDialog->m_tabSize ); - - int xOnScreen = convertToPosOnScreen( str, x, m_pOptionDialog->m_tabSize ); - if ( xOnScreen m_firstColumn + getNofVisibleColumns() ) - newFirstColumn = xOnScreen - getNofVisibleColumns(); - - if ( bShift ) - { - if (m_selection.firstLine==-1) - m_selection.start( m_cursorYPos, m_cursorXPos ); - - m_selection.end( y, xOnScreen ); - } - else - m_selection.reset(); - - m_cursorYPos = y; - m_cursorXPos = xOnScreen; - if ( ! bYMoveKey ) - m_cursorOldXPos = m_cursorXPos; - - m_bCursorOn = false; - - if ( newFirstLine!=m_firstLine || newFirstColumn!=m_firstColumn ) - { - m_bCursorOn = true; - scroll( newFirstColumn-m_firstColumn, newFirstLine-m_firstLine ); - return; - } - - m_bCursorOn = true; - update(); -} - -void MergeResultWindow::calcIteratorFromLineNr( - int line, - MergeResultWindow::MergeLineList::iterator& mlIt, - MergeResultWindow::MergeEditLineList::iterator& melIt - ) -{ - for( mlIt = m_mergeLineList.begin(); mlIt!=m_mergeLineList.end(); ++mlIt) - { - MergeLine& ml = *mlIt; - if ( line > ml.mergeEditLineList.size() ) - { - line -= ml.mergeEditLineList.size(); - } - else - { - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) - { - --line; - if (line<0) return; - } - } - } - assert(false); -} - - -QString MergeResultWindow::getSelection() -{ - QString selectionString; - - int line = 0; - MergeLineList::iterator mlIt = m_mergeLineList.begin(); - for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) - { - MergeLine& ml = *mlIt; - MergeEditLineList::iterator melIt; - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) - { - MergeEditLine& mel = *melIt; - - if ( m_selection.lineWithin(line) ) - { - int outPos = 0; - if (mel.isEditableText()) - { - const QString str = mel.getString( this ); - - // Consider tabs - - for( int i=0; im_tabSize ); - } - - if( m_selection.within( line, outPos ) ) - { - selectionString += str[i]; - } - - outPos += spaces; - } - } - else if ( mel.isConflict() ) - { - selectionString += i18n(""); - } - - if( m_selection.within( line, outPos ) ) - { - #ifdef _WIN32 - selectionString += '\r'; - #endif - selectionString += '\n'; - } - } - - ++line; - } - } - - return selectionString; -} - -bool MergeResultWindow::deleteSelection2( QString& s, int& x, int& y, - MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt ) -{ - if (m_selection.firstLine!=-1 && m_selection.bSelectionContainsData ) - { - deleteSelection(); - y = m_cursorYPos; - calcIteratorFromLineNr( y, mlIt, melIt ); - s = melIt->getString( this ); - x = convertToPosInText( s, m_cursorXPos, m_pOptionDialog->m_tabSize ); - return true; - } - return false; -} - -void MergeResultWindow::deleteSelection() -{ - if ( m_selection.firstLine==-1 || !m_selection.bSelectionContainsData ) - { - return; - } - setModified(); - - int line = 0; - MergeLineList::iterator mlItFirst; - MergeEditLineList::iterator melItFirst; - QString firstLineString; - - int firstLine = -1; - int lastLine = -1; - - MergeLineList::iterator mlIt; - for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) - { - MergeLine& ml = *mlIt; - MergeEditLineList::iterator melIt; - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) - { - MergeEditLine& mel = *melIt; - - if ( mel.isEditableText() && m_selection.lineWithin(line) ) - { - if ( firstLine==-1 ) - firstLine = line; - lastLine = line; - } - - ++line; - } - } - - if ( firstLine == -1 ) - { - return; // Nothing to delete. - } - - line = 0; - for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) - { - MergeLine& ml = *mlIt; - MergeEditLineList::iterator melIt, melIt1; - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ) - { - MergeEditLine& mel = *melIt; - melIt1 = melIt; - ++melIt1; - - if ( mel.isEditableText() && m_selection.lineWithin(line) ) - { - QString lineString = mel.getString( this ); - - int firstPosInLine = m_selection.firstPosInLine(line); - int lastPosInLine = m_selection.lastPosInLine(line); - - if ( line==firstLine ) - { - mlItFirst = mlIt; - melItFirst = melIt; - int pos = convertToPosInText( lineString, firstPosInLine, m_pOptionDialog->m_tabSize ); - firstLineString = lineString.left( pos ); - } - - if ( line==lastLine ) - { - // This is the last line in the selection - int pos = convertToPosInText( lineString, lastPosInLine, m_pOptionDialog->m_tabSize ); - firstLineString += lineString.mid( pos ); // rest of line - melItFirst->setString( firstLineString ); - } - - if ( line!=firstLine ) - { - // Remove the line - if ( mlIt->mergeEditLineList.size()>1 ) - mlIt->mergeEditLineList.erase( melIt ); - else - melIt->setRemoved(); - } - } - - ++line; - melIt = melIt1; - } - } - - m_cursorYPos = m_selection.beginLine(); - m_cursorXPos = m_selection.beginPos(); - m_cursorOldXPos = m_cursorXPos; - - m_selection.reset(); -} - -void MergeResultWindow::pasteClipboard( bool bFromSelection ) -{ - if (m_selection.firstLine != -1 ) - deleteSelection(); - - setModified(); - - int y = m_cursorYPos; - MergeLineList::iterator mlIt; - MergeEditLineList::iterator melIt, melItAfter; - calcIteratorFromLineNr( y, mlIt, melIt ); - melItAfter = melIt; - ++melItAfter; - QString str = melIt->getString( this ); - int x = convertToPosInText( str, m_cursorXPos, m_pOptionDialog->m_tabSize ); - - if ( !QApplication::clipboard()->supportsSelection() ) - bFromSelection = false; - - QString clipBoard = QApplication::clipboard()->text( bFromSelection ? QClipboard::Selection : QClipboard::Clipboard ); - - QString currentLine = str.left(x); - QString endOfLine = str.mid(x); - int i; - int len = clipBoard.length(); - for( i=0; isetString( currentLine ); - MergeEditLine mel(mlIt->id3l); // Associate every mel with an id3l, even if not really valid. - melIt = mlIt->mergeEditLineList.insert( melItAfter, mel ); - currentLine = ""; - x=0; - ++y; - } - else - { - currentLine += c; - ++x; - } - } - - currentLine += endOfLine; - melIt->setString( currentLine ); - - m_cursorYPos = y; - m_cursorXPos = convertToPosOnScreen( currentLine, x, m_pOptionDialog->m_tabSize ); - m_cursorOldXPos = m_cursorXPos; - - update(); -} - -void MergeResultWindow::resetSelection() -{ - m_selection.reset(); - update(); -} - -void MergeResultWindow::setModified() -{ - if (!m_bModified) - { - m_bModified = true; - emit modified(); - } -} - -/// Saves and returns true when successful. -bool MergeResultWindow::saveDocument( const QString& fileName ) -{ - m_fileName = fileName; - - // Are still conflicts somewhere? - if ( getNrOfUnsolvedConflicts()>0 ) - { - KMessageBox::error( this, - i18n("Not all conflicts are solved yet.\n" - "File not saved.\n"), - i18n("Conflicts Left")); - return false; - } - - update(); - - FileAccess file( fileName, true /*bWantToWrite*/ ); - if ( m_pOptionDialog->m_bDmCreateBakFiles && file.exists() ) - { - bool bSuccess = file.createBackup(".orig"); - if ( !bSuccess ) - { - KMessageBox::error( this, file.getStatusText() + i18n("\n\nCreating backup failed. File not saved."), i18n("File Save Error") ); - return false; - } - } - - QByteArray dataArray; - QTextStream textOutStream(dataArray, QIODevice::WriteOnly); - textOutStream.setCodec( m_pOptionDialog->m_pEncodingOut ); - - int line = 0; - MergeLineList::iterator mlIt = m_mergeLineList.begin(); - for(mlIt = m_mergeLineList.begin();mlIt!=m_mergeLineList.end(); ++mlIt) - { - MergeLine& ml = *mlIt; - MergeEditLineList::iterator melIt; - for( melIt = ml.mergeEditLineList.begin(); melIt != ml.mergeEditLineList.end(); ++melIt ) - { - MergeEditLine& mel = *melIt; - - if ( mel.isEditableText() ) - { - QString str = mel.getString( this ); - - if (line>0) // Prepend line feed, but not for first line - { - if ( m_pOptionDialog->m_lineEndStyle == eLineEndDos ) - { str.prepend("\r\n"); } - else - { str.prepend("\n"); } - } - - textOutStream << str; - } - - ++line; - } - } - bool bSuccess = file.writeFile( dataArray.data(), dataArray.size() ); - if ( ! bSuccess ) - { - KMessageBox::error( this, i18n("Error while writing."), i18n("File Save Error") ); - return false; - } - - m_bModified = false; - update(); - - return true; -} - -QString MergeResultWindow::getString( int lineIdx ) -{ - MergeResultWindow::MergeLineList::iterator mlIt; - MergeResultWindow::MergeEditLineList::iterator melIt; - calcIteratorFromLineNr( lineIdx, mlIt, melIt ); - QString s = melIt->getString( this ); - return s; -} - -bool MergeResultWindow::findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ) -{ - int it = d3vLine; - int endIt = bDirDown ? getNofLines() : -1; - int step = bDirDown ? 1 : -1; - int startPos = posInLine; - - for( ; it!=endIt; it+=step ) - { - QString line = getString( it ); - if ( !line.isEmpty() ) - { - int pos = line.find( s, startPos, bCaseSensitive ); - if ( pos != -1 ) - { - d3vLine = it; - posInLine = pos; - return true; - } - - startPos = 0; - } - } - return false; -} - -void MergeResultWindow::setSelection( int firstLine, int startPos, int lastLine, int endPos ) -{ - if ( lastLine >= getNofLines() ) - { - lastLine = getNofLines()-1; - QString s = getString( lastLine ); - endPos = s.length(); - } - m_selection.reset(); - m_selection.start( firstLine, convertToPosOnScreen( getString(firstLine), startPos, m_pOptionDialog->m_tabSize ) ); - m_selection.end( lastLine, convertToPosOnScreen( getString(lastLine), endPos, m_pOptionDialog->m_tabSize ) ); - update(); -} - -Overview::Overview( QWidget* pParent, OptionDialog* pOptions ) -: QWidget( pParent, 0, Qt::WNoAutoErase ) -{ - m_pDiff3LineList = 0; - m_pOptions = pOptions; - m_bTripleDiff = false; - m_eOverviewMode = eOMNormal; - m_nofLines = 1; - m_bPaintingAllowed = false; - setFixedWidth(20); -} - -void Overview::init( Diff3LineList* pDiff3LineList, bool bTripleDiff ) -{ - m_pDiff3LineList = pDiff3LineList; - m_bTripleDiff = bTripleDiff; - m_pixmap.resize( QSize(0,0) ); // make sure that a redraw happens - update(); -} - -void Overview::reset() -{ - m_pDiff3LineList = 0; -} - -void Overview::slotRedraw() -{ - m_pixmap.resize( QSize(0,0) ); // make sure that a redraw happens - update(); -} - -void Overview::setRange( int firstLine, int pageHeight ) -{ - m_firstLine = firstLine; - m_pageHeight = pageHeight; - update(); -} -void Overview::setFirstLine( int firstLine ) -{ - m_firstLine = firstLine; - update(); -} - -void Overview::setOverviewMode( e_OverviewMode eOverviewMode ) -{ - m_eOverviewMode = eOverviewMode; - slotRedraw(); -} - -Overview::e_OverviewMode Overview::getOverviewMode() -{ - return m_eOverviewMode; -} - -void Overview::mousePressEvent( QMouseEvent* e ) -{ - int h = height()-1; - int h1 = h * m_pageHeight / max2(1,m_nofLines)+3; - if ( h>0 ) - emit setLine( ( e->y() - h1/2 )*m_nofLines/h ); -} - -void Overview::mouseMoveEvent( QMouseEvent* e ) -{ - mousePressEvent(e); -} - -void Overview::setPaintingAllowed( bool bAllowPainting ) -{ - if (m_bPaintingAllowed != bAllowPainting) - { - m_bPaintingAllowed = bAllowPainting; - if ( m_bPaintingAllowed ) update(); - else reset(); - } -} - -void Overview::drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ) -{ - p.setPen(Qt::black); - p.drawLine( x, 0, x, h ); - - if (nofLines==0) return; - - int line = 0; - int oldY = 0; - int oldConflictY = -1; - int wrapLineIdx=0; - Diff3LineList::const_iterator i; - for( i = m_pDiff3LineList->begin(); i!= m_pDiff3LineList->end(); ) - { - const Diff3Line& d3l = *i; - int y = h * (line+1) / nofLines; - e_MergeDetails md; - bool bConflict; - bool bLineRemoved; - int src; - mergeOneLine( d3l, md, bConflict, bLineRemoved, src, !m_bTripleDiff ); - - QColor c = m_pOptions->m_bgColor; - bool bWhiteSpaceChange = false; - //if( bConflict ) c=m_pOptions->m_colorForConflict; - //else - if ( eOverviewMode==eOMNormal ) - { - switch( md ) - { - case eDefault: - case eNoChange: - c = m_pOptions->m_bgColor; - break; - - case eBAdded: - case eBDeleted: - case eBChanged: - c = bConflict ? m_pOptions->m_colorForConflict : m_pOptions->m_colorB; - bWhiteSpaceChange = d3l.bAEqB || d3l.bWhiteLineA && d3l.bWhiteLineB; - break; - - case eCAdded: - case eCDeleted: - case eCChanged: - bWhiteSpaceChange = d3l.bAEqC || d3l.bWhiteLineA && d3l.bWhiteLineC; - c = bConflict ? m_pOptions->m_colorForConflict : m_pOptions->m_colorC; - break; - - case eBCChanged: // conflict - case eBCChangedAndEqual: // possible conflict - case eBCDeleted: // possible conflict - case eBChanged_CDeleted: // conflict - case eCChanged_BDeleted: // conflict - case eBCAdded: // conflict - case eBCAddedAndEqual: // possible conflict - c=m_pOptions->m_colorForConflict; - break; - default: assert(false); break; - } - } - else if ( eOverviewMode==eOMAvsB ) - { - switch( md ) - { - case eDefault: - case eNoChange: - case eCAdded: - case eCDeleted: - case eCChanged: break; - default: c = m_pOptions->m_colorForConflict; - bWhiteSpaceChange = d3l.bAEqB || d3l.bWhiteLineA && d3l.bWhiteLineB; - break; - } - } - else if ( eOverviewMode==eOMAvsC ) - { - switch( md ) - { - case eDefault: - case eNoChange: - case eBAdded: - case eBDeleted: - case eBChanged: break; - default: c = m_pOptions->m_colorForConflict; - bWhiteSpaceChange = d3l.bAEqC || d3l.bWhiteLineA && d3l.bWhiteLineC; - break; - } - } - else if ( eOverviewMode==eOMBvsC ) - { - switch( md ) - { - case eDefault: - case eNoChange: - case eBCChangedAndEqual: - case eBCDeleted: - case eBCAddedAndEqual: break; - default: c=m_pOptions->m_colorForConflict; - bWhiteSpaceChange = d3l.bBEqC || d3l.bWhiteLineB && d3l.bWhiteLineC; - break; - } - } - - if (!bWhiteSpaceChange || m_pOptions->m_bShowWhiteSpace ) - { - // Make sure that lines with conflict are not overwritten. - if ( c == m_pOptions->m_colorForConflict ) - { - p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) ); - oldConflictY = oldY; - } - else if ( c!=m_pOptions->m_bgColor && oldY>oldConflictY ) - { - p.fillRect(x+1, oldY, w, max2(1,y-oldY), bWhiteSpaceChange ? QBrush(c,Qt::Dense4Pattern) : QBrush(c) ); - } - } - - oldY = y; - - ++line; - if ( m_pOptions->m_bWordWrap ) - { - ++wrapLineIdx; - if(wrapLineIdx>=d3l.linesNeededForDisplay) - { - wrapLineIdx=0; - ++i; - } - } - else - { - ++i; - } - } -} - -void Overview::paintEvent( QPaintEvent* ) -{ - if (m_pDiff3LineList==0 || !m_bPaintingAllowed ) return; - int h = height()-1; - int w = width(); - - - if ( m_pixmap.size() != size() ) - { - if ( m_pOptions->m_bWordWrap ) - { - m_nofLines = 0; - Diff3LineList::const_iterator i; - for( i = m_pDiff3LineList->begin(); i!= m_pDiff3LineList->end(); ++i ) - { - m_nofLines += i->linesNeededForDisplay; - } - } - else - { - m_nofLines = m_pDiff3LineList->size(); - } - - m_pixmap.resize( size() ); - - QPainter p(&m_pixmap); - p.fillRect( rect(), m_pOptions->m_bgColor ); - - if ( !m_bTripleDiff || m_eOverviewMode == eOMNormal ) - { - drawColumn( p, eOMNormal, 0, w, h, m_nofLines ); - } - else - { - drawColumn( p, eOMNormal, 0, w/2, h, m_nofLines ); - drawColumn( p, m_eOverviewMode, w/2, w/2, h, m_nofLines ); - } - } - - QPainter painter( this ); - painter.drawPixmap( 0,0, m_pixmap ); - - int y1 = h * m_firstLine / m_nofLines-1; - int h1 = h * m_pageHeight / m_nofLines+3; - painter.setPen(Qt::black); - painter.drawRect( 1, y1, w-1, h1 ); -} - - -//#include "mergeresultwindow.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/mergeresultwindow.h --- a/kdiff3/src/mergeresultwindow.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,421 +0,0 @@ -/*************************************************************************** - mergeresultwindow.h - description - ------------------- - begin : Mon Mar 18 2002 - copyright : (C) 2002-2006 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef MERGERESULTWINDOW_H -#define MERGERESULTWINDOW_H - -#include "diff.h" - -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include - -class QPainter; - -class Overview : public QWidget -{ - Q_OBJECT -public: - Overview( QWidget* pParent, OptionDialog* pOptions ); - - void init( Diff3LineList* pDiff3LineList, bool bTripleDiff ); - void reset(); - void setRange( int firstLine, int pageHeight ); - void setPaintingAllowed( bool bAllowPainting ); - - enum e_OverviewMode { eOMNormal, eOMAvsB, eOMAvsC, eOMBvsC }; - void setOverviewMode( e_OverviewMode eOverviewMode ); - e_OverviewMode getOverviewMode(); - -public slots: - void setFirstLine(int firstLine); - void slotRedraw(); -signals: - void setLine(int); -private: - const Diff3LineList* m_pDiff3LineList; - OptionDialog* m_pOptions; - bool m_bTripleDiff; - int m_firstLine; - int m_pageHeight; - QPixmap m_pixmap; - bool m_bPaintingAllowed; - e_OverviewMode m_eOverviewMode; - int m_nofLines; - - virtual void paintEvent( QPaintEvent* e ); - virtual void mousePressEvent( QMouseEvent* e ); - virtual void mouseMoveEvent( QMouseEvent* e ); - void drawColumn( QPainter& p, e_OverviewMode eOverviewMode, int x, int w, int h, int nofLines ); -}; - - -enum e_MergeDetails -{ - eDefault, - eNoChange, - eBChanged, - eCChanged, - eBCChanged, // conflict - eBCChangedAndEqual, // possible conflict - eBDeleted, - eCDeleted, - eBCDeleted, // possible conflict - - eBChanged_CDeleted, // conflict - eCChanged_BDeleted, // conflict - eBAdded, - eCAdded, - eBCAdded, // conflict - eBCAddedAndEqual // possible conflict -}; - -void mergeOneLine( const Diff3Line& d, e_MergeDetails& mergeDetails, bool& bConflict, bool& bLineRemoved, int& src, bool bTwoInputs ); - -enum e_MergeSrcSelector -{ - A=1, - B=2, - C=3 -}; - -class MergeResultWindow : public QWidget -{ - Q_OBJECT -public: - MergeResultWindow( - QWidget* pParent, - OptionDialog* pOptionDialog, - QStatusBar* pStatusBar - ); - - void init( - const LineData* pLineDataA, int sizeA, - const LineData* pLineDataB, int sizeB, - const LineData* pLineDataC, int sizeC, - const Diff3LineList* pDiff3LineList, - TotalDiffStatus* pTotalDiffStatus, - QString fileName - ); - - void reset(); - - bool saveDocument( const QString& fileName ); - int getNrOfUnsolvedConflicts(int* pNrOfWhiteSpaceConflicts=0); - void choose(int selector); - void chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ); - - int getNofColumns(); - int getNofLines(); - int getNofVisibleColumns(); - int getNofVisibleLines(); - QString getSelection(); - void resetSelection(); - void showNrOfConflicts(); - bool isDeltaAboveCurrent(); - bool isDeltaBelowCurrent(); - bool isConflictAboveCurrent(); - bool isConflictBelowCurrent(); - bool isUnsolvedConflictAboveCurrent(); - bool isUnsolvedConflictBelowCurrent(); - bool findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); - void setSelection( int firstLine, int startPos, int lastLine, int endPos ); - void setOverviewMode( Overview::e_OverviewMode eOverviewMode ); - Overview::e_OverviewMode getOverviewMode(); -public slots: - void setFirstLine(int firstLine); - void setFirstColumn(int firstCol); - - void slotGoCurrent(); - void slotGoTop(); - void slotGoBottom(); - void slotGoPrevDelta(); - void slotGoNextDelta(); - void slotGoPrevUnsolvedConflict(); - void slotGoNextUnsolvedConflict(); - void slotGoPrevConflict(); - void slotGoNextConflict(); - void slotAutoSolve(); - void slotUnsolve(); - void slotMergeHistory(); - void slotRegExpAutoMerge(); - void slotSplitDiff( int firstD3lLineIdx, int lastD3lLineIdx ); - void slotJoinDiffs( int firstD3lLineIdx, int lastD3lLineIdx ); - void slotSetFastSelectorLine(int); - void setPaintingAllowed(bool); - void updateSourceMask(); - -signals: - void scroll( int deltaX, int deltaY ); - void modified(); - void setFastSelectorRange( int line1, int nofLines ); - void sourceMask( int srcMask, int enabledMask ); - void resizeSignal(); - void selectionEnd(); - void newSelection(); - void updateAvailabilities(); - void showPopupMenu( const QPoint& point ); - void noRelevantChangesDetected(); - -private: - void merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly=false, bool bWhiteSpaceOnly=false ); - QString getString( int lineIdx ); - - OptionDialog* m_pOptionDialog; - - const LineData* m_pldA; - const LineData* m_pldB; - const LineData* m_pldC; - int m_sizeA; - int m_sizeB; - int m_sizeC; - - const Diff3LineList* m_pDiff3LineList; - TotalDiffStatus* m_pTotalDiffStatus; - - bool m_bPaintingAllowed; - int m_delayedDrawTimer; - Overview::e_OverviewMode m_eOverviewMode; - -private: - class MergeEditLine - { - public: - MergeEditLine(Diff3LineList::const_iterator i, int src=0){m_id3l=i; m_src=src; m_bLineRemoved=false; } - void setConflict() { m_src=0; m_bLineRemoved=false; m_str=QString(); } - bool isConflict() { return m_src==0 && !m_bLineRemoved && m_str.isNull(); } - void setRemoved(int src=0) { m_src=src; m_bLineRemoved=true; m_str=QString(); } - bool isRemoved() { return m_bLineRemoved; } - bool isEditableText() { return !isConflict() && !isRemoved(); } - void setString( const QString& s ){ m_str=s; m_bLineRemoved=false; m_src=0; } - QString getString( const MergeResultWindow* ); - bool isModified() { return ! m_str.isNull() || (m_bLineRemoved && m_src==0); } - - void setSource( int src, bool bLineRemoved ) { m_src=src; m_bLineRemoved =bLineRemoved; } - int src() { return m_src; } - Diff3LineList::const_iterator id3l(){return m_id3l;} - // getString() is implemented as MergeResultWindow::getString() - private: - Diff3LineList::const_iterator m_id3l; - int m_src; // 1, 2 or 3 for A, B or C respectively, or 0 when line is from neither source. - QString m_str; // String when modified by user or null-string when orig data is used. - bool m_bLineRemoved; - }; - - class MergeEditLineList : private std::list - { // I want to know the size immediately! - private: - typedef std::list BASE; - int m_size; - int* m_pTotalSize; - public: - typedef std::list::iterator iterator; - typedef std::list::const_iterator const_iterator; - MergeEditLineList(){m_size=0; m_pTotalSize=0; } - void clear() { ds(-m_size); BASE::clear(); } - void push_back( const MergeEditLine& m) { ds(+1); BASE::push_back(m); } - void push_front( const MergeEditLine& m) { ds(+1); BASE::push_front(m); } - iterator erase( iterator i ) { ds(-1); return BASE::erase(i); } - iterator insert( iterator i, const MergeEditLine& m ) { ds(+1); return BASE::insert(i,m); } - int size(){ if (!m_pTotalSize) m_size = BASE::size(); return m_size; } - iterator begin(){return BASE::begin();} - iterator end(){return BASE::end();} - MergeEditLine& front(){return BASE::front();} - MergeEditLine& back(){return BASE::back();} - bool empty() { return m_size==0; } - void splice(iterator destPos, MergeEditLineList& srcList, iterator srcFirst, iterator srcLast) - { - int* pTotalSize = getTotalSizePtr() ? getTotalSizePtr() : srcList.getTotalSizePtr(); - srcList.setTotalSizePtr(0); // Force size-recalc after splice, because splice doesn't handle size-tracking - setTotalSizePtr(0); - BASE::splice( destPos, srcList, srcFirst, srcLast ); - srcList.setTotalSizePtr( pTotalSize ); - setTotalSizePtr( pTotalSize ); - } - - void setTotalSizePtr(int* pTotalSize) - { - if ( pTotalSize==0 && m_pTotalSize!=0 ) { *m_pTotalSize -= size(); } - else if ( pTotalSize!=0 && m_pTotalSize==0 ) { *pTotalSize += size(); } - m_pTotalSize = pTotalSize; - } - int* getTotalSizePtr() - { - return m_pTotalSize; - } - - private: - void ds(int deltaSize) - { - m_size+=deltaSize; - if (m_pTotalSize!=0) *m_pTotalSize+=deltaSize; - } - }; - - friend class MergeEditLine; - - struct MergeLine - { - MergeLine() - { - srcSelect=0; mergeDetails=eDefault; d3lLineIdx = -1; srcRangeLength=0; - bConflict=false; bDelta=false; bWhiteSpaceConflict=false; - } - Diff3LineList::const_iterator id3l; - int d3lLineIdx; // Needed to show the correct window pos. - int srcRangeLength; // how many src-lines have this properties - e_MergeDetails mergeDetails; - bool bConflict; - bool bWhiteSpaceConflict; - bool bDelta; - int srcSelect; - MergeEditLineList mergeEditLineList; - void split( MergeLine& ml2, int d3lLineIdx2 ) // The caller must insert the ml2 after this ml in the m_mergeLineList - { - if ( d3lLineIdx2= d3lLineIdx + srcRangeLength ) - return; //Error - ml2.mergeDetails = mergeDetails; - ml2.bConflict = bConflict; - ml2.bWhiteSpaceConflict = bWhiteSpaceConflict; - ml2.bDelta = bDelta; - ml2.srcSelect = srcSelect; - - ml2.d3lLineIdx = d3lLineIdx2; - ml2.srcRangeLength = srcRangeLength - (d3lLineIdx2-d3lLineIdx); - srcRangeLength = d3lLineIdx2-d3lLineIdx; // current MergeLine controls fewer lines - ml2.id3l = id3l; - for(int i=0; iid3l()==ml2.id3l) - { - ml2.mergeEditLineList.splice( ml2.mergeEditLineList.begin(), mergeEditLineList, i, mergeEditLineList.end() ); - return; - } - } - ml2.mergeEditLineList.setTotalSizePtr( mergeEditLineList.getTotalSizePtr() ); - ml2.mergeEditLineList.push_back(MergeEditLine(ml2.id3l)); - } - void join( MergeLine& ml2 ) // The caller must remove the ml2 from the m_mergeLineList after this call - { - srcRangeLength += ml2.srcRangeLength; - ml2.mergeEditLineList.clear(); - mergeEditLineList.clear(); - mergeEditLineList.push_back(MergeEditLine(id3l)); // Create a simple conflict - if ( ml2.bConflict ) bConflict = true; - if ( !ml2.bWhiteSpaceConflict ) bWhiteSpaceConflict = false; - if ( ml2.bDelta ) bDelta = true; - } - }; - -private: - static bool sameKindCheck( const MergeLine& ml1, const MergeLine& ml2 ); - struct HistoryMapEntry - { - MergeEditLineList mellA; - MergeEditLineList mellB; - MergeEditLineList mellC; - MergeEditLineList& choice( bool bThreeInputs ); - bool staysInPlace( bool bThreeInputs, Diff3LineList::const_iterator& iHistoryEnd ); - }; - typedef std::map HistoryMap; - void collectHistoryInformation( int src, Diff3LineList::const_iterator iHistoryBegin, Diff3LineList::const_iterator iHistoryEnd, HistoryMap& historyMap, std::list< HistoryMap::iterator >& hitList ); - - typedef std::list MergeLineList; - MergeLineList m_mergeLineList; - MergeLineList::iterator m_currentMergeLineIt; - int m_currentPos; - bool checkOverviewIgnore(MergeLineList::iterator &i); - - enum e_Direction { eUp, eDown }; - enum e_EndPoint { eDelta, eConflict, eUnsolvedConflict, eLine, eEnd }; - void go( e_Direction eDir, e_EndPoint eEndPoint ); - void calcIteratorFromLineNr( - int line, - MergeLineList::iterator& mlIt, - MergeEditLineList::iterator& melIt - ); - MergeLineList::iterator splitAtDiff3LineIdx( int d3lLineIdx ); - - virtual void paintEvent( QPaintEvent* e ); - - - void myUpdate(int afterMilliSecs); - virtual void timerEvent(QTimerEvent*); - void writeLine( - MyPainter& p, int line, const QString& str, - int srcSelect, e_MergeDetails mergeDetails, int rangeMark, bool bUserModified, bool bLineRemoved, bool bWhiteSpaceConflict - ); - void setFastSelector(MergeLineList::iterator i); - void convertToLinePos( int x, int y, int& line, int& pos ); - virtual void mousePressEvent ( QMouseEvent* e ); - virtual void mouseDoubleClickEvent ( QMouseEvent* e ); - virtual void mouseReleaseEvent ( QMouseEvent * ); - virtual void mouseMoveEvent ( QMouseEvent * ); - virtual void resizeEvent( QResizeEvent* e ); - virtual void keyPressEvent( QKeyEvent* e ); - virtual void wheelEvent( QWheelEvent* e ); - virtual void focusInEvent( QFocusEvent* e ); - - QPixmap m_pixmap; - int m_firstLine; - int m_firstColumn; - int m_nofColumns; - int m_nofLines; - int m_totalSize; //Same as m_nofLines, but calculated differently - bool m_bMyUpdate; - bool m_bInsertMode; - QString m_fileName; - bool m_bModified; - void setModified(); - - int m_scrollDeltaX; - int m_scrollDeltaY; - int m_cursorXPos; - int m_cursorYPos; - int m_cursorOldXPos; - bool m_bCursorOn; // blinking on and off each second - QTimer m_cursorTimer; - bool m_bCursorUpdate; - QStatusBar* m_pStatusBar; - - Selection m_selection; - - bool deleteSelection2( QString& str, int& x, int& y, - MergeLineList::iterator& mlIt, MergeEditLineList::iterator& melIt ); - bool doRelevantChangesExist(); -public slots: - void deleteSelection(); - void pasteClipboard(bool bFromSelection); -private slots: - void slotCursorUpdate(); -}; - -#endif - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/optiondialog.cpp --- a/kdiff3/src/optiondialog.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1575 +0,0 @@ -/* - * kdiff3 - Text Diff And Merge Tool - * Copyright (C) 2002-2006 Joachim Eibl, joachim.eibl at gmx.de - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include - -#include -#include -#include // For KFontChooser -#include -#include -#include -#include -#include //For ktoolbar.h - -//#include -#include - -#include "optiondialog.h" -#include "diff.h" -#include "smalldialogs.h" - -#include - -#ifndef KREPLACEMENTS_H -#include -#endif - -static QString s_historyEntryStartRegExpToolTip; -static QString s_historyEntryStartSortKeyOrderToolTip; -static QString s_autoMergeRegExpToolTip; -static QString s_historyStartRegExpToolTip; - -void OptionDialog::addOptionItem(OptionItem* p) -{ - m_optionItemList.push_back(p); -} - -class OptionItem -{ -public: - OptionItem( OptionDialog* pOptionDialog, const QString& saveName ) - { - assert(pOptionDialog!=0); - pOptionDialog->addOptionItem( this ); - m_saveName = saveName; - } - virtual ~OptionItem(){} - virtual void setToDefault()=0; - virtual void setToCurrent()=0; - virtual void apply()=0; - virtual void write(ValueMap*)=0; - virtual void read(ValueMap*)=0; - QString getSaveName(){return m_saveName;} -protected: - QString m_saveName; -}; - -class OptionCheckBox : public QCheckBox, public OptionItem -{ -public: - OptionCheckBox( QString text, bool bDefaultVal, const QString& saveName, bool* pbVar, - QWidget* pParent, OptionDialog* pOD ) - : QCheckBox( text, pParent ), OptionItem( pOD, saveName ) - { - m_pbVar = pbVar; - m_bDefaultVal = bDefaultVal; - } - void setToDefault(){ setChecked( m_bDefaultVal ); } - void setToCurrent(){ setChecked( *m_pbVar ); } - void apply() { *m_pbVar = isChecked(); } - void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pbVar ); } - void read (ValueMap* config){ *m_pbVar = config->readBoolEntry( m_saveName, *m_pbVar ); } -private: - OptionCheckBox( const OptionCheckBox& ); // private copy constructor without implementation - bool* m_pbVar; - bool m_bDefaultVal; -}; - -class OptionRadioButton : public QRadioButton, public OptionItem -{ -public: - OptionRadioButton( QString text, bool bDefaultVal, const QString& saveName, bool* pbVar, - QWidget* pParent, OptionDialog* pOD ) - : QRadioButton( text, pParent ), OptionItem( pOD, saveName ) - { - m_pbVar = pbVar; - m_bDefaultVal = bDefaultVal; - } - void setToDefault(){ setChecked( m_bDefaultVal ); } - void setToCurrent(){ setChecked( *m_pbVar ); } - void apply() { *m_pbVar = isChecked(); } - void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pbVar ); } - void read (ValueMap* config){ *m_pbVar = config->readBoolEntry( m_saveName, *m_pbVar ); } -private: - OptionRadioButton( const OptionRadioButton& ); // private copy constructor without implementation - bool* m_pbVar; - bool m_bDefaultVal; -}; - - -template -class OptionT : public OptionItem -{ -public: - OptionT( const T& defaultVal, const QString& saveName, T* pVar, OptionDialog* pOD ) - : OptionItem( pOD, saveName ) - { - m_pVar = pVar; - *m_pVar = defaultVal; - } - OptionT( const QString& saveName, T* pVar, OptionDialog* pOD ) - : OptionItem( pOD, saveName ) - { - m_pVar = pVar; - } - void setToDefault(){} - void setToCurrent(){} - void apply() {} - void write(ValueMap* vm){ writeEntry( vm, m_saveName, *m_pVar ); } - void read (ValueMap* vm){ readEntry ( vm, m_saveName, *m_pVar ); } -private: - OptionT( const OptionT& ); // private copy constructor without implementation - T* m_pVar; -}; - -template void writeEntry(ValueMap* vm, const QString& saveName, const T& v ) { vm->writeEntry( saveName, v ); } -static void writeEntry(ValueMap* vm, const QString& saveName, const QStringList& v ) { vm->writeEntry( saveName, v, '|' ); } - -static void readEntry(ValueMap* vm, const QString& saveName, bool& v ) { v = vm->readBoolEntry( saveName, v ); } -static void readEntry(ValueMap* vm, const QString& saveName, int& v ) { v = vm->readNumEntry( saveName, v ); } -static void readEntry(ValueMap* vm, const QString& saveName, QSize& v ) { v = vm->readSizeEntry( saveName, &v ); } -static void readEntry(ValueMap* vm, const QString& saveName, QPoint& v ) { v = vm->readPointEntry( saveName, &v ); } -static void readEntry(ValueMap* vm, const QString& saveName, QStringList& v ){ v = vm->readListEntry( saveName, QStringList(), '|' ); } - -typedef OptionT OptionToggleAction; -typedef OptionT OptionNum; -typedef OptionT OptionPoint; -typedef OptionT OptionSize; -typedef OptionT OptionStringList; - -class OptionFontChooser : public KFontChooser, public OptionItem -{ -public: - OptionFontChooser( const QFont& defaultVal, const QString& saveName, QFont* pbVar, QWidget* pParent, OptionDialog* pOD ) - :KFontChooser( pParent,"font",true/*onlyFixed*/,QStringList(),false,6 ), - OptionItem( pOD, saveName ) - { - m_pbVar = pbVar; - *m_pbVar = defaultVal; - m_default = defaultVal; - } - void setToDefault(){ setFont( m_default, true /*only fixed*/ ); } - void setToCurrent(){ setFont( *m_pbVar, true /*only fixed*/ ); } - void apply() { *m_pbVar = font();} - void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pbVar ); } - void read (ValueMap* config){ *m_pbVar = config->readFontEntry( m_saveName, m_pbVar ); } -private: - OptionFontChooser( const OptionToggleAction& ); // private copy constructor without implementation - QFont* m_pbVar; - QFont m_default; -}; - -class OptionColorButton : public KColorButton, public OptionItem -{ -public: - OptionColorButton( QColor defaultVal, const QString& saveName, QColor* pVar, QWidget* pParent, OptionDialog* pOD ) - : KColorButton( pParent ), OptionItem( pOD, saveName ) - { - m_pVar = pVar; - m_defaultVal = defaultVal; - } - void setToDefault(){ setColor( m_defaultVal ); } - void setToCurrent(){ setColor( *m_pVar ); } - void apply() { *m_pVar = color(); } - void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pVar ); } - void read (ValueMap* config){ *m_pVar = config->readColorEntry( m_saveName, m_pVar ); } -private: - OptionColorButton( const OptionColorButton& ); // private copy constructor without implementation - QColor* m_pVar; - QColor m_defaultVal; -}; - -class OptionLineEdit : public QComboBox, public OptionItem -{ -public: - OptionLineEdit( const QString& defaultVal, const QString& saveName, QString* pVar, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) - { - setMinimumWidth(50); - setEditable(true); - m_pVar = pVar; - m_defaultVal = defaultVal; - m_list.push_back(defaultVal); - insertText(); - } - void setToDefault(){ setCurrentText( m_defaultVal ); } - void setToCurrent(){ setCurrentText( *m_pVar ); } - 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, QStringList(m_defaultVal), '|' ); - if ( !m_list.empty() ) *m_pVar = m_list.front(); - clear(); - insertStringList(m_list); - } -private: - void insertText() - { // Check if the text exists. If yes remove it and push it in as first element - QString current = currentText(); - m_list.remove( current ); - m_list.push_front( current ); - clear(); - if ( m_list.size()>10 ) - m_list.erase( m_list.begin()+10, m_list.end() ); - insertStringList(m_list); - } - OptionLineEdit( const OptionLineEdit& ); // private copy constructor without implementation - QString* m_pVar; - QString m_defaultVal; - QStringList m_list; -}; - -#if defined QT_NO_VALIDATOR -#error No validator -#endif -class OptionIntEdit : public QLineEdit, public OptionItem -{ -public: - OptionIntEdit( int defaultVal, const QString& saveName, int* pVar, int rangeMin, int rangeMax, - QWidget* pParent, OptionDialog* pOD ) - : QLineEdit( pParent ), OptionItem( pOD, saveName ) - { - m_pVar = pVar; - m_defaultVal = defaultVal; - QIntValidator* v = new QIntValidator(this); - v->setRange( rangeMin, rangeMax ); - setValidator( v ); - } - void setToDefault(){ QString s; s.setNum(m_defaultVal); setText( s ); } - void setToCurrent(){ QString s; s.setNum(*m_pVar); setText( s ); } - void apply() { const QIntValidator* v=static_cast(validator()); - *m_pVar = minMaxLimiter( text().toInt(), v->bottom(), v->top()); - setText( QString::number(*m_pVar) ); } - void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pVar ); } - void read (ValueMap* config){ *m_pVar = config->readNumEntry( m_saveName, *m_pVar ); } -private: - OptionIntEdit( const OptionIntEdit& ); // private copy constructor without implementation - int* m_pVar; - int m_defaultVal; -}; - -class OptionComboBox : public QComboBox, public OptionItem -{ -public: - OptionComboBox( int defaultVal, const QString& saveName, int* pVarNum, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) - { - setMinimumWidth(50); - m_pVarNum = pVarNum; - m_pVarStr = 0; - m_defaultVal = defaultVal; - setEditable(false); - } - OptionComboBox( int defaultVal, const QString& saveName, QString* pVarStr, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) - { - m_pVarNum = 0; - m_pVarStr = pVarStr; - m_defaultVal = defaultVal; - setEditable(false); - } - void setToDefault() - { - setCurrentItem( m_defaultVal ); - if (m_pVarStr!=0){ *m_pVarStr=currentText(); } - } - void setToCurrent() - { - if (m_pVarNum!=0) setCurrentItem( *m_pVarNum ); - else setText( *m_pVarStr ); - } - void apply() - { - if (m_pVarNum!=0){ *m_pVarNum = currentItem(); } - else { *m_pVarStr = currentText(); } - } - void write(ValueMap* config) - { - if (m_pVarStr!=0) config->writeEntry(m_saveName, *m_pVarStr ); - else config->writeEntry(m_saveName, *m_pVarNum ); - } - void read (ValueMap* config) - { - if (m_pVarStr!=0) setText( config->readEntry( m_saveName, currentText() ) ); - else *m_pVarNum = config->readNumEntry( m_saveName, *m_pVarNum ); - } -private: - OptionComboBox( const OptionIntEdit& ); // private copy constructor without implementation - int* m_pVarNum; - QString* m_pVarStr; - int m_defaultVal; - - void setText(const QString& s) - { - // Find the string in the combobox-list, don't change the value if nothing fits. - for( int i=0; i m_codecVec; - QTextCodec** m_ppVarCodec; -public: - OptionEncodingComboBox( const QString& saveName, QTextCodec** ppVarCodec, - QWidget* pParent, OptionDialog* pOD ) - : QComboBox( pParent ), OptionItem( pOD, saveName ) - { - m_ppVarCodec = ppVarCodec; - insertCodec( i18n("Unicode, 8 bit"), QTextCodec::codecForName("UTF-8") ); - insertCodec( i18n("Unicode"), QTextCodec::codecForName("iso-10646-UCS-2") ); - insertCodec( i18n("Latin1"), QTextCodec::codecForName("iso 8859-1") ); - - // First sort codec names: - std::map names; - QList mibs = QTextCodec::availableMibs(); - foreach(int i, mibs) - { - QTextCodec* c = QTextCodec::codecForMib(i); - if ( c==0 ) break; - else names[QString(c->name()).upper()]=c; - } - - std::map::iterator it; - for(it=names.begin();it!=names.end();++it) - { - insertCodec( "", it->second ); - } - - QToolTip::add( this, i18n( - "Change this if non-ASCII characters are not displayed correctly." - )); - } - void insertCodec( const QString& visibleCodecName, QTextCodec* c ) - { - if (c!=0) - { - for( unsigned int i=0; iname()) : visibleCodecName+" ("+c->name()+")", m_codecVec.size() ); - m_codecVec.push_back( c ); - } - } - void setToDefault() - { - QString defaultName = QTextCodec::codecForLocale()->name(); - for(int i=0;iwriteEntry(m_saveName, QString((*m_ppVarCodec)->name()) ); - } - void read (ValueMap* config) - { - QString codecName = config->readEntry( m_saveName, m_codecVec[ currentItem() ]->name() ); - for(unsigned int i=0; iname() ) - { - setCurrentItem( i ); - if (m_ppVarCodec!=0) *m_ppVarCodec = m_codecVec[i]; - break; - } - } - } -}; - - -OptionDialog::OptionDialog( bool bShowDirMergeSettings, QWidget *parent, char *name ) - :KDialogBase( IconList, i18n("Configure"), Help|Default|Apply|Ok|Cancel, - Ok, parent, name, true /*modal*/, true ) -{ - setHelp( "kdiff3/index.html", QString::null ); - - setupFontPage(); - setupColorPage(); - setupEditPage(); - setupDiffPage(); - setupOtherOptions(); - if (bShowDirMergeSettings) - setupDirectoryMergePage(); - - setupRegionalPage(); - setupIntegrationPage(); - - //setupKeysPage(); - - // Initialize all values in the dialog - resetToDefaults(); - slotApply(); -} - -OptionDialog::~OptionDialog( void ) -{ -} - -void OptionDialog::setupOtherOptions() -{ - new OptionToggleAction( false, "AutoAdvance", &m_bAutoAdvance, this ); - new OptionToggleAction( true, "ShowWhiteSpaceCharacters", &m_bShowWhiteSpaceCharacters, this ); - new OptionToggleAction( true, "ShowWhiteSpace", &m_bShowWhiteSpace, this ); - new OptionToggleAction( false, "ShowLineNumbers", &m_bShowLineNumbers, this ); - new OptionToggleAction( true, "HorizDiffWindowSplitting", &m_bHorizDiffWindowSplitting, this ); - new OptionToggleAction( false, "WordWrap", &m_bWordWrap, this ); - - new OptionToggleAction( true, "ShowIdenticalFiles", &m_bDmShowIdenticalFiles, this ); - - new OptionToggleAction( true, "Show Toolbar", &m_bShowToolBar, this ); - new OptionToggleAction( true, "Show Statusbar", &m_bShowStatusBar, this ); - - new OptionNum( (int)KToolBar::Top, "ToolBarPos", &m_toolBarPos, this ); - new OptionSize( QSize(600,400),"Geometry", &m_geometry, this ); - new OptionPoint( QPoint(0,22), "Position", &m_position, this ); - - new OptionStringList( "RecentAFiles", &m_recentAFiles, this ); - new OptionStringList( "RecentBFiles", &m_recentBFiles, this ); - new OptionStringList( "RecentCFiles", &m_recentCFiles, this ); - new OptionStringList( "RecentOutputFiles", &m_recentOutputFiles, this ); -} - -void OptionDialog::setupFontPage( void ) -{ - QFrame *page = addPage( i18n("Font"), i18n("Editor & Diff Output Font" ), - BarIcon("fonts", KIcon::SizeMedium ) ); - - Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - - QFont defaultFont = -#ifdef _WIN32 - QFont("Courier New", 10 ); -#elif defined( KREPLACEMENTS_H ) - QFont("Courier", 10 ); -#else - KGlobalSettings::fixedFont(); -#endif - - OptionFontChooser* pFontChooser = new OptionFontChooser( defaultFont, "Font", &m_font, page, this ); - topLayout->addWidget( pFontChooser ); - - Q3GridLayout *gbox = new Q3GridLayout( 1, 2 ); - topLayout->addLayout( gbox ); - int line=0; - - OptionCheckBox* pItalicDeltas = new OptionCheckBox( i18n("Italic font for deltas"), false, "ItalicForDeltas", &m_bItalicForDeltas, page, this ); - gbox->addMultiCellWidget( pItalicDeltas, line, line, 0, 1 ); - QToolTip::add( pItalicDeltas, i18n( - "Selects the italic version of the font for differences.\n" - "If the font doesn't support italic characters, then this does nothing.") - ); -} - - -void OptionDialog::setupColorPage( void ) -{ - QFrame *page = addPage( i18n("Color"), i18n("Colors Settings"), - BarIcon("colorize", KIcon::SizeMedium ) ); - Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - - Q3GridLayout *gbox = new Q3GridLayout( 7, 2 ); - gbox->setColStretch(1,5); - topLayout->addLayout(gbox); - - QLabel* label; - int line = 0; - - int depth = QPixmap::defaultDepth(); - bool bLowColor = depth<=8; - - label = new QLabel( i18n("Editor and Diff Views:"), page ); - gbox->addWidget( label, line, 0 ); - QFont f( label->font() ); - f.setBold(true); - label->setFont(f); - ++line; - - OptionColorButton* pFgColor = new OptionColorButton( Qt::black,"FgColor", &m_fgColor, page, this ); - label = new QLabel( pFgColor, i18n("Foreground color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pFgColor, line, 1 ); - ++line; - - OptionColorButton* pBgColor = new OptionColorButton( Qt::white, "BgColor", &m_bgColor, page, this ); - label = new QLabel( pBgColor, i18n("Background color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pBgColor, line, 1 ); - - ++line; - - OptionColorButton* pDiffBgColor = new OptionColorButton( - bLowColor ? Qt::lightGray : qRgb(224,224,224), "DiffBgColor", &m_diffBgColor, page, this ); - label = new QLabel( pDiffBgColor, i18n("Diff background color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pDiffBgColor, line, 1 ); - ++line; - - OptionColorButton* pColorA = new OptionColorButton( - bLowColor ? qRgb(0,0,255) : qRgb(0,0,200)/*blue*/, "ColorA", &m_colorA, page, this ); - label = new QLabel( pColorA, i18n("Color A:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColorA, line, 1 ); - ++line; - - OptionColorButton* pColorB = new OptionColorButton( - bLowColor ? qRgb(0,128,0) : qRgb(0,150,0)/*green*/, "ColorB", &m_colorB, page, this ); - label = new QLabel( pColorB, i18n("Color B:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColorB, line, 1 ); - ++line; - - OptionColorButton* pColorC = new OptionColorButton( - bLowColor ? qRgb(128,0,128) : qRgb(150,0,150)/*magenta*/, "ColorC", &m_colorC, page, this ); - label = new QLabel( pColorC, i18n("Color C:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColorC, line, 1 ); - ++line; - - OptionColorButton* pColorForConflict = new OptionColorButton( Qt::red, "ColorForConflict", &m_colorForConflict, page, this ); - label = new QLabel( pColorForConflict, i18n("Conflict color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColorForConflict, line, 1 ); - ++line; - - OptionColorButton* pColor = new OptionColorButton( - bLowColor ? qRgb(192,192,192) : qRgb(220,220,100), "CurrentRangeBgColor", &m_currentRangeBgColor, page, this ); - label = new QLabel( pColor, i18n("Current range background color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColor, line, 1 ); - ++line; - - pColor = new OptionColorButton( - bLowColor ? qRgb(255,255,0) : qRgb(255,255,150), "CurrentRangeDiffBgColor", &m_currentRangeDiffBgColor, page, this ); - label = new QLabel( pColor, i18n("Current range diff background color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColor, line, 1 ); - ++line; - - pColor = new OptionColorButton( qRgb(0xff,0xd0,0x80), "ManualAlignmentRangeColor", &m_manualHelpRangeColor, page, this ); - label = new QLabel( pColor, i18n("Color for manually aligned difference ranges:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColor, line, 1 ); - ++line; - - label = new QLabel( i18n("Directory Comparison View:"), page ); - gbox->addWidget( label, line, 0 ); - label->setFont(f); - ++line; - - pColor = new OptionColorButton( qRgb(0,0xd0,0), "NewestFileColor", &m_newestFileColor, page, this ); - label = new QLabel( pColor, i18n("Newest file color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColor, line, 1 ); - QString dirColorTip = i18n( "Changing this color will only be effective when starting the next directory comparison."); - QToolTip::add( label, dirColorTip ); - ++line; - - pColor = new OptionColorButton( qRgb(0xf0,0,0), "OldestFileColor", &m_oldestFileColor, page, this ); - label = new QLabel( pColor, i18n("Oldest file color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColor, line, 1 ); - QToolTip::add( label, dirColorTip ); - ++line; - - pColor = new OptionColorButton( qRgb(0xc0,0xc0,0), "MidAgeFileColor", &m_midAgeFileColor, page, this ); - label = new QLabel( pColor, i18n("Middle age file color:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColor, line, 1 ); - QToolTip::add( label, dirColorTip ); - ++line; - - pColor = new OptionColorButton( qRgb(0,0,0), "MissingFileColor", &m_missingFileColor, page, this ); - label = new QLabel( pColor, i18n("Color for missing files:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pColor, line, 1 ); - QToolTip::add( label, dirColorTip ); - ++line; - - topLayout->addStretch(10); -} - - -void OptionDialog::setupEditPage( void ) -{ - QFrame *page = addPage( i18n("Editor"), i18n("Editor Behavior"), - BarIcon("edit", KIcon::SizeMedium ) ); - Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - - Q3GridLayout *gbox = new Q3GridLayout( 4, 2 ); - gbox->setColStretch(1,5); - topLayout->addLayout( gbox ); - QLabel* label; - int line=0; - - OptionCheckBox* pReplaceTabs = new OptionCheckBox( i18n("Tab inserts spaces"), false, "ReplaceTabs", &m_bReplaceTabs, page, this ); - gbox->addMultiCellWidget( pReplaceTabs, line, line, 0, 1 ); - QToolTip::add( pReplaceTabs, i18n( - "On: Pressing tab generates the appropriate number of spaces.\n" - "Off: A Tab-character will be inserted.") - ); - ++line; - - OptionIntEdit* pTabSize = new OptionIntEdit( 8, "TabSize", &m_tabSize, 1, 100, page, this ); - label = new QLabel( pTabSize, i18n("Tab size:"), page ); - gbox->addWidget( label, line, 0 ); - gbox->addWidget( pTabSize, line, 1 ); - ++line; - - OptionCheckBox* pAutoIndentation = new OptionCheckBox( i18n("Auto indentation"), true, "AutoIndentation", &m_bAutoIndentation, page, this ); - gbox->addMultiCellWidget( pAutoIndentation, line, line, 0, 1 ); - QToolTip::add( pAutoIndentation, i18n( - "On: The indentation of the previous line is used for a new line.\n" - )); - ++line; - - OptionCheckBox* pAutoCopySelection = new OptionCheckBox( i18n("Auto copy selection"), false, "AutoCopySelection", &m_bAutoCopySelection, page, this ); - gbox->addMultiCellWidget( pAutoCopySelection, line, line, 0, 1 ); - QToolTip::add( pAutoCopySelection, i18n( - "On: Any selection is immediately written to the clipboard.\n" - "Off: You must explicitely copy e.g. via Ctrl-C." - )); - ++line; - - label = new QLabel( i18n("Line end style:"), page ); - gbox->addWidget( label, line, 0 ); - #ifdef _WIN32 - int defaultLineEndStyle = eLineEndDos; - #else - int defaultLineEndStyle = eLineEndUnix; - #endif - OptionComboBox* pLineEndStyle = new OptionComboBox( defaultLineEndStyle, "LineEndStyle", &m_lineEndStyle, page, this ); - gbox->addWidget( pLineEndStyle, line, 1 ); - pLineEndStyle->insertItem( "Unix", eLineEndUnix ); - pLineEndStyle->insertItem( "Dos/Windows", eLineEndDos ); - QToolTip::add( label, i18n( - "Sets the line endings for when an edited file is saved.\n" - "DOS/Windows: CR+LF; UNIX: LF; with CR=0D, LF=0A") - ); - ++line; - - topLayout->addStretch(10); -} - - -void OptionDialog::setupDiffPage( void ) -{ - QFrame *page = addPage( i18n("Diff and Merge"), i18n("Diff and Merge Settings"), - BarIcon("misc", KIcon::SizeMedium ) ); - Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - - Q3GridLayout *gbox = new Q3GridLayout( 3, 2 ); - gbox->setColStretch(1,5); - topLayout->addLayout( gbox ); - int line=0; - - QLabel* label=0; - - OptionCheckBox* pPreserveCarriageReturn = new OptionCheckBox( i18n("Preserve carriage return"), false, "PreserveCarriageReturn", &m_bPreserveCarriageReturn, page, this ); - gbox->addMultiCellWidget( pPreserveCarriageReturn, line, line, 0, 1 ); - QToolTip::add( pPreserveCarriageReturn, i18n( - "Show carriage return characters '\\r' if they exist.\n" - "Helps to compare files that were modified under different operating systems.") - ); - ++line; - - OptionCheckBox* pIgnoreNumbers = new OptionCheckBox( i18n("Ignore numbers"), false, "IgnoreNumbers", &m_bIgnoreNumbers, page, this ); - gbox->addMultiCellWidget( pIgnoreNumbers, line, line, 0, 1 ); - QToolTip::add( pIgnoreNumbers, i18n( - "Ignore number characters during line matching phase. (Similar to Ignore white space.)\n" - "Might help to compare files with numeric data.") - ); - ++line; - - OptionCheckBox* pIgnoreComments = new OptionCheckBox( i18n("Ignore C/C++ comments"), false, "IgnoreComments", &m_bIgnoreComments, page, this ); - gbox->addMultiCellWidget( pIgnoreComments, line, line, 0, 1 ); - QToolTip::add( pIgnoreComments, i18n( "Treat C/C++ comments like white space.") - ); - ++line; - - OptionCheckBox* pIgnoreCase = new OptionCheckBox( i18n("Ignore case"), false, "IgnoreCase", &m_bIgnoreCase, page, this ); - gbox->addMultiCellWidget( pIgnoreCase, line, line, 0, 1 ); - QToolTip::add( pIgnoreCase, i18n( - "Treat case differences like white space changes. ('a'<=>'A')") - ); - ++line; - - label = new QLabel( i18n("Preprocessor command:"), page ); - gbox->addWidget( label, line, 0 ); - OptionLineEdit* pLE = new OptionLineEdit( "", "PreProcessorCmd", &m_PreProcessorCmd, page, this ); - gbox->addWidget( pLE, line, 1 ); - QToolTip::add( label, i18n("User defined pre-processing. (See the docs for details.)") ); - ++line; - - label = new QLabel( i18n("Line-matching preprocessor command:"), page ); - gbox->addWidget( label, line, 0 ); - pLE = new OptionLineEdit( "", "LineMatchingPreProcessorCmd", &m_LineMatchingPreProcessorCmd, page, this ); - gbox->addWidget( pLE, line, 1 ); - QToolTip::add( label, i18n("This pre-processor is only used during line matching.\n(See the docs for details.)") ); - ++line; - - OptionCheckBox* pTryHard = new OptionCheckBox( i18n("Try hard (slower)"), true, "TryHard", &m_bTryHard, page, this ); - gbox->addMultiCellWidget( pTryHard, line, line, 0, 1 ); - QToolTip::add( pTryHard, i18n( - "Enables the --minimal option for the external diff.\n" - "The analysis of big files will be much slower.") - ); - ++line; - - label = new QLabel( i18n("Auto advance delay (ms):"), page ); - gbox->addWidget( label, line, 0 ); - OptionIntEdit* pAutoAdvanceDelay = new OptionIntEdit( 500, "AutoAdvanceDelay", &m_autoAdvanceDelay, 0, 2000, page, this ); - gbox->addWidget( pAutoAdvanceDelay, line, 1 ); - QToolTip::add( label,i18n( - "When in Auto-Advance mode the result of the current selection is shown \n" - "for the specified time, before jumping to the next conflict. Range: 0-2000 ms") - ); - ++line; - - label = new QLabel( i18n("White space 2-file merge default:"), page ); - gbox->addWidget( label, line, 0 ); - OptionComboBox* pWhiteSpace2FileMergeDefault = new OptionComboBox( 0, "WhiteSpace2FileMergeDefault", &m_whiteSpace2FileMergeDefault, page, this ); - gbox->addWidget( pWhiteSpace2FileMergeDefault, line, 1 ); - pWhiteSpace2FileMergeDefault->insertItem( i18n("Manual Choice"), 0 ); - pWhiteSpace2FileMergeDefault->insertItem( "A", 1 ); - pWhiteSpace2FileMergeDefault->insertItem( "B", 2 ); - QToolTip::add( label, i18n( - "Allow the merge algorithm to automatically select an input for " - "white-space-only changes." ) - ); - ++line; - - label = new QLabel( i18n("White space 3-file merge default:"), page ); - gbox->addWidget( label, line, 0 ); - OptionComboBox* pWhiteSpace3FileMergeDefault = new OptionComboBox( 0, "WhiteSpace3FileMergeDefault", &m_whiteSpace3FileMergeDefault, page, this ); - gbox->addWidget( pWhiteSpace3FileMergeDefault, line, 1 ); - pWhiteSpace3FileMergeDefault->insertItem( i18n("Manual Choice"), 0 ); - pWhiteSpace3FileMergeDefault->insertItem( "A", 1 ); - pWhiteSpace3FileMergeDefault->insertItem( "B", 2 ); - pWhiteSpace3FileMergeDefault->insertItem( "C", 3 ); - QToolTip::add( label, i18n( - "Allow the merge algorithm to automatically select an input for " - "white-space-only changes." ) - ); - ++line; - - 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 ); - Q3GridLayout* gbox = new Q3GridLayout( page, 2, 2, spacingHint() ); - gbox->setColStretch(1,10); - int line = 0; - - label = new QLabel( i18n("Auto merge regular expression:"), page ); - gbox->addWidget( label, line, 0 ); - m_pAutoMergeRegExpLineEdit = new OptionLineEdit( ".*\\$(Version|Header|Date|Author).*\\$.*", "AutoMergeRegExp", &m_autoMergeRegExp, page, this ); - gbox->addWidget( m_pAutoMergeRegExpLineEdit, line, 1 ); - s_autoMergeRegExpToolTip = i18n("Regular expression for lines where KDiff3 should automatically choose one source.\n" - "When a line with a conflict matches the regular expression then\n" - "- if available - C, otherwise B will be chosen."); - QToolTip::add( label, s_autoMergeRegExpToolTip ); - ++line; - - OptionCheckBox* pAutoMergeRegExp = new OptionCheckBox( i18n("Run regular expression auto merge on merge start"), false, "RunRegExpAutoMergeOnMergeStart", &m_bRunRegExpAutoMergeOnMergeStart, page, this ); - gbox->addMultiCellWidget( pAutoMergeRegExp, line, line, 0, 1 ); - QToolTip::add( pAutoMergeRegExp, i18n( "Run the merge for auto merge regular expressions\n" - "immediately when a merge starts.\n")); - ++line; - } - - 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 ); - Q3GridLayout* gbox = new Q3GridLayout( page, 2, 2, spacingHint() ); - gbox->setColStretch(1,10); - int line = 0; - - label = new QLabel( i18n("History start regular expression:"), page ); - gbox->addWidget( label, line, 0 ); - 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$\"-keyword.\n" - "Default value: \".*\\$Log.*\\$.*\""); - QToolTip::add( label, s_historyStartRegExpToolTip ); - ++line; - - label = new QLabel( i18n("History entry start regular expression:"), page ); - gbox->addWidget( label, line, 0 ); - // Example line: "** \main\rolle_fsp_dev_008\1 17 Aug 2001 10:45:44 rolle" - QString historyEntryStartDefault = - "\\s*\\\\main\\\\(\\S+)\\s+" // Start with "\main\" - "([0-9]+) " // day - "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) " //month - "([0-9][0-9][0-9][0-9]) " // year - "([0-9][0-9]:[0-9][0-9]:[0-9][0-9])\\s+(.*)"; // time, name - - m_pHistoryEntryStartRegExpLineEdit = new OptionLineEdit( historyEntryStartDefault, "HistoryEntryStartRegExp", &m_historyEntryStartRegExp, page, this ); - gbox->addWidget( m_pHistoryEntryStartRegExpLineEdit, line, 1 ); - s_historyEntryStartRegExpToolTip = i18n("A version control history entry consists of several lines.\n" - "Specify the regular expression to detect the first line (without the leading comment).\n" - "Use parentheses to group the keys you want to use for sorting.\n" - "If left empty, then KDiff3 assumes that empty lines separate history entries.\n" - "See the documentation for details."); - QToolTip::add( label, s_historyEntryStartRegExpToolTip ); - ++line; - - m_pHistoryMergeSorting = new OptionCheckBox( i18n("History merge sorting"), false, "HistoryMergeSorting", &m_bHistoryMergeSorting, page, this ); - gbox->addMultiCellWidget( m_pHistoryMergeSorting, line, line, 0, 1 ); - QToolTip::add( m_pHistoryMergeSorting, i18n("Sort version control history by a key.") ); - ++line; - //QString branch = newHistoryEntry.cap(1); - //int day = newHistoryEntry.cap(2).toInt(); - //int month = QString("Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec").find(newHistoryEntry.cap(3))/4 + 1; - //int year = newHistoryEntry.cap(4).toInt(); - //QString time = newHistoryEntry.cap(5); - //QString name = newHistoryEntry.cap(6); - QString defaultSortKeyOrder = "4,3,2,5,1,6"; //QDate(year,month,day).toString(Qt::ISODate) +" "+ time + " " + branch + " " + name; - - label = new QLabel( i18n("History entry start sort key order:"), page ); - gbox->addWidget( label, line, 0 ); - m_pHistorySortKeyOrderLineEdit = new OptionLineEdit( defaultSortKeyOrder, "HistoryEntryStartSortKeyOrder", &m_historyEntryStartSortKeyOrder, page, this ); - gbox->addWidget( m_pHistorySortKeyOrderLineEdit, line, 1 ); - s_historyEntryStartSortKeyOrderToolTip = i18n("Each parentheses used in the regular expression for the history start entry\n" - "groups a key that can be used for sorting.\n" - "Specify the list of keys (that are numbered in order of occurrence\n" - "starting with 1) using ',' as separator (e.g. \"4,5,6,1,2,3,7\").\n" - "If left empty, then no sorting will be done.\n" - "See the documentation for details."); - QToolTip::add( label, s_historyEntryStartSortKeyOrderToolTip ); - m_pHistorySortKeyOrderLineEdit->setEnabled(false); - connect( m_pHistoryMergeSorting, SIGNAL(toggled(bool)), m_pHistorySortKeyOrderLineEdit, SLOT(setEnabled(bool))); - ++line; - - m_pHistoryAutoMerge = new OptionCheckBox( i18n("Merge version control history on merge start"), false, "RunHistoryAutoMergeOnMergeStart", &m_bRunHistoryAutoMergeOnMergeStart, page, this ); - gbox->addMultiCellWidget( m_pHistoryAutoMerge, line, line, 0, 1 ); - QToolTip::add( m_pHistoryAutoMerge, i18n("Run version control history automerge on merge start.") ); - ++line; - } - - QPushButton* pButton = new QPushButton( i18n("Test your regular expressions"), page ); - gbox->addWidget( pButton, line, 0 ); - connect( pButton, SIGNAL(clicked()), this, SLOT(slotHistoryMergeRegExpTester())); - ++line; - - label = new QLabel( i18n("Irrelevant merge command:"), page ); - gbox->addWidget( label, line, 0 ); - pLE = new OptionLineEdit( "", "IrrelevantMergeCmd", &m_IrrelevantMergeCmd, page, this ); - gbox->addWidget( pLE, line, 1 ); - QToolTip::add( label, i18n("If specified this script is run after automerge\n" - "when no other relevant changes were detected.\n" - "Called with the parameters: filename1 filename2 filename3") ); - ++line; - - topLayout->addStretch(10); -} - -void OptionDialog::setupDirectoryMergePage( void ) -{ - QFrame *page = addPage( i18n("Directory Merge"), i18n("Directory Merge"), - BarIcon("folder", KIcon::SizeMedium ) ); - Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - - Q3GridLayout *gbox = new Q3GridLayout( 11, 2 ); - gbox->setColStretch(1,5); - topLayout->addLayout( gbox ); - int line=0; - - OptionCheckBox* pRecursiveDirs = new OptionCheckBox( i18n("Recursive directories"), true, "RecursiveDirs", &m_bDmRecursiveDirs, page, this ); - gbox->addMultiCellWidget( pRecursiveDirs, line, line, 0, 1 ); - QToolTip::add( pRecursiveDirs, i18n("Whether to analyze subdirectories or not.") ); - ++line; - QLabel* label = new QLabel( i18n("File pattern(s):"), page ); - gbox->addWidget( label, line, 0 ); - OptionLineEdit* pFilePattern = new OptionLineEdit( "*", "FilePattern", &m_DmFilePattern, page, this ); - gbox->addWidget( pFilePattern, line, 1 ); - QToolTip::add( label, i18n( - "Pattern(s) of files to be analyzed. \n" - "Wildcards: '*' and '?'\n" - "Several Patterns can be specified by using the separator: ';'" - )); - ++line; - - label = new QLabel( i18n("File-anti-pattern(s):"), page ); - gbox->addWidget( label, line, 0 ); - OptionLineEdit* pFileAntiPattern = new OptionLineEdit( "*.orig;*.o;*.obj", "FileAntiPattern", &m_DmFileAntiPattern, page, this ); - gbox->addWidget( pFileAntiPattern, line, 1 ); - QToolTip::add( label, i18n( - "Pattern(s) of files to be excluded from analysis. \n" - "Wildcards: '*' and '?'\n" - "Several Patterns can be specified by using the separator: ';'" - )); - ++line; - - label = new QLabel( i18n("Dir-anti-pattern(s):"), page ); - gbox->addWidget( label, line, 0 ); - OptionLineEdit* pDirAntiPattern = new OptionLineEdit( "CVS;.deps;.svn", "DirAntiPattern", &m_DmDirAntiPattern, page, this ); - gbox->addWidget( pDirAntiPattern, line, 1 ); - QToolTip::add( label, i18n( - "Pattern(s) of directories to be excluded from analysis. \n" - "Wildcards: '*' and '?'\n" - "Several Patterns can be specified by using the separator: ';'" - )); - ++line; - - OptionCheckBox* pUseCvsIgnore = new OptionCheckBox( i18n("Use .cvsignore"), false, "UseCvsIgnore", &m_bDmUseCvsIgnore, page, this ); - gbox->addMultiCellWidget( pUseCvsIgnore, line, line, 0, 1 ); - QToolTip::add( pUseCvsIgnore, i18n( - "Extends the antipattern to anything that would be ignored by CVS.\n" - "Via local \".cvsignore\"-files this can be directory specific." - )); - ++line; - - OptionCheckBox* pFindHidden = new OptionCheckBox( i18n("Find hidden files and directories"), true, "FindHidden", &m_bDmFindHidden, page, this ); - gbox->addMultiCellWidget( pFindHidden, line, line, 0, 1 ); -#ifdef _WIN32 - QToolTip::add( pFindHidden, i18n("Finds files and directories with the hidden attribute.") ); -#else - QToolTip::add( pFindHidden, i18n("Finds files and directories starting with '.'.") ); -#endif - ++line; - - OptionCheckBox* pFollowFileLinks = new OptionCheckBox( i18n("Follow file links"), false, "FollowFileLinks", &m_bDmFollowFileLinks, page, this ); - gbox->addMultiCellWidget( pFollowFileLinks, line, line, 0, 1 ); - QToolTip::add( pFollowFileLinks, i18n( - "On: Compare the file the link points to.\n" - "Off: Compare the links." - )); - ++line; - - OptionCheckBox* pFollowDirLinks = new OptionCheckBox( i18n("Follow directory links"), false, "FollowDirLinks", &m_bDmFollowDirLinks, page, this ); - gbox->addMultiCellWidget( pFollowDirLinks, line, line, 0, 1 ); - QToolTip::add( pFollowDirLinks, i18n( - "On: Compare the directory the link points to.\n" - "Off: Compare the links." - )); - ++line; - - //OptionCheckBox* pShowOnlyDeltas = new OptionCheckBox( i18n("List only deltas"),false,"ListOnlyDeltas", &m_bDmShowOnlyDeltas, page, this ); - //gbox->addMultiCellWidget( pShowOnlyDeltas, line, line, 0, 1 ); - //QToolTip::add( pShowOnlyDeltas, i18n( - // "Files and directories without change will not appear in the list.")); - //++line; - -#ifdef _WIN32 - bool bCaseSensitiveFilenameComparison = false; -#else - bool bCaseSensitiveFilenameComparison = true; -#endif - OptionCheckBox* pCaseSensitiveFileNames = new OptionCheckBox( i18n("Case sensitive filename comparison"),bCaseSensitiveFilenameComparison,"CaseSensitiveFilenameComparison", &m_bDmCaseSensitiveFilenameComparison, page, this ); - gbox->addMultiCellWidget( pCaseSensitiveFileNames, line, line, 0, 1 ); - QToolTip::add( pCaseSensitiveFileNames, i18n( - "The directory comparison will compare files or directories when their names match.\n" - "Set this option if the case of the names must match. (Default for Windows is off, otherwise on.)")); - ++line; - - Q3VButtonGroup* pBG = new Q3VButtonGroup(i18n("File Comparison Mode"),page); - gbox->addMultiCellWidget( pBG, line, line, 0, 1 ); - ++line; - - OptionRadioButton* pBinaryComparison = new OptionRadioButton( i18n("Binary comparison"), true, "BinaryComparison", &m_bDmBinaryComparison, pBG, this ); - QToolTip::add( pBinaryComparison, i18n("Binary comparison of each file. (Default)") ); - - OptionRadioButton* pFullAnalysis = new OptionRadioButton( i18n("Full analysis"), false, "FullAnalysis", &m_bDmFullAnalysis, pBG, this ); - QToolTip::add( pFullAnalysis, i18n("Do a full analysis and show statistics information in extra columns.\n" - "(Slower than a binary comparison, much slower for binary files.)") ); - - OptionRadioButton* pTrustDate = new OptionRadioButton( i18n("Trust the modification date (unsafe)"), false, "TrustDate", &m_bDmTrustDate, pBG, this ); - QToolTip::add( pTrustDate, i18n("Assume that files are equal if the modification date and file length are equal.\n" - "Useful for big directories or slow networks.") ); - - OptionRadioButton* pTrustSize = new OptionRadioButton( i18n("Trust the size (unsafe)"), false, "TrustSize", &m_bDmTrustSize, pBG, this ); - QToolTip::add( pTrustSize, i18n("Assume that files are equal if their file lengths are equal.\n" - "Useful for big directories or slow networks when the date is modified during download.") ); - - // Some two Dir-options: Affects only the default actions. - OptionCheckBox* pSyncMode = new OptionCheckBox( i18n("Synchronize directories"), false,"SyncMode", &m_bDmSyncMode, page, this ); - gbox->addMultiCellWidget( pSyncMode, line, line, 0, 1 ); - QToolTip::add( pSyncMode, i18n( - "Offers to store files in both directories so that\n" - "both directories are the same afterwards.\n" - "Works only when comparing two directories without specifying a destination." ) ); - ++line; - - // Allow white-space only differences to be considered equal - OptionCheckBox* pWhiteSpaceDiffsEqual = new OptionCheckBox( i18n("White space differences considered equal"), false,"WhiteSpaceEqual", &m_bDmWhiteSpaceEqual, page, this ); - gbox->addMultiCellWidget( pWhiteSpaceDiffsEqual, line, line, 0, 1 ); - QToolTip::add( pWhiteSpaceDiffsEqual, i18n( - "If files differ only by white space consider them equal.\n" - "This is only active when full analysis is chosen." ) ); - connect(pFullAnalysis, SIGNAL(toggled(bool)), pWhiteSpaceDiffsEqual, SLOT(setEnabled(bool))); - pWhiteSpaceDiffsEqual->setEnabled(false); - ++line; - - OptionCheckBox* pCopyNewer = new OptionCheckBox( i18n("Copy newer instead of merging (unsafe)"), false, "CopyNewer", &m_bDmCopyNewer, page, this ); - gbox->addMultiCellWidget( pCopyNewer, line, line, 0, 1 ); - QToolTip::add( pCopyNewer, i18n( - "Don't look inside, just take the newer file.\n" - "(Use this only if you know what you are doing!)\n" - "Only effective when comparing two directories." ) ); - ++line; - - OptionCheckBox* pCreateBakFiles = new OptionCheckBox( i18n("Backup files (.orig)"), true, "CreateBakFiles", &m_bDmCreateBakFiles, page, this ); - gbox->addMultiCellWidget( pCreateBakFiles, line, line, 0, 1 ); - QToolTip::add( pCreateBakFiles, i18n( - "When a file would be saved over an old file, then the old file\n" - "will be renamed with a '.orig'-extension instead of being deleted.")); - ++line; - - topLayout->addStretch(10); -} -/* -static void insertCodecs(OptionComboBox* p) -{ - std::multimap m; // Using the multimap for case-insensitive sorting. - int i; - for(i=0;;++i) - { - QTextCodec* pCodec = QTextCodec::codecForIndex ( i ); - if ( pCodec != 0 ) m.insert( std::make_pair( QString(pCodec->mimeName()).upper(), pCodec->mimeName()) ); - else break; - } - - p->insertItem( i18n("Auto"), 0 ); - std::multimap::iterator mi; - for(mi=m.begin(), i=0; mi!=m.end(); ++mi, ++i) - p->insertItem(mi->second, i+1); -} -*/ - -void OptionDialog::setupRegionalPage( void ) -{ - QFrame *page = addPage( i18n("Regional Settings"), i18n("Regional Settings"), - BarIcon("locale"/*"charset"*/, KIcon::SizeMedium ) ); - Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - - Q3GridLayout *gbox = new Q3GridLayout( 3, 2 ); - gbox->setColStretch(1,5); - topLayout->addLayout( gbox ); - int line=0; - - QLabel* label; - -#ifdef KREPLACEMENTS_H - -static char* countryMap[]={ -"af Afrikaans", -"ar Arabic", -"az Azerbaijani", -"be Belarusian", -"bg Bulgarian", -"bn Bengali", -"bo Tibetan", -"br Breton", -"bs Bosnian", -"ca Catalan", -"cs Czech", -"cy Welsh", -"da Danish", -"de German", -"el Greek", -"en_GB British English", -"eo Esperanto", -"es Spanish", -"et Estonian", -"eu Basque", -"fa Farsi (Persian)", -"fi Finnish", -"fo Faroese", -"fr French", -"ga Irish Gaelic", -"gl Galician", -"gu Gujarati", -"he Hebrew", -"hi Hindi", -"hr Croatian", -"hsb Upper Sorbian", -"hu Hungarian", -"id Indonesian", -"is Icelandic", -"it Italian", -"ja Japanese", -"ka Georgian", -"ko Korean", -"ku Kurdish", -"lo Lao", -"lt Lithuanian", -"lv Latvian", -"mi Maori", -"mk Macedonian", -"mn Mongolian", -"ms Malay", -"mt Maltese", -"nb Norwegian Bookmal", -"nds Low Saxon", -"nl Dutch", -"nn Norwegian Nynorsk", -"nso Northern Sotho", -"oc Occitan", -"pl Polish", -"pt Portuguese", -"pt_BR Brazilian Portuguese", -"ro Romanian", -"ru Russian", -"rw Kinyarwanda", -"se Northern Sami", -"sk Slovak", -"sl Slovenian", -"sq Albanian", -"sr Serbian", -"sr@Latn Serbian", -"ss Swati", -"sv Swedish", -"ta Tamil", -"tg Tajik", -"th Thai", -"tr Turkish", -"uk Ukrainian", -"uz Uzbek", -"ven Venda", -"vi Vietnamese", -"wa Walloon", -"xh Xhosa", -"zh_CN Chinese Simplified", -"zh_TW Chinese Traditional", -"zu Zulu" -}; - - label = new QLabel( i18n("Language (restart required)"), page ); - gbox->addWidget( label, line, 0 ); - OptionComboBox* pLanguage = new OptionComboBox( 0, "Language", &m_language, page, this ); - gbox->addWidget( pLanguage, line, 1 ); - pLanguage->insertItem( "Auto", 0 ); // Must not translate, won't work otherwise! - pLanguage->insertItem( "en_orig" ); - - // Read directory: Find all kdiff3_*.qm-files and insert the found files here selection - FileAccess fa( getTranslationDir() ); - t_DirectoryList dirList; - fa.listDir( &dirList, false, false, "kdiff3_*.qm", "", "*", false, false ); - t_DirectoryList::iterator i; - for( i=dirList.begin(); i!=dirList.end(); ++i) - { - QString fileName = i->fileName(); - // Skip the "kdiff3_" and omit the .qm - QString languageId = fileName.mid(7, fileName.length()-10 ); - - unsigned int countryIdx=0; - for(countryIdx=0; countryIdx< sizeof(countryMap)/sizeof(countryMap[0]); ++countryIdx ) - { - QString fullName = countryMap[countryIdx]; - if ( languageId+" " == fullName.left(languageId.length()+1) ) - { - languageId += " (" + fullName.mid(languageId.length()+1) + ")"; - } - } - - pLanguage->insertItem( languageId ); - } - - QToolTip::add( label, i18n( - "Choose the language of the GUI-strings or \"Auto\".\n" - "For a change of language to take place, quit and restart KDiff3.") - ); - ++line; -/* - label = new QLabel( i18n("Codec for file contents"), page ); - gbox->addWidget( label, line, 0 ); - OptionComboBox* pFileCodec = new OptionComboBox( 0, "FileCodec", &m_fileCodec, page, this ); - gbox->addWidget( pFileCodec, line, 1 ); - insertCodecs( pFileCodec ); - QToolTip::add( label, i18n( - "Choose the codec that should be used for your input files\n" - "or \"Auto\" if unsure." ) - ); - ++line; -*/ -#endif - - m_pSameEncoding = new OptionCheckBox( i18n("Use the same encoding for everything:"), true, "SameEncoding", &m_bSameEncoding, page, this ); - gbox->addMultiCellWidget( m_pSameEncoding, line, line, 0, 1 ); - QToolTip::add( m_pSameEncoding, i18n( - "Enable this allows to change all encodings by changing the first only.\n" - "Disable this if different individual settings are needed." - ) ); - ++line; - - label = new QLabel( i18n("Note: Local Encoding is ") + "\"" + QTextCodec::codecForLocale()->name() + "\"", page ); - gbox->addWidget( label, line, 0 ); - ++line; - - label = new QLabel( i18n("File Encoding for A:"), page ); - gbox->addWidget( label, line, 0 ); - m_pEncodingAComboBox = new OptionEncodingComboBox( "EncodingForA", &m_pEncodingA, page, this ); - gbox->addWidget( m_pEncodingAComboBox, line, 1 ); - ++line; - label = new QLabel( i18n("File Encoding for B:"), page ); - gbox->addWidget( label, line, 0 ); - m_pEncodingBComboBox = new OptionEncodingComboBox( "EncodingForB", &m_pEncodingB, page, this ); - gbox->addWidget( m_pEncodingBComboBox, line, 1 ); - ++line; - label = new QLabel( i18n("File Encoding for C:"), page ); - gbox->addWidget( label, line, 0 ); - m_pEncodingCComboBox = new OptionEncodingComboBox( "EncodingForC", &m_pEncodingC, page, this ); - gbox->addWidget( m_pEncodingCComboBox, line, 1 ); - ++line; - label = new QLabel( i18n("File Encoding for Merge Output and Saving:"), page ); - gbox->addWidget( label, line, 0 ); - m_pEncodingOutComboBox = new OptionEncodingComboBox( "EncodingForOutput", &m_pEncodingOut, page, this ); - gbox->addWidget( m_pEncodingOutComboBox, line, 1 ); - ++line; - label = new QLabel( i18n("File Encoding for Preprocessor Files:"), page ); - gbox->addWidget( label, line, 0 ); - m_pEncodingPPComboBox = new OptionEncodingComboBox( "EncodingForPP", &m_pEncodingPP, page, this ); - gbox->addWidget( m_pEncodingPPComboBox, line, 1 ); - ++line; - - connect(m_pSameEncoding, SIGNAL(toggled(bool)), this, SLOT(slotEncodingChanged())); - connect(m_pEncodingAComboBox, SIGNAL(activated(int)), this, SLOT(slotEncodingChanged())); - - OptionCheckBox* pRightToLeftLanguage = new OptionCheckBox( i18n("Right To Left Language"), false, "RightToLeftLanguage", &m_bRightToLeftLanguage, page, this ); - gbox->addMultiCellWidget( pRightToLeftLanguage, line, line, 0, 1 ); - QToolTip::add( pRightToLeftLanguage, i18n( - "Some languages are read from right to left.\n" - "This setting will change the viewer and editor accordingly.")); - ++line; - - - topLayout->addStretch(10); -} - -void OptionDialog::setupIntegrationPage( void ) -{ - QFrame *page = addPage( i18n("Integration"), i18n("Integration Settings"), - BarIcon("launch"/*"charset"*/, KIcon::SizeMedium ) ); - Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, 5, spacingHint() ); - - Q3GridLayout *gbox = new Q3GridLayout( 3, 2 ); - gbox->setColStretch(1,5); - topLayout->addLayout( gbox ); - int line=0; - - QLabel* label; - label = new QLabel( i18n("Command line options to ignore:"), page ); - gbox->addWidget( label, line, 0 ); - OptionLineEdit* pIgnorableCmdLineOptions = new OptionLineEdit( "-u;-query;-html;-abort", "IgnorableCmdLineOptions", &m_ignorableCmdLineOptions, page, this ); - gbox->addWidget( pIgnorableCmdLineOptions, line, 1 ); - QToolTip::add( label, i18n( - "List of command line options that should be ignored when KDiff3 is used by other tools.\n" - "Several values can be specified if separated via ';'\n" - "This will suppress the \"Unknown option\"-error." - )); - ++line; - - topLayout->addStretch(10); -} - - -void OptionDialog::slotEncodingChanged() -{ - if ( m_pSameEncoding->isChecked() ) - { - m_pEncodingBComboBox->setEnabled( false ); - m_pEncodingBComboBox->setCurrentItem( m_pEncodingAComboBox->currentItem() ); - m_pEncodingCComboBox->setEnabled( false ); - m_pEncodingCComboBox->setCurrentItem( m_pEncodingAComboBox->currentItem() ); - m_pEncodingOutComboBox->setEnabled( false ); - m_pEncodingOutComboBox->setCurrentItem( m_pEncodingAComboBox->currentItem() ); - m_pEncodingPPComboBox->setEnabled( false ); - m_pEncodingPPComboBox->setCurrentItem( m_pEncodingAComboBox->currentItem() ); - } - else - { - m_pEncodingBComboBox->setEnabled( true ); - m_pEncodingCComboBox->setEnabled( true ); - m_pEncodingOutComboBox->setEnabled( true ); - m_pEncodingPPComboBox->setEnabled( true ); - } -} - -void OptionDialog::setupKeysPage( void ) -{ - //QVBox *page = addVBoxPage( i18n("Keys"), i18n("KeyDialog" ), - // BarIcon("fonts", KIcon::SizeMedium ) ); - - //QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); - // new KFontChooser( page,"font",false/*onlyFixed*/,QStringList(),false,6 ); - //m_pKeyDialog=new KKeyDialog( false, 0 ); - //topLayout->addWidget( m_pKeyDialog ); -} - -void OptionDialog::slotOk( void ) -{ - slotApply(); - - // My system returns variable width fonts even though I - // disabled this. Even QFont::fixedPitch() doesn't work. - QFontMetrics fm(m_font); - if ( fm.width('W')!=fm.width('i') ) - { - int result = KMessageBox::warningYesNo(this, i18n( - "You selected a variable width font.\n\n" - "Because this program doesn't handle variable width fonts\n" - "correctly, you might experience problems while editing.\n\n" - "Do you want to continue or do you want to select another font."), - i18n("Incompatible Font"), - i18n("Continue at Own Risk"), i18n("Select Another Font")); - if (result==KMessageBox::No) - return; - } - - accept(); -} - - -/** Copy the values from the widgets to the public variables.*/ -void OptionDialog::slotApply( void ) -{ - std::list::iterator i; - for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) - { - (*i)->apply(); - } - - emit applyClicked(); -} - -/** Set the default values in the widgets only, while the - public variables remain unchanged. */ -void OptionDialog::slotDefault() -{ - int result = KMessageBox::warningContinueCancel(this, i18n("This resets all options. Not only those of the current topic.") ); - if ( result==KMessageBox::Cancel ) return; - else resetToDefaults(); -} - -void OptionDialog::resetToDefaults() -{ - std::list::iterator i; - for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) - { - (*i)->setToDefault(); - } - - slotEncodingChanged(); -} - -/** Initialise the widgets using the values in the public varibles. */ -void OptionDialog::setState() -{ - std::list::iterator i; - for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) - { - (*i)->setToCurrent(); - } - - slotEncodingChanged(); -} - -class ConfigValueMap : public ValueMap -{ -private: - KConfig* m_pConfig; -public: - ConfigValueMap( KConfig* pConfig ) { m_pConfig = pConfig; } - - void writeEntry(const QString& s, const QFont& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QColor& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QSize& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QPoint& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, int v ) { m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, bool v ) { m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const QStringList& v, char separator ){ m_pConfig->writeEntry(s,v,separator); } - void writeEntry(const QString& s, const QString& v ){ m_pConfig->writeEntry(s,v); } - void writeEntry(const QString& s, const char* v ) { m_pConfig->writeEntry(s,v); } - - QFont readFontEntry (const QString& s, QFont* defaultVal ) { return m_pConfig->readFontEntry(s,defaultVal); } - QColor readColorEntry(const QString& s, QColor* defaultVal ){ return m_pConfig->readColorEntry(s,defaultVal); } - QSize readSizeEntry (const QString& s, QSize* defaultVal ) { return m_pConfig->readSizeEntry(s,defaultVal); } - QPoint readPointEntry(const QString& s, QPoint* defaultVal) { return m_pConfig->readPointEntry(s,defaultVal); } - bool readBoolEntry (const QString& s, bool defaultVal ) { return m_pConfig->readBoolEntry(s,defaultVal); } - int readNumEntry (const QString& s, int defaultVal ) { return m_pConfig->readNumEntry(s,defaultVal); } - QStringList readListEntry (const QString& s, const QStringList& def, char separator ) { return m_pConfig->readListEntry(s.latin1(),def,separator); } - QString readEntry (const QString& s, const QString& defaultVal){ return m_pConfig->readEntry(s,defaultVal); } -}; - -void OptionDialog::saveOptions( KConfig* config ) -{ - // No i18n()-Translations here! - - config->setGroup("KDiff3 Options"); - - ConfigValueMap cvm(config); - std::list::iterator i; - for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) - { - (*i)->write(&cvm); - } -} - -void OptionDialog::readOptions( KConfig* config ) -{ - // No i18n()-Translations here! - - config->setGroup("KDiff3 Options"); - - ConfigValueMap cvm(config); - std::list::iterator i; - for(i=m_optionItemList.begin(); i!=m_optionItemList.end(); ++i) - { - (*i)->read(&cvm); - } - - setState(); -} - -void OptionDialog::slotHelp( void ) -{ - KDialogBase::slotHelp(); -} - -QString OptionDialog::parseOptions( const QCStringList& optionList ) -{ - QString result; - QCStringList::const_iterator i; - for ( i=optionList.begin(); i!=optionList.end(); ++i ) - { - QString s = *i; - - int pos = s.find('='); - if( pos > 0 ) // seems not to have a tag - { - QString key = s.left(pos); - QString val = s.mid(pos+1); - std::list::iterator j; - bool bFound = false; - for(j=m_optionItemList.begin(); j!=m_optionItemList.end(); ++j) - { - if ( (*j)->getSaveName()==key ) - { - ValueMap config; - config.writeEntry( key, val ); // Write the value as a string and - (*j)->read(&config); // use the internal conversion from string to the needed value. - bFound = true; - break; - } - } - if ( ! bFound ) - { - result += "No config item named \"" + key + "\"\n"; - } - } - else - { - result += "No '=' found in \"" + s + "\"\n"; - } - } - return result; -} - -QString OptionDialog::calcOptionHelp() -{ - ValueMap config; - std::list::iterator j; - for(j=m_optionItemList.begin(); j!=m_optionItemList.end(); ++j) - { - (*j)->write( &config ); - } - return config.getAsString(); -} - -void OptionDialog::slotHistoryMergeRegExpTester() -{ - RegExpTester dlg(this, s_autoMergeRegExpToolTip, s_historyStartRegExpToolTip, - s_historyEntryStartRegExpToolTip, s_historyEntryStartSortKeyOrderToolTip ); - dlg.init(m_pAutoMergeRegExpLineEdit->currentText(), m_pHistoryStartRegExpLineEdit->currentText(), - m_pHistoryEntryStartRegExpLineEdit->currentText(), m_pHistorySortKeyOrderLineEdit->currentText()); - if ( dlg.exec() ) - { - m_pAutoMergeRegExpLineEdit->setCurrentText( dlg.autoMergeRegExp() ); - m_pHistoryStartRegExpLineEdit->setCurrentText( dlg.historyStartRegExp() ); - m_pHistoryEntryStartRegExpLineEdit->setCurrentText( dlg.historyEntryStartRegExp() ); - m_pHistorySortKeyOrderLineEdit->setCurrentText( dlg.historySortKeyOrder() ); - } -} - - -//#include "optiondialog.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/optiondialog.h --- a/kdiff3/src/optiondialog.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ -//Added by qt3to4: -#include -/* - * kdiff3 - Text Diff And Merge Tool - * Copyright (C) 2002-2006 Joachim Eibl, joachim.eibl at gmx.de - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef OPTION_DIALOG_H -#define OPTION_DIALOG_H - -class QCheckBox; -class QLabel; -class QLineEdit; -class KColorButton; -class KFontChooser; -class KConfig; - -#include -#include -#include -#include - -class OptionItem; -class OptionCheckBox; -class OptionEncodingComboBox; -class OptionLineEdit; -class KKeyDialog; - -enum e_LineEndStyle -{ - eLineEndUnix=0, - eLineEndDos -}; - -class OptionDialog : public KDialogBase -{ - Q_OBJECT - -public: - - OptionDialog( bool bShowDirMergeSettings, QWidget *parent = 0, char *name = 0 ); - ~OptionDialog( void ); - QString parseOptions( const QCStringList& optionList ); - QString calcOptionHelp(); - - // Some settings are not available in the option dialog: - QSize m_geometry; - QPoint m_position; - bool m_bShowToolBar; - bool m_bShowStatusBar; - int m_toolBarPos; - - // These are the results of the option dialog. - QFont m_font; - bool m_bItalicForDeltas; - - QColor m_fgColor; - QColor m_bgColor; - QColor m_diffBgColor; - QColor m_colorA; - QColor m_colorB; - QColor m_colorC; - QColor m_colorForConflict; - QColor m_currentRangeBgColor; - QColor m_currentRangeDiffBgColor; - QColor m_oldestFileColor; - QColor m_midAgeFileColor; - QColor m_newestFileColor; - QColor m_missingFileColor; - QColor m_manualHelpRangeColor; - - bool m_bWordWrap; - - bool m_bReplaceTabs; - bool m_bAutoIndentation; - int m_tabSize; - bool m_bAutoCopySelection; - bool m_bSameEncoding; - QTextCodec* m_pEncodingA; - QTextCodec* m_pEncodingB; - QTextCodec* m_pEncodingC; - QTextCodec* m_pEncodingOut; - QTextCodec* m_pEncodingPP; - int m_lineEndStyle; - - bool m_bPreserveCarriageReturn; - bool m_bTryHard; - bool m_bShowWhiteSpaceCharacters; - bool m_bShowWhiteSpace; - bool m_bShowLineNumbers; - bool m_bHorizDiffWindowSplitting; - - int m_whiteSpace2FileMergeDefault; - int m_whiteSpace3FileMergeDefault; - bool m_bIgnoreCase; - bool m_bIgnoreNumbers; - bool m_bIgnoreComments; - QString m_PreProcessorCmd; - QString m_LineMatchingPreProcessorCmd; - bool m_bRunRegExpAutoMergeOnMergeStart; - QString m_autoMergeRegExp; - bool m_bRunHistoryAutoMergeOnMergeStart; - QString m_historyStartRegExp; - QString m_historyEntryStartRegExp; - bool m_bHistoryMergeSorting; - QString m_historyEntryStartSortKeyOrder; - QString m_IrrelevantMergeCmd; - - bool m_bAutoAdvance; - int m_autoAdvanceDelay; - - QStringList m_recentAFiles; - QStringList m_recentBFiles; - QStringList m_recentCFiles; - - QStringList m_recentOutputFiles; - - // Directory Merge options - bool m_bDmSyncMode; - bool m_bDmRecursiveDirs; - bool m_bDmFollowFileLinks; - bool m_bDmFollowDirLinks; - bool m_bDmFindHidden; - bool m_bDmCreateBakFiles; - bool m_bDmBinaryComparison; - bool m_bDmFullAnalysis; - bool m_bDmTrustDate; - bool m_bDmTrustSize; - bool m_bDmCopyNewer; - //bool m_bDmShowOnlyDeltas; - bool m_bDmShowIdenticalFiles; - bool m_bDmUseCvsIgnore; - bool m_bDmWhiteSpaceEqual; - bool m_bDmCaseSensitiveFilenameComparison; - QString m_DmFilePattern; - QString m_DmFileAntiPattern; - QString m_DmDirAntiPattern; - - QString m_language; - bool m_bRightToLeftLanguage; - - QString m_ignorableCmdLineOptions; - - void saveOptions(KConfig* config); - void readOptions(KConfig* config); - - void setState(); // Must be called before calling exec(); - - void addOptionItem(OptionItem*); - KKeyDialog* m_pKeyDialog; -protected slots: - virtual void slotDefault( void ); - virtual void slotOk( void ); - virtual void slotApply( void ); - virtual void slotHelp( void ); - - void slotEncodingChanged(); - void slotHistoryMergeRegExpTester(); -private: - void resetToDefaults(); - - std::list m_optionItemList; - - OptionCheckBox* m_pSameEncoding; - OptionEncodingComboBox* m_pEncodingAComboBox; - OptionEncodingComboBox* m_pEncodingBComboBox; - OptionEncodingComboBox* m_pEncodingCComboBox; - OptionEncodingComboBox* m_pEncodingOutComboBox; - OptionEncodingComboBox* m_pEncodingPPComboBox; - OptionCheckBox* m_pHistoryAutoMerge; - OptionLineEdit* m_pAutoMergeRegExpLineEdit; - OptionLineEdit* m_pHistoryStartRegExpLineEdit; - OptionLineEdit* m_pHistoryEntryStartRegExpLineEdit; - OptionCheckBox* m_pHistoryMergeSorting; - OptionLineEdit* m_pHistorySortKeyOrderLineEdit; - -private: - void setupFontPage(); - void setupColorPage(); - void setupEditPage(); - void setupDiffPage(); - void setupDirectoryMergePage(); - void setupKeysPage(); - void setupRegionalPage(); - void setupIntegrationPage(); - void setupOtherOptions(); -}; - - - - -#endif - - - - - - - diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/pdiff.cpp --- a/kdiff3/src/pdiff.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2252 +0,0 @@ -/*************************************************************************** - pdiff.cpp - Implementation for class KDiff3App - --------------- - begin : Mon March 18 20:04:50 CET 2002 - copyright : (C) 2002-2005 by Joachim Eibl - email : joachim.eibl at gmx.de - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "difftextwindow.h" -#include "mergeresultwindow.h" -#include "directorymergewindow.h" -#include "smalldialogs.h" - -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "kdiff3.h" -#include "optiondialog.h" -#include "fileaccess.h" -#ifdef _WIN32 -#include -#else -#include -#endif - -#include "gnudiff_diff.h" - -bool g_bIgnoreWhiteSpace = true; -bool g_bIgnoreTrivialMatches = true; - - -bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList ) -{ - ProgressProxy pp; - static GnuDiff gnuDiff; // All values are initialized with zeros. - - pp.setCurrent(0); - - diffList.clear(); - if ( p1[0].pLine==0 || p2[0].pLine==0 || size1==0 || size2==0 ) - { - Diff d( 0,0,0); - if ( p1[0].pLine==0 && p2[0].pLine==0 && size1 == size2 ) - d.nofEquals = size1; - else - { - d.diff1=size1; - d.diff2=size2; - } - - diffList.push_back(d); - } - else - { - GnuDiff::comparison comparisonInput; - memset( &comparisonInput, 0, sizeof(comparisonInput) ); - comparisonInput.parent = 0; - comparisonInput.file[0].buffer = p1[0].pLine;//ptr to buffer - comparisonInput.file[0].buffered = (p1[size1-1].pLine-p1[0].pLine+p1[size1-1].size); // size of buffer - comparisonInput.file[1].buffer = p2[0].pLine;//ptr to buffer - comparisonInput.file[1].buffered = (p2[size2-1].pLine-p2[0].pLine+p2[size2-1].size); // size of buffer - - gnuDiff.ignore_white_space = GnuDiff::IGNORE_ALL_SPACE; // I think nobody needs anything else ... - gnuDiff.bIgnoreWhiteSpace = true; - gnuDiff.bIgnoreNumbers = m_pOptionDialog->m_bIgnoreNumbers; - gnuDiff.minimal = m_pOptionDialog->m_bTryHard; - gnuDiff.ignore_case = false; - GnuDiff::change* script = gnuDiff.diff_2_files( &comparisonInput ); - - int equalLinesAtStart = comparisonInput.file[0].prefix_lines; - int currentLine1 = 0; - int currentLine2 = 0; - GnuDiff::change* p=0; - for (GnuDiff::change* e = script; e; e = p) - { - Diff d(0,0,0); - d.nofEquals = e->line0 - currentLine1; - assert( d.nofEquals == e->line1 - currentLine2 ); - d.diff1 = e->deleted; - d.diff2 = e->inserted; - currentLine1 += d.nofEquals + d.diff1; - currentLine2 += d.nofEquals + d.diff2; - diffList.push_back(d); - - p = e->link; - free (e); - } - - if ( diffList.empty() ) - { - Diff d(0,0,0); - d.nofEquals = min2(size1,size2); - d.diff1 = size1 - d.nofEquals; - d.diff2 = size2 - d.nofEquals; - diffList.push_back(d); -/* Diff d(0,0,0); - d.nofEquals = equalLinesAtStart; - if ( gnuDiff.files[0].missing_newline != gnuDiff.files[1].missing_newline ) - { - d.diff1 = gnuDiff.files[0].missing_newline ? 0 : 1; - d.diff2 = gnuDiff.files[1].missing_newline ? 0 : 1; - ++d.nofEquals; - } - else if ( !gnuDiff.files[0].missing_newline ) - { - ++d.nofEquals; - } - diffList.push_back(d); -*/ - } - else - { - diffList.front().nofEquals += equalLinesAtStart; - currentLine1 += equalLinesAtStart; - currentLine2 += equalLinesAtStart; - - int nofEquals = min2(size1-currentLine1,size2-currentLine2); - if ( nofEquals==0 ) - { - diffList.back().diff1 += size1-currentLine1; - diffList.back().diff2 += size2-currentLine2; - } - else - { - Diff d( nofEquals,size1-currentLine1-nofEquals,size2-currentLine2-nofEquals); - diffList.push_back(d); - } - - /* - if ( gnuDiff.files[0].missing_newline != gnuDiff.files[1].missing_newline ) - { - diffList.back().diff1 += gnuDiff.files[0].missing_newline ? 0 : 1; - diffList.back().diff2 += gnuDiff.files[1].missing_newline ? 0 : 1; - } - else if ( !gnuDiff.files[0].missing_newline ) - { - ++ diffList.back().nofEquals; - } - */ - } - } - -#ifndef NDEBUG - // Verify difflist - { - int l1=0; - int l2=0; - DiffList::iterator i; - for( i = diffList.begin(); i!=diffList.end(); ++i ) - { - l1+= i->nofEquals + i->diff1; - l2+= i->nofEquals + i->diff2; - } - - //if( l1!=p1-p1start || l2!=p2-p2start ) - if( l1!=size1 || l2!=size2 ) - assert( false ); - } -#endif - - pp.setCurrent(1.0); - - return true; -} - -bool KDiff3App::runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList, - int winIdx1, int winIdx2 ) -{ - diffList.clear(); - DiffList diffList2; - - int l1begin = 0; - int l2begin = 0; - ManualDiffHelpList::const_iterator i; - for( i = m_manualDiffHelpList.begin(); i!=m_manualDiffHelpList.end(); ++i ) - { - const ManualDiffHelpEntry& mdhe = *i; - - int l1end = winIdx1 == 1 ? mdhe.lineA1 : winIdx1==2 ? mdhe.lineB1 : mdhe.lineC1 ; - int l2end = winIdx2 == 1 ? mdhe.lineA1 : winIdx2==2 ? mdhe.lineB1 : mdhe.lineC1 ; - - if ( l1end>=0 && l2end>=0 ) - { - runDiff( p1+l1begin, l1end-l1begin, p2+l2begin, l2end-l2begin, diffList2 ); - diffList.splice( diffList.end(), diffList2 ); - l1begin = l1end; - l2begin = l2end; - - l1end = winIdx1 == 1 ? mdhe.lineA2 : winIdx1==2 ? mdhe.lineB2 : mdhe.lineC2 ; - l2end = winIdx2 == 1 ? mdhe.lineA2 : winIdx2==2 ? mdhe.lineB2 : mdhe.lineC2 ; - - if ( l1end>=0 && l2end>=0 ) - { - ++l1end; // point to line after last selected line - ++l2end; - runDiff( p1+l1begin, l1end-l1begin, p2+l2begin, l2end-l2begin, diffList2 ); - diffList.splice( diffList.end(), diffList2 ); - l1begin = l1end; - l2begin = l2end; - } - } - } - runDiff( p1+l1begin, size1-l1begin, p2+l2begin, size2-l2begin, diffList2 ); - diffList.splice( diffList.end(), diffList2 ); - return true; -} - -void KDiff3App::init( bool bAuto, TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles ) -{ - ProgressProxy pp; - // When doing a full analysis in the directory-comparison, then the statistics-results - // will be stored in the given TotalDiffStatus. Otherwise it will be 0. - bool bGUI = pTotalDiffStatus == 0; - if (pTotalDiffStatus==0) - pTotalDiffStatus = &m_totalDiffStatus; - - bool bPreserveCarriageReturn = m_pOptionDialog->m_bPreserveCarriageReturn; - - bool bVisibleMergeResultWindow = ! m_outputFilename.isEmpty(); - if ( bVisibleMergeResultWindow && bGUI ) - { - bPreserveCarriageReturn = false; - - QString msg; - - if ( !m_pOptionDialog->m_PreProcessorCmd.isEmpty() ) - { - msg += "- " + i18n("PreprocessorCmd: ") + m_pOptionDialog->m_PreProcessorCmd + "\n"; - } - if ( !msg.isEmpty() ) - { - int result = KMessageBox::warningYesNo( this, - i18n("The following option(s) you selected might change data:\n") + msg + - i18n("\nMost likely this is not wanted during a merge.\n" - "Do you want to disable these settings or continue with these settings active?"), - i18n("Option Unsafe for Merging"), - i18n("Use These Options During Merge"), i18n("Disable Unsafe Options") - ); - - if (result == KMessageBox::No ) - { - m_pOptionDialog->m_PreProcessorCmd = ""; - } - } - } - - // Because of the progressdialog paintevents can occur, but data is invalid, - // so painting must be suppressed. - if (m_pDiffTextWindow1) m_pDiffTextWindow1->setPaintingAllowed( false ); - if (m_pDiffTextWindow2) m_pDiffTextWindow2->setPaintingAllowed( false ); - if (m_pDiffTextWindow3) m_pDiffTextWindow3->setPaintingAllowed( false ); - if (m_pOverview) m_pOverview->setPaintingAllowed( false ); - if (m_pMergeResultWindow) m_pMergeResultWindow->setPaintingAllowed( false ); - - m_diff3LineList.clear(); - - if ( bLoadFiles ) - { - m_manualDiffHelpList.clear(); - - if( m_sd3.isEmpty() ) - pp.setMaxNofSteps( 4 ); // Read 2 files, 1 comparison, 1 finediff - else - pp.setMaxNofSteps( 9 ); // Read 3 files, 3 comparisons, 3 finediffs - - // First get all input data. - pp.setInformation(i18n("Loading A")); - m_sd1.readAndPreprocess(m_pOptionDialog->m_pEncodingA); - pp.step(); - - pp.setInformation(i18n("Loading B")); - m_sd2.readAndPreprocess(m_pOptionDialog->m_pEncodingB); - pp.step(); - } - else - { - if( m_sd3.isEmpty() ) - pp.setMaxNofSteps( 2 ); // 1 comparison, 1 finediff - else - pp.setMaxNofSteps( 6 ); // 3 comparisons, 3 finediffs - } - - pTotalDiffStatus->reset(); - // Run the diff. - if ( m_sd3.isEmpty() ) - { - pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); - pp.setInformation(i18n("Diff: A <-> B")); - - runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); - - pp.step(); - - pp.setInformation(i18n("Linediff: A <-> B")); - calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList ); - fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB ); - if ( m_sd1.getSizeBytes()==0 ) pTotalDiffStatus->bTextAEqB=false; - - pp.step(); - } - else - { - if (bLoadFiles) - { - pp.setInformation(i18n("Loading C")); - m_sd3.readAndPreprocess(m_pOptionDialog->m_pEncodingC); - pp.step(); - } - - pTotalDiffStatus->bBinaryAEqB = m_sd1.isBinaryEqualWith( m_sd2 ); - pTotalDiffStatus->bBinaryAEqC = m_sd1.isBinaryEqualWith( m_sd3 ); - pTotalDiffStatus->bBinaryBEqC = m_sd3.isBinaryEqualWith( m_sd2 ); - - pp.setInformation(i18n("Diff: A <-> B")); - runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2 ); - pp.step(); - pp.setInformation(i18n("Diff: B <-> C")); - runDiff( m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList23,2,3 ); - pp.step(); - pp.setInformation(i18n("Diff: A <-> C")); - runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList13,1,3 ); - pp.step(); - - calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList ); - calcDiff3LineListUsingAC( &m_diffList13, m_diff3LineList ); - correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList ); - calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList ); - - calcDiff3LineListUsingBC( &m_diffList23, m_diff3LineList ); - correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList ); - calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList ); - debugLineCheck( m_diff3LineList, m_sd1.getSizeLines(), 1 ); - debugLineCheck( m_diff3LineList, m_sd2.getSizeLines(), 2 ); - debugLineCheck( m_diff3LineList, m_sd3.getSizeLines(), 3 ); - - pp.setInformation(i18n("Linediff: A <-> B")); - fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqB ); - pp.step(); - pp.setInformation(i18n("Linediff: B <-> C")); - fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay(), pTotalDiffStatus->bTextBEqC ); - pp.step(); - pp.setInformation(i18n("Linediff: A <-> C")); - fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay(), pTotalDiffStatus->bTextAEqC ); - pp.step(); - if ( m_sd1.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextAEqC=false; } - if ( m_sd2.getSizeBytes()==0 ) { pTotalDiffStatus->bTextAEqB=false; pTotalDiffStatus->bTextBEqC=false; } - } - m_diffBufferInfo.init( &m_diff3LineList, &m_diff3LineVector, - m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), - m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), - m_sd3.getLineDataForDiff(), m_sd3.getSizeLines() ); - calcWhiteDiff3Lines( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff() ); - calcDiff3LineVector( m_diff3LineList, m_diff3LineVector ); - - // Calc needed lines for display - m_neededLines = m_diff3LineList.size(); - - m_pDirectoryMergeWindow->allowResizeEvents(false); - initView(); - if ( !bGUI ) - { - m_pMainWidget->hide(); - } - m_pDirectoryMergeWindow->allowResizeEvents(true); - - m_bTripleDiff = ! m_sd3.isEmpty(); - - if ( bGUI ) - { - const ManualDiffHelpList* pMDHL = &m_manualDiffHelpList; - m_pDiffTextWindow1->init( m_sd1.getAliasName(), - m_sd1.getLineDataForDisplay(), m_sd1.getSizeLines(), &m_diff3LineVector, pMDHL, m_bTripleDiff ); - m_pDiffTextWindow2->init( m_sd2.getAliasName(), - m_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(), &m_diff3LineVector, pMDHL, m_bTripleDiff ); - m_pDiffTextWindow3->init( m_sd3.getAliasName(), - m_sd3.getLineDataForDisplay(), m_sd3.getSizeLines(), &m_diff3LineVector, pMDHL, m_bTripleDiff ); - - if (m_bTripleDiff) m_pDiffTextWindowFrame3->show(); - else m_pDiffTextWindowFrame3->hide(); - } - - m_bOutputModified = bVisibleMergeResultWindow; - - m_pMergeResultWindow->init( - m_sd1.getLineDataForDisplay(), m_sd1.getSizeLines(), - m_sd2.getLineDataForDisplay(), m_sd2.getSizeLines(), - m_bTripleDiff ? m_sd3.getLineDataForDisplay() : 0, m_sd3.getSizeLines(), - &m_diff3LineList, - pTotalDiffStatus, - m_outputFilename.isEmpty() ? QString("unnamed.txt") : m_outputFilename - ); - - if ( !bGUI ) - { - // We now have all needed information. The rest below is only for GUI-activation. - m_sd1.reset(); - m_sd2.reset(); - m_sd3.reset(); - return; - } - - m_pOverview->init(&m_diff3LineList, m_bTripleDiff ); - m_pDiffVScrollBar->setValue( 0 ); - m_pHScrollBar->setValue( 0 ); - m_pMergeVScrollBar->setValue( 0 ); - - m_pDiffTextWindow1->setPaintingAllowed( true ); - m_pDiffTextWindow2->setPaintingAllowed( true ); - m_pDiffTextWindow3->setPaintingAllowed( true ); - m_pOverview->setPaintingAllowed( true ); - m_pMergeResultWindow->setPaintingAllowed( true ); - - - if ( !bVisibleMergeResultWindow ) - m_pMergeWindowFrame->hide(); - else - m_pMergeWindowFrame->show(); - - // Calc max width for display - m_maxWidth = max2( m_pDiffTextWindow1->getNofColumns(), m_pDiffTextWindow2->getNofColumns() ); - m_maxWidth = max2( m_maxWidth, m_pDiffTextWindow3->getNofColumns() ); - m_maxWidth += 5; - - // Try to create a meaningful but not too long caption - if ( !isPart() ) - { - // 1. If the filenames are equal then show only one filename - QString caption; - QString a1 = m_sd1.getAliasName(); - QString a2 = m_sd2.getAliasName(); - QString a3 = m_sd3.getAliasName(); - QString f1, f2, f3; - int p1,p2,p3; - if ( !a1.isEmpty() && (p1=a1.findRev('/'))>=0 ) - f1 = a1.mid( p1+1 ); - if ( !a2.isEmpty() && (p2=a2.findRev('/'))>=0 ) - f2 = a2.mid( p2+1 ); - if ( !a3.isEmpty() && (p3=a3.findRev('/'))>=0 ) - f3 = a3.mid( p3+1 ); - if ( !f1.isEmpty() ) - { - if ( ( f2.isEmpty() && f3.isEmpty() ) || - (f2.isEmpty() && f1==f3) || ( f3.isEmpty() && f1==f2 ) || (f1==f2 && f1==f3)) - caption = ".../"+f1; - } - else if ( ! f2.isEmpty() ) - { - if ( f3.isEmpty() || f2==f3 ) - caption = ".../"+f2; - } - else if ( ! f3.isEmpty() ) - caption = ".../"+f3; - - // 2. If the files don't have the same name then show all names - if ( caption.isEmpty() && (!f1.isEmpty() || !f2.isEmpty() || !f3.isEmpty()) ) - { - caption = ( f1.isEmpty()? QString("") : QString(".../")+f1 ); - caption += QString(caption.isEmpty() || f2.isEmpty() ? "" : " <-> ") + ( f2.isEmpty()? QString("") : QString(".../")+f2 ); - caption += QString(caption.isEmpty() || f3.isEmpty() ? "" : " <-> ") + ( f3.isEmpty()? QString("") : QString(".../")+f3 ) ; - } - - m_pKDiff3Shell->setCaption( caption.isEmpty() ? QString("KDiff3") : caption+QString(" - KDiff3")); - } - - if ( bLoadFiles ) - { - if ( bVisibleMergeResultWindow && !bAuto ) - m_pMergeResultWindow->showNrOfConflicts(); - else if ( !bAuto && - // Avoid showing this message during startup without parameters. - !( m_sd1.getAliasName().isEmpty() && m_sd2.getAliasName().isEmpty() && m_sd3.getAliasName().isEmpty() ) && - ( m_sd1.isValid() && m_sd2.isValid() && m_sd3.isValid() ) - ) - { - QString totalInfo; - if ( pTotalDiffStatus->bBinaryAEqB && pTotalDiffStatus->bBinaryAEqC ) - totalInfo += i18n("All input files are binary equal."); - else if ( pTotalDiffStatus->bTextAEqB && pTotalDiffStatus->bTextAEqC ) - totalInfo += i18n("All input files contain the same text, but are not binary equal."); - else { - if ( pTotalDiffStatus->bBinaryAEqB ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("B"); - else if ( pTotalDiffStatus->bTextAEqB ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("B"); - if ( pTotalDiffStatus->bBinaryAEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("A").arg("C"); - else if ( pTotalDiffStatus->bTextAEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("A").arg("C"); - if ( pTotalDiffStatus->bBinaryBEqC ) totalInfo += i18n("Files %1 and %2 are binary equal.\n" ).arg("B").arg("C"); - else if ( pTotalDiffStatus->bTextBEqC ) totalInfo += i18n("Files %1 and %2 have equal text, but are not binary equal. \n").arg("B").arg("C"); - } - - if ( !totalInfo.isEmpty() ) - KMessageBox::information( this, totalInfo ); - } - - if ( bVisibleMergeResultWindow && (!m_sd1.isText() || !m_sd2.isText() || !m_sd3.isText()) ) - { - KMessageBox::information( this, i18n( - "Some inputfiles don't seem to be pure textfiles.\n" - "Note that the KDiff3-merge was not meant for binary data.\n" - "Continue at your own risk.") ); - } - } - - QTimer::singleShot( 10, this, SLOT(slotAfterFirstPaint()) ); - - if ( bVisibleMergeResultWindow && m_pMergeResultWindow ) - { - m_pMergeResultWindow->setFocus(); - } - else if(m_pDiffTextWindow1) - { - m_pDiffTextWindow1->setFocus(); - } -} - - -void KDiff3App::resizeDiffTextWindow(int newWidth, int newHeight) -{ - m_DTWHeight = newHeight; - - recalcWordWrap(); - - m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - newHeight) ); - m_pDiffVScrollBar->setPageStep( newHeight ); - m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); - - // The second window has a somewhat inverse width - - m_pHScrollBar->setRange(0, max2(0, m_maxWidth - newWidth) ); - m_pHScrollBar->setPageStep( newWidth ); -} - -void KDiff3App::resizeMergeResultWindow() -{ - MergeResultWindow* p = m_pMergeResultWindow; - m_pMergeVScrollBar->setRange(0, max2(0, p->getNofLines() - p->getNofVisibleLines()) ); - m_pMergeVScrollBar->setPageStep( p->getNofVisibleLines() ); - - // The second window has a somewhat inverse width -// m_pHScrollBar->setRange(0, max2(0, m_maxWidth - newWidth) ); -// m_pHScrollBar->setPageStep( newWidth ); -} - -void KDiff3App::scrollDiffTextWindow( int deltaX, int deltaY ) -{ - if ( deltaY!= 0 ) - { - m_pDiffVScrollBar->setValue( m_pDiffVScrollBar->value() + deltaY ); - m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); - } - if ( deltaX!= 0) - m_pHScrollBar->QScrollBar::setValue( m_pHScrollBar->value() + deltaX ); -} - -void KDiff3App::scrollMergeResultWindow( int deltaX, int deltaY ) -{ - if ( deltaY!= 0 ) - m_pMergeVScrollBar->setValue( m_pMergeVScrollBar->value() + deltaY ); - if ( deltaX!= 0) - m_pHScrollBar->setValue( m_pHScrollBar->value() + deltaX ); -} - -void KDiff3App::setDiff3Line( int line ) -{ - m_pDiffVScrollBar->setValue( line ); -} - -void KDiff3App::sourceMask( int srcMask, int enabledMask ) -{ - chooseA->setChecked( (srcMask & 1) != 0 ); - chooseB->setChecked( (srcMask & 2) != 0 ); - chooseC->setChecked( (srcMask & 4) != 0 ); - chooseA->setEnabled( (enabledMask & 1) != 0 ); - chooseB->setEnabled( (enabledMask & 2) != 0 ); - chooseC->setEnabled( (enabledMask & 4) != 0 ); -} - - - -// Function uses setMinSize( sizeHint ) before adding the widget. -// void addWidget(QBoxLayout* layout, QWidget* widget); -template -void addWidget( L* layout, W* widget) -{ - QSize s = widget->sizeHint(); - widget->setMinimumSize( QSize(max2(s.width(),0),max2(s.height(),0) ) ); - layout->addWidget( widget ); -} - -void KDiff3App::initView() -{ - // set the main widget here - Q3ValueList oldHeights; - if ( m_pDirectoryMergeSplitter->isVisible() ) - { - oldHeights = m_pMainSplitter->sizes(); - } - - if ( m_pMainWidget != 0 ) - { - return; - //delete m_pMainWidget; - } - m_pMainWidget = new QWidget(m_pMainSplitter); - - 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 ); - Q3HBoxLayout* pDiffHLayout = new Q3HBoxLayout( pDiffWindowFrame,0,0 ); - - m_pDiffWindowSplitter = new QSplitter( pDiffWindowFrame ); - m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? Qt::Horizontal : Qt::Vertical ); - pDiffHLayout->addWidget( m_pDiffWindowSplitter ); - - m_pOverview = new Overview( pDiffWindowFrame, m_pOptionDialog ); - pDiffHLayout->addWidget(m_pOverview); - connect( m_pOverview, SIGNAL(setLine(int)), this, SLOT(setDiff3Line(int)) ); - //connect( m_pOverview, SIGNAL(afterFirstPaint()), this, SLOT(slotAfterFirstPaint())); - - m_pDiffVScrollBar = new QScrollBar( Qt::Vertical, pDiffWindowFrame ); - pDiffHLayout->addWidget( m_pDiffVScrollBar ); - - m_pDiffTextWindowFrame1 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 1 ); - m_pDiffTextWindowFrame2 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 2 ); - m_pDiffTextWindowFrame3 = new DiffTextWindowFrame( m_pDiffWindowSplitter, statusBar(), m_pOptionDialog, 3 ); - m_pDiffTextWindow1 = m_pDiffTextWindowFrame1->getDiffTextWindow(); - m_pDiffTextWindow2 = m_pDiffTextWindowFrame2->getDiffTextWindow(); - m_pDiffTextWindow3 = m_pDiffTextWindowFrame3->getDiffTextWindow(); - connect(m_pDiffTextWindowFrame1, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); - connect(m_pDiffTextWindowFrame2, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); - connect(m_pDiffTextWindowFrame3, SIGNAL(fileNameChanged(const QString&,int)), this, SLOT(slotFileNameChanged(const QString&,int))); - - // Merge window - m_pMergeWindowFrame = new QWidget( pVSplitter ); - Q3HBoxLayout* pMergeHLayout = new Q3HBoxLayout( m_pMergeWindowFrame,0,0 ); - - m_pMergeResultWindow = new MergeResultWindow( m_pMergeWindowFrame, m_pOptionDialog, statusBar() ); - pMergeHLayout->addWidget( m_pMergeResultWindow ); - - m_pMergeVScrollBar = new QScrollBar( Qt::Vertical, m_pMergeWindowFrame ); - pMergeHLayout->addWidget( m_pMergeVScrollBar ); - - autoAdvance->setEnabled(true); - - Q3ValueList 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 - - 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 ); - pHScrollBarLayout->addWidget( m_pCornerWidget ); - - - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pOverview, SLOT(setFirstLine(int))); - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow1, SLOT(setFirstLine(int))); - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow1, SLOT(setFirstColumn(int))); - connect( m_pDiffTextWindow1, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); - connect( m_pDiffTextWindow1, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); - connect( m_pDiffTextWindow1, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); - m_pDiffTextWindow1->installEventFilter( this ); - - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow2, SLOT(setFirstLine(int))); - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow2, SLOT(setFirstColumn(int))); - connect( m_pDiffTextWindow2, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); - connect( m_pDiffTextWindow2, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); - connect( m_pDiffTextWindow2, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); - m_pDiffTextWindow2->installEventFilter( this ); - - connect( m_pDiffVScrollBar, SIGNAL(valueChanged(int)), m_pDiffTextWindow3, SLOT(setFirstLine(int))); - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), m_pDiffTextWindow3, SLOT(setFirstColumn(int))); - connect( m_pDiffTextWindow3, SIGNAL(newSelection()), this, SLOT(slotSelectionStart())); - connect( m_pDiffTextWindow3, SIGNAL(selectionEnd()), this, SLOT(slotSelectionEnd())); - connect( m_pDiffTextWindow3, SIGNAL(scroll(int,int)), this, SLOT(scrollDiffTextWindow(int,int))); - m_pDiffTextWindow3->installEventFilter( this ); - - - MergeResultWindow* p = m_pMergeResultWindow; - connect( m_pMergeVScrollBar, SIGNAL(valueChanged(int)), p, SLOT(setFirstLine(int))); - - connect( m_pHScrollBar, SIGNAL(valueChanged2(int)), p, SLOT(setFirstColumn(int))); - connect( p, SIGNAL(scroll(int,int)), this, SLOT(scrollMergeResultWindow(int,int))); - connect( p, SIGNAL(sourceMask(int,int)), this, SLOT(sourceMask(int,int))); - connect( p, SIGNAL( resizeSignal() ),this, SLOT(resizeMergeResultWindow())); - connect( p, SIGNAL( selectionEnd() ), this, SLOT( slotSelectionEnd() ) ); - connect( p, SIGNAL( newSelection() ), this, SLOT( slotSelectionStart() ) ); - connect( p, SIGNAL( modified() ), this, SLOT( slotOutputModified() ) ); - connect( p, SIGNAL( updateAvailabilities() ), this, SLOT( slotUpdateAvailabilities() ) ); - connect( p, SIGNAL( showPopupMenu(const QPoint&) ), this, SLOT(showPopupMenu(const QPoint&))); - connect( p, SIGNAL( noRelevantChangesDetected() ), this, SLOT(slotNoRelevantChangesDetected())); - sourceMask(0,0); - - - connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow1, SLOT(setFastSelectorRange(int,int))); - connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow2, SLOT(setFastSelectorRange(int,int))); - connect( p, SIGNAL(setFastSelectorRange(int,int)), m_pDiffTextWindow3, SLOT(setFastSelectorRange(int,int))); - connect(m_pDiffTextWindow1, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); - connect(m_pDiffTextWindow2, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); - connect(m_pDiffTextWindow3, SIGNAL(setFastSelectorLine(int)), p, SLOT(slotSetFastSelectorLine(int))); - connect(m_pDiffTextWindow1, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); - connect(m_pDiffTextWindow2, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); - connect(m_pDiffTextWindow3, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); - connect(m_pDirectoryMergeInfo, SIGNAL(gotFocus()), p, SLOT(updateSourceMask())); - - connect( m_pDiffTextWindow1, SIGNAL( resizeSignal(int,int) ),this, SLOT(resizeDiffTextWindow(int,int))); - // The following two connects cause the wordwrap to be recalced thrice, just to make sure. Better than forgetting one. - connect( m_pDiffTextWindow2, SIGNAL( resizeSignal(int,int) ),this, SLOT(slotRecalcWordWrap())); - connect( m_pDiffTextWindow3, SIGNAL( resizeSignal(int,int) ),this, SLOT(slotRecalcWordWrap())); - - m_pDiffTextWindow1->setFocus(); - m_pMainWidget->setMinimumSize(50,50); - if ( m_pDirectoryMergeSplitter->isVisible() ) - { - if (oldHeights.count() < 2) - oldHeights.append(0); - if (oldHeights[1]==0) // Distribute the available space evenly between the two widgets. - { - oldHeights[1] = oldHeights[0]/2; - oldHeights[0] -= oldHeights[1]; - } - m_pMainSplitter->setSizes( oldHeights ); - } - m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); - //show(); - m_pMainWidget->show(); - showWindowA->setChecked( true ); - showWindowB->setChecked( true ); - showWindowC->setChecked( true ); -} - -static int calcManualDiffFirstDiff3LineIdx( const Diff3LineVector& d3lv, const ManualDiffHelpEntry& mdhe ) -{ - unsigned int i; - for( i = 0; i=0 && mdhe.lineA1==d3l.lineA || - mdhe.lineB1>=0 && mdhe.lineB1==d3l.lineB || - mdhe.lineC1>=0 && mdhe.lineC1==d3l.lineC ) - return i; - } - return -1; -} - -void KDiff3App::slotAfterFirstPaint() -{ - int newHeight = m_pDiffTextWindow1->getNofVisibleLines(); - int newWidth = m_pDiffTextWindow1->getNofVisibleColumns(); - m_DTWHeight = newHeight; - - recalcWordWrap(); - - m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - newHeight) ); - m_pDiffVScrollBar->setPageStep( newHeight ); - m_pOverview->setRange( m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep() ); - - // The second window has a somewhat inverse width - m_pHScrollBar->setRange(0, max2(0, m_maxWidth - newWidth) ); - m_pHScrollBar->setPageStep( newWidth ); - - int d3l=-1; - if ( ! m_manualDiffHelpList.empty() ) - d3l = calcManualDiffFirstDiff3LineIdx( m_diff3LineVector, m_manualDiffHelpList.front() ); - if ( d3l>=0 && m_pDiffTextWindow1 ) - { - int line = m_pDiffTextWindow1->convertDiff3LineIdxToLine( d3l ); - m_pDiffVScrollBar->setValue( max2(0,line-1) ); - } - else - { - m_pMergeResultWindow->slotGoTop(); - } - - if (m_pCornerWidget) - m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); - - slotUpdateAvailabilities(); -} - -void KDiff3App::resizeEvent(QResizeEvent* e) -{ - QSplitter::resizeEvent(e); - if (m_pCornerWidget) - m_pCornerWidget->setFixedSize( m_pDiffVScrollBar->width(), m_pHScrollBar->height() ); -} - - -bool KDiff3App::eventFilter( QObject* o, QEvent* e ) -{ - if( o == m_pMergeResultWindow ) - { - if ( e->type() == QEvent::KeyPress ) - { // key press - QKeyEvent *k = (QKeyEvent*)e; - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ControlModifier)!=0 ) - { - slotEditCopy(); - return true; - } - if (k->key()==Qt::Key_Insert && (k->state() & Qt::ShiftModifier)!=0 ) - { - slotEditPaste(); - return true; - } - if (k->key()==Qt::Key_Delete && (k->state() & Qt::ShiftModifier)!=0 ) - { - slotEditCut(); - return true; - } - } - return QSplitter::eventFilter( o, e ); // standard event processing - } - - if ( e->type() == QEvent::KeyPress ) // key press - { - QKeyEvent *k = (QKeyEvent*)e; - - 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::ShiftModifier)!=0 ) - { - slotEditPaste(); - return true; - } - int deltaX=0; - int deltaY=0; - int pageSize = m_DTWHeight; - switch( k->key() ) - { - case Qt::Key_Down: if (!bCtrl) ++deltaY; break; - case Qt::Key_Up: if (!bCtrl) --deltaY; break; - case Qt::Key_PageDown: if (!bCtrl) deltaY+=pageSize; break; - case Qt::Key_PageUp: if (!bCtrl) deltaY-=pageSize; break; - case Qt::Key_Left: if (!bCtrl) --deltaX; break; - case Qt::Key_Right: if (!bCtrl) ++deltaX; break; - case Qt::Key_Home: if ( bCtrl ) m_pDiffVScrollBar->setValue( 0 ); - else m_pHScrollBar->setValue( 0 ); - break; - case Qt::Key_End: if ( bCtrl ) m_pDiffVScrollBar->setValue( m_pDiffVScrollBar->maxValue() ); - else m_pHScrollBar->setValue( m_pHScrollBar->maxValue() ); - break; - default: break; - } - - scrollDiffTextWindow( deltaX, deltaY ); - - return true; // eat event - } - else if (e->type() == QEvent::Wheel ) // wheel event - { - QWheelEvent *w = (QWheelEvent*)e; - w->accept(); - - int deltaX=0; - - int d=w->delta(); - int deltaY = -d/120 * QApplication::wheelScrollLines(); - - scrollDiffTextWindow( deltaX, deltaY ); - return true; - } - else if (e->type() == QEvent::Drop ) - { - QDropEvent* pDropEvent = static_cast(e); - pDropEvent->accept(); - - if ( Q3UriDrag::canDecode(pDropEvent) ) - { -#ifdef KREPLACEMENTS_H - QStringList stringList; - Q3UriDrag::decodeLocalFiles( pDropEvent, stringList ); - if ( canContinue() && !stringList.isEmpty() ) - { - raise(); - QString filename = stringList.first(); - if ( o == m_pDiffTextWindow1 ) m_sd1.setFilename( filename ); - else if ( o == m_pDiffTextWindow2 ) m_sd2.setFilename( filename ); - else if ( o == m_pDiffTextWindow3 ) m_sd3.setFilename( filename ); - init(); - } -#else - KURL::List urlList; - KURLDrag::decode( pDropEvent, urlList ); - if ( canContinue() && !urlList.isEmpty() ) - { - raise(); - FileAccess fa( urlList.first().url() ); - if ( o == m_pDiffTextWindow1 ) m_sd1.setFileAccess( fa ); - else if ( o == m_pDiffTextWindow2 ) m_sd2.setFileAccess( fa ); - else if ( o == m_pDiffTextWindow3 ) m_sd3.setFileAccess( fa ); - init(); - } -#endif - } - else if ( Q3TextDrag::canDecode(pDropEvent) ) - { - QString text; - bool bDecodeSuccess = Q3TextDrag::decode( pDropEvent, text ); - if ( bDecodeSuccess && canContinue() ) - { - raise(); - if ( o == m_pDiffTextWindow1 ) m_sd1.setData(text); - else if ( o == m_pDiffTextWindow2 ) m_sd2.setData(text); - else if ( o == m_pDiffTextWindow3 ) m_sd3.setData(text); - init(); - } - } - - return true; - } - return QSplitter::eventFilter( o, e ); // standard event processing -} - - - - -void KDiff3App::slotFileOpen() -{ - if ( !canContinue() ) return; - - if ( m_pDirectoryMergeWindow->isDirectoryMergeInProgress() ) - { - int result = KMessageBox::warningYesNo(this, - i18n("You are currently doing a directory merge. Are you sure, you want to abort?"), - i18n("Warning"), i18n("Abort"), i18n("Continue Merging") ); - if ( result!=KMessageBox::Yes ) - return; - } - - - slotStatusMsg(i18n("Opening files...")); - - for(;;) - { - OpenDialog d(this, - m_sd1.isFromBuffer() ? QString("") : m_sd1.getAliasName(), - m_sd2.isFromBuffer() ? QString("") : m_sd2.getAliasName(), - m_sd3.isFromBuffer() ? QString("") : m_sd3.getAliasName(), - !m_outputFilename.isEmpty(), - m_bDefaultFilename ? QString("") : m_outputFilename, - SLOT(slotConfigure()), m_pOptionDialog ); - int status = d.exec(); - if ( status == QDialog::Accepted ) - { - m_sd1.setFilename( d.m_pLineA->currentText() ); - m_sd2.setFilename( d.m_pLineB->currentText() ); - m_sd3.setFilename( d.m_pLineC->currentText() ); - - if( d.m_pMerge->isChecked() ) - { - if ( d.m_pLineOut->currentText().isEmpty() ) - { - m_outputFilename = "unnamed.txt"; - m_bDefaultFilename = true; - } - else - { - m_outputFilename = d.m_pLineOut->currentText(); - m_bDefaultFilename = false; - } - } - else - m_outputFilename = ""; - - bool bSuccess = improveFilenames(false); - if ( !bSuccess ) - continue; - - if ( m_bDirCompare ) - { - m_pDirectoryMergeSplitter->show(); - if ( m_pMainWidget!=0 ) - { - m_pMainWidget->hide(); - } - break; - } - else - { - m_pDirectoryMergeSplitter->hide(); - init(); - - if ( ! m_sd1.isEmpty() && !m_sd1.hasData() || - ! m_sd2.isEmpty() && !m_sd2.hasData() || - ! m_sd3.isEmpty() && !m_sd3.hasData() ) - { - QString text( i18n("Opening of these files failed:") ); - text += "\n\n"; - if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) - text += " - " + m_sd1.getAliasName() + "\n"; - if ( ! m_sd2.isEmpty() && !m_sd2.hasData() ) - text += " - " + m_sd2.getAliasName() + "\n"; - if ( ! m_sd3.isEmpty() && !m_sd3.hasData() ) - text += " - " + m_sd3.getAliasName() + "\n"; - - KMessageBox::sorry( this, text, i18n("File open error") ); - continue; - } - } - } - break; - } - - slotUpdateAvailabilities(); - slotStatusMsg(i18n("Ready.")); -} - -void KDiff3App::slotFileOpen2(QString fn1, QString fn2, QString fn3, QString ofn, - QString an1, QString an2, QString an3, TotalDiffStatus* pTotalDiffStatus ) -{ - if ( !canContinue() ) return; - - if(fn1=="" && fn2=="" && fn3=="" && ofn=="" && m_pMainWidget!=0 ) - { - m_pMainWidget->hide(); - return; - } - - slotStatusMsg(i18n("Opening files...")); - - m_sd1.setFilename( fn1 ); - m_sd2.setFilename( fn2 ); - m_sd3.setFilename( fn3 ); - - m_sd1.setAliasName( an1 ); - m_sd2.setAliasName( an2 ); - m_sd3.setAliasName( an3 ); - - if ( ! ofn.isEmpty() ) - { - m_outputFilename = ofn; - m_bDefaultFilename = false; - } - else - { - m_outputFilename = ""; - m_bDefaultFilename = true; - } - - bool bDirCompare = m_bDirCompare; - improveFilenames(true); // Create new window for KDiff3 for directory comparison. - - if( m_bDirCompare ) - { - } - else - { - m_bDirCompare = bDirCompare; // Don't allow this to change here. - init( false, pTotalDiffStatus ); - - if ( pTotalDiffStatus!=0 ) - return; - - if ( ! m_sd1.isEmpty() && ! m_sd1.hasData() || - ! m_sd2.isEmpty() && ! m_sd2.hasData() || - ! m_sd3.isEmpty() && ! m_sd3.hasData() ) - { - QString text( i18n("Opening of these files failed:") ); - text += "\n\n"; - if ( ! m_sd1.isEmpty() && !m_sd1.hasData() ) - text += " - " + m_sd1.getAliasName() + "\n"; - if ( ! m_sd2.isEmpty() && !m_sd2.hasData() ) - text += " - " + m_sd2.getAliasName() + "\n"; - if ( ! m_sd3.isEmpty() && !m_sd3.hasData() ) - text += " - " + m_sd3.getAliasName() + "\n"; - - KMessageBox::sorry( this, text, i18n("File open error") ); - } - else - { - if ( m_pDirectoryMergeWindow!=0 && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) - { - slotDirViewToggle(); - } - } - } - slotStatusMsg(i18n("Ready.")); -} - - -void KDiff3App::slotFileNameChanged(const QString& fileName, int winIdx) -{ - QString fn1 = m_sd1.getFilename(); - QString an1 = m_sd1.getAliasName(); - QString fn2 = m_sd2.getFilename(); - QString an2 = m_sd2.getAliasName(); - QString fn3 = m_sd3.getFilename(); - QString an3 = m_sd3.getAliasName(); - if (winIdx==1) { fn1 = fileName; an1 = ""; } - if (winIdx==2) { fn2 = fileName; an2 = ""; } - if (winIdx==3) { fn3 = fileName; an3 = ""; } - - slotFileOpen2( fn1, fn2, fn3, m_outputFilename, an1, an2, an3, 0 ); -} - - -void KDiff3App::slotEditCut() -{ - slotStatusMsg(i18n("Cutting selection...")); - - QString s; - if ( m_pMergeResultWindow!=0 ) - { - s = m_pMergeResultWindow->getSelection(); - m_pMergeResultWindow->deleteSelection(); - - m_pMergeResultWindow->update(); - } - - if ( !s.isNull() ) - { - QApplication::clipboard()->setText( s, QClipboard::Clipboard ); - } - - slotStatusMsg(i18n("Ready.")); -} - -void KDiff3App::slotEditCopy() -{ - slotStatusMsg(i18n("Copying selection to clipboard...")); - QString s; - if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); - if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection(); - if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection(); - if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); - if ( !s.isNull() ) - { - QApplication::clipboard()->setText( s, QClipboard::Clipboard ); - } - - slotStatusMsg(i18n("Ready.")); -} - -void KDiff3App::slotEditPaste() -{ - slotStatusMsg(i18n("Inserting clipboard contents...")); - - if ( m_pMergeResultWindow!=0 && m_pMergeResultWindow->isVisible() ) - { - m_pMergeResultWindow->pasteClipboard(false); - } - else if ( canContinue() ) - { - if ( m_pDiffTextWindow1->hasFocus() ) - { - m_sd1.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); - init(); - } - else if ( m_pDiffTextWindow2->hasFocus() ) - { - m_sd2.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); - init(); - } - else if ( m_pDiffTextWindow3->hasFocus() ) - { - m_sd3.setData( QApplication::clipboard()->text(QClipboard::Clipboard) ); - init(); - } - } - - slotStatusMsg(i18n("Ready.")); -} - -void KDiff3App::slotEditSelectAll() -{ - int l=0,p=0; // needed as dummy return values - if ( m_pMergeResultWindow && m_pMergeResultWindow->hasFocus() ) { m_pMergeResultWindow->setSelection( 0,0,m_pMergeResultWindow->getNofLines(),0); } - else if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->hasFocus() ) { m_pDiffTextWindow1 ->setSelection( 0,0,m_pDiffTextWindow1->getNofLines(),0,l,p); } - else if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->hasFocus() ) { m_pDiffTextWindow2 ->setSelection( 0,0,m_pDiffTextWindow2->getNofLines(),0,l,p); } - else if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->hasFocus() ) { m_pDiffTextWindow3 ->setSelection( 0,0,m_pDiffTextWindow3->getNofLines(),0,l,p); } - - slotStatusMsg(i18n("Ready.")); -} - -void KDiff3App::slotGoCurrent() -{ - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoCurrent(); -} -void KDiff3App::slotGoTop() -{ - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoTop(); -} -void KDiff3App::slotGoBottom() -{ - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoBottom(); -} -void KDiff3App::slotGoPrevUnsolvedConflict() -{ - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoPrevUnsolvedConflict(); -} -void KDiff3App::slotGoNextUnsolvedConflict() -{ - m_bTimerBlock = false; - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoNextUnsolvedConflict(); -} -void KDiff3App::slotGoPrevConflict() -{ - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoPrevConflict(); -} -void KDiff3App::slotGoNextConflict() -{ - m_bTimerBlock = false; - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoNextConflict(); -} -void KDiff3App::slotGoPrevDelta() -{ - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoPrevDelta(); -} -void KDiff3App::slotGoNextDelta() -{ - if (m_pMergeResultWindow) m_pMergeResultWindow->slotGoNextDelta(); -} - -void KDiff3App::choose( int choice ) -{ - if (!m_bTimerBlock ) - { - if ( m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->hasFocus() ) - { - if (choice==A) m_pDirectoryMergeWindow->slotCurrentChooseA(); - if (choice==B) m_pDirectoryMergeWindow->slotCurrentChooseB(); - if (choice==C) m_pDirectoryMergeWindow->slotCurrentChooseC(); - - chooseA->setChecked(false); - chooseB->setChecked(false); - chooseC->setChecked(false); - } - else if ( m_pMergeResultWindow ) - { - m_pMergeResultWindow->choose( choice ); - if ( autoAdvance->isChecked() ) - { - m_bTimerBlock = true; - QTimer::singleShot( m_pOptionDialog->m_autoAdvanceDelay, this, SLOT( slotGoNextUnsolvedConflict() ) ); - } - } - } -} - -void KDiff3App::slotChooseA() { choose( A ); } -void KDiff3App::slotChooseB() { choose( B ); } -void KDiff3App::slotChooseC() { choose( C ); } - -// bConflictsOnly automatically choose for conflicts only (true) or for everywhere -static void mergeChooseGlobal( MergeResultWindow* pMRW, int selector, bool bConflictsOnly, bool bWhiteSpaceOnly ) -{ - if ( pMRW ) - { - pMRW->chooseGlobal(selector, bConflictsOnly, bWhiteSpaceOnly ); - } -} - -void KDiff3App::slotChooseAEverywhere() { mergeChooseGlobal( m_pMergeResultWindow, A, false, false ); } -void KDiff3App::slotChooseBEverywhere() { mergeChooseGlobal( m_pMergeResultWindow, B, false, false ); } -void KDiff3App::slotChooseCEverywhere() { mergeChooseGlobal( m_pMergeResultWindow, C, false, false ); } -void KDiff3App::slotChooseAForUnsolvedConflicts() { mergeChooseGlobal( m_pMergeResultWindow, A, true, false ); } -void KDiff3App::slotChooseBForUnsolvedConflicts() { mergeChooseGlobal( m_pMergeResultWindow, B, true, false ); } -void KDiff3App::slotChooseCForUnsolvedConflicts() { mergeChooseGlobal( m_pMergeResultWindow, C, true, false ); } -void KDiff3App::slotChooseAForUnsolvedWhiteSpaceConflicts() { mergeChooseGlobal( m_pMergeResultWindow, A, true, true ); } -void KDiff3App::slotChooseBForUnsolvedWhiteSpaceConflicts() { mergeChooseGlobal( m_pMergeResultWindow, B, true, true ); } -void KDiff3App::slotChooseCForUnsolvedWhiteSpaceConflicts() { mergeChooseGlobal( m_pMergeResultWindow, C, true, true ); } - - -void KDiff3App::slotAutoSolve() -{ - if (m_pMergeResultWindow ) - { - m_pMergeResultWindow->slotAutoSolve(); - // m_pMergeWindowFrame->show(); incompatible with bPreserveCarriageReturn - m_pMergeResultWindow->showNrOfConflicts(); - slotUpdateAvailabilities(); - } -} - -void KDiff3App::slotUnsolve() -{ - if (m_pMergeResultWindow ) - { - m_pMergeResultWindow->slotUnsolve(); - } -} - -void KDiff3App::slotMergeHistory() -{ - if (m_pMergeResultWindow ) - { - m_pMergeResultWindow->slotMergeHistory(); - } -} - -void KDiff3App::slotRegExpAutoMerge() -{ - if (m_pMergeResultWindow ) - { - m_pMergeResultWindow->slotRegExpAutoMerge(); - } -} - -void KDiff3App::slotSplitDiff() -{ - int firstLine = -1; - int lastLine = -1; - DiffTextWindow* pDTW=0; - if ( m_pDiffTextWindow1 ) { pDTW=m_pDiffTextWindow1; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } - if ( firstLine<0 && m_pDiffTextWindow2 ) { pDTW=m_pDiffTextWindow2; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } - if ( firstLine<0 && m_pDiffTextWindow3 ) { pDTW=m_pDiffTextWindow3; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } - if ( pDTW && firstLine>=0 && m_pMergeResultWindow) - { - pDTW->resetSelection(); - - m_pMergeResultWindow->slotSplitDiff( firstLine, lastLine ); - } -} - -void KDiff3App::slotJoinDiffs() -{ - int firstLine = -1; - int lastLine = -1; - DiffTextWindow* pDTW=0; - if ( m_pDiffTextWindow1 ) { pDTW=m_pDiffTextWindow1; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } - if ( firstLine<0 && m_pDiffTextWindow2 ) { pDTW=m_pDiffTextWindow2; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } - if ( firstLine<0 && m_pDiffTextWindow3 ) { pDTW=m_pDiffTextWindow3; pDTW->getSelectionRange(&firstLine, &lastLine, eD3LLineCoords); } - if ( pDTW && firstLine>=0 && m_pMergeResultWindow) - { - pDTW->resetSelection(); - - m_pMergeResultWindow->slotJoinDiffs( firstLine, lastLine ); - } -} - -void KDiff3App::slotConfigure() -{ - m_pOptionDialog->setState(); - m_pOptionDialog->incInitialSize ( QSize(0,40) ); - m_pOptionDialog->exec(); - slotRefresh(); -} - -void KDiff3App::slotConfigureKeys() -{ - KKeyDialog::configure(actionCollection(), this); -} - -void KDiff3App::slotRefresh() -{ - if (m_pDiffTextWindow1!=0) - { - m_pDiffTextWindow1->setFont(m_pOptionDialog->m_font); - m_pDiffTextWindow1->update(); - } - if (m_pDiffTextWindow2!=0) - { - m_pDiffTextWindow2->setFont(m_pOptionDialog->m_font); - m_pDiffTextWindow2->update(); - } - if (m_pDiffTextWindow3!=0) - { - m_pDiffTextWindow3->setFont(m_pOptionDialog->m_font); - m_pDiffTextWindow3->update(); - } - if (m_pMergeResultWindow!=0) - { - m_pMergeResultWindow->setFont(m_pOptionDialog->m_font); - m_pMergeResultWindow->update(); - } - if (m_pHScrollBar!=0) - { - m_pHScrollBar->setAgain(); - } - if ( m_pDiffWindowSplitter!=0 ) - { - m_pDiffWindowSplitter->setOrientation( m_pOptionDialog->m_bHorizDiffWindowSplitting ? Qt::Horizontal : Qt::Vertical ); - } - if ( m_pDirectoryMergeWindow ) - { - m_pDirectoryMergeWindow->updateFileVisibilities(); - } -} - -void KDiff3App::slotSelectionStart() -{ - //editCopy->setEnabled( false ); - //editCut->setEnabled( false ); - - const QObject* s = sender(); - if (m_pDiffTextWindow1 && s!=m_pDiffTextWindow1) m_pDiffTextWindow1->resetSelection(); - if (m_pDiffTextWindow2 && s!=m_pDiffTextWindow2) m_pDiffTextWindow2->resetSelection(); - if (m_pDiffTextWindow3 && s!=m_pDiffTextWindow3) m_pDiffTextWindow3->resetSelection(); - if (m_pMergeResultWindow && s!=m_pMergeResultWindow) m_pMergeResultWindow->resetSelection(); -} - -void KDiff3App::slotSelectionEnd() -{ - //const QObject* s = sender(); - //editCopy->setEnabled(true); - //editCut->setEnabled( s==m_pMergeResultWindow ); - if ( m_pOptionDialog->m_bAutoCopySelection ) - { - slotEditCopy(); - } - else - { - QClipboard *clipBoard = QApplication::clipboard(); - - if (clipBoard->supportsSelection ()) - { - QString s; - if ( m_pDiffTextWindow1!=0 ) s = m_pDiffTextWindow1->getSelection(); - if ( s.isNull() && m_pDiffTextWindow2!=0 ) s = m_pDiffTextWindow2->getSelection(); - if ( s.isNull() && m_pDiffTextWindow3!=0 ) s = m_pDiffTextWindow3->getSelection(); - if ( s.isNull() && m_pMergeResultWindow!=0 ) s = m_pMergeResultWindow->getSelection(); - if ( !s.isNull() ) - { - clipBoard->setText( s, QClipboard::Selection ); - } - } - } -} - -void KDiff3App::slotClipboardChanged() -{ - QString s = QApplication::clipboard()->text(); - //editPaste->setEnabled(!s.isEmpty()); -} - -void KDiff3App::slotOutputModified() -{ - if ( !m_bOutputModified ) - { - m_bOutputModified=true; - slotUpdateAvailabilities(); - } -} - -void KDiff3App::slotAutoAdvanceToggled() -{ - m_pOptionDialog->m_bAutoAdvance = autoAdvance->isChecked(); -} - -void KDiff3App::slotWordWrapToggled() -{ - m_pOptionDialog->m_bWordWrap = wordWrap->isChecked(); - recalcWordWrap(); -} - -void KDiff3App::slotRecalcWordWrap() -{ - recalcWordWrap(); -} - -void KDiff3App::recalcWordWrap(int nofVisibleColumns) // nofVisibleColumns is >=0 only for printing, otherwise the really visible width is used -{ - bool bPrinting = nofVisibleColumns>=0; - int firstD3LIdx = 0; - if( m_pDiffTextWindow1 ) - firstD3LIdx = m_pDiffTextWindow1->convertLineToDiff3LineIdx( m_pDiffTextWindow1->getFirstLine() ); - - // Convert selection to D3L-coords (converting back happens in DiffTextWindow::recalcWordWrap() - if ( m_pDiffTextWindow1 ) - m_pDiffTextWindow1->convertSelectionToD3LCoords(); - if ( m_pDiffTextWindow2 ) - m_pDiffTextWindow2->convertSelectionToD3LCoords(); - if ( m_pDiffTextWindow3 ) - m_pDiffTextWindow3->convertSelectionToD3LCoords(); - - - if ( !m_diff3LineList.empty() && m_pOptionDialog->m_bWordWrap ) - { - Diff3LineList::iterator i; - int sumOfLines=0; - for ( i=m_diff3LineList.begin(); i!=m_diff3LineList.end(); ++i ) - { - Diff3Line& d3l = *i; - d3l.linesNeededForDisplay = 1; - d3l.sumLinesNeededForDisplay = sumOfLines; - sumOfLines += d3l.linesNeededForDisplay; - } - - // Let every window calc how many lines will be needed. - if ( m_pDiffTextWindow1 ) - m_pDiffTextWindow1->recalcWordWrap(true,0,nofVisibleColumns); - if ( m_pDiffTextWindow2 ) - m_pDiffTextWindow2->recalcWordWrap(true,0,nofVisibleColumns); - if ( m_pDiffTextWindow3 ) - m_pDiffTextWindow3->recalcWordWrap(true,0,nofVisibleColumns); - - sumOfLines=0; - for ( i=m_diff3LineList.begin(); i!=m_diff3LineList.end(); ++i ) - { - Diff3Line& d3l = *i; - d3l.sumLinesNeededForDisplay = sumOfLines; - sumOfLines += d3l.linesNeededForDisplay; - } - - // Finish the initialisation: - if ( m_pDiffTextWindow1 ) - m_pDiffTextWindow1->recalcWordWrap(true,sumOfLines,nofVisibleColumns); - if ( m_pDiffTextWindow2 ) - m_pDiffTextWindow2->recalcWordWrap(true,sumOfLines,nofVisibleColumns); - if ( m_pDiffTextWindow3 ) - m_pDiffTextWindow3->recalcWordWrap(true,sumOfLines,nofVisibleColumns); - - m_neededLines = sumOfLines; - } - else - { - m_neededLines = m_diff3LineVector.size(); - if ( m_pDiffTextWindow1 ) - m_pDiffTextWindow1->recalcWordWrap(false,0,0); - if ( m_pDiffTextWindow2 ) - m_pDiffTextWindow2->recalcWordWrap(false,0,0); - if ( m_pDiffTextWindow3 ) - m_pDiffTextWindow3->recalcWordWrap(false,0,0); - } - if (bPrinting) - return; - - m_pOverview->slotRedraw(); - if ( m_pDiffTextWindow1 ) - { - m_pDiffTextWindow1->setFirstLine( m_pDiffTextWindow1->convertDiff3LineIdxToLine( firstD3LIdx ) ); - m_pDiffTextWindow1->update(); - } - if ( m_pDiffTextWindow2 ) - { - m_pDiffTextWindow2->setFirstLine( m_pDiffTextWindow2->convertDiff3LineIdxToLine( firstD3LIdx ) ); - m_pDiffTextWindow2->update(); - } - if ( m_pDiffTextWindow3 ) - { - m_pDiffTextWindow3->setFirstLine( m_pDiffTextWindow3->convertDiff3LineIdxToLine( firstD3LIdx ) ); - m_pDiffTextWindow3->update(); - } - - m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - m_DTWHeight) ); - if ( m_pDiffTextWindow1 ) - { - m_pDiffVScrollBar->setValue( m_pDiffTextWindow1->convertDiff3LineIdxToLine( firstD3LIdx ) ); - - m_maxWidth = max3( m_pDiffTextWindow1->getNofColumns(), - m_pDiffTextWindow2->getNofColumns(), - m_pDiffTextWindow3->getNofColumns() ) + (m_pOptionDialog->m_bWordWrap ? 0 : 5); - - m_pHScrollBar->setRange(0, max2( 0, m_maxWidth - m_pDiffTextWindow1->getNofVisibleColumns() ) ); - m_pHScrollBar->setPageStep( m_pDiffTextWindow1->getNofVisibleColumns() ); - m_pHScrollBar->setValue(0); - } -} - -void KDiff3App::slotShowWhiteSpaceToggled() -{ - m_pOptionDialog->m_bShowWhiteSpaceCharacters = showWhiteSpaceCharacters->isChecked(); - m_pOptionDialog->m_bShowWhiteSpace = showWhiteSpace->isChecked(); - showWhiteSpaceCharacters->setEnabled( showWhiteSpace->isChecked() ); - if ( m_pDiffTextWindow1!=0 ) - m_pDiffTextWindow1->update(); - if ( m_pDiffTextWindow2!=0 ) - m_pDiffTextWindow2->update(); - if ( m_pDiffTextWindow3!=0 ) - m_pDiffTextWindow3->update(); - if ( m_pOverview!=0 ) - m_pOverview->slotRedraw(); -} - -void KDiff3App::slotShowLineNumbersToggled() -{ - m_pOptionDialog->m_bShowLineNumbers = showLineNumbers->isChecked(); - if ( m_pDiffTextWindow1!=0 ) - m_pDiffTextWindow1->update(); - if ( m_pDiffTextWindow2!=0 ) - m_pDiffTextWindow2->update(); - if ( m_pDiffTextWindow3!=0 ) - m_pDiffTextWindow3->update(); -} - -/// Return true for success, else false -bool KDiff3App::improveFilenames( bool bCreateNewInstance ) -{ - m_bDirCompare = false; - - FileAccess f1(m_sd1.getFilename()); - FileAccess f2(m_sd2.getFilename()); - FileAccess f3(m_sd3.getFilename()); - FileAccess f4(m_outputFilename); - - if ( f1.isFile() && f1.exists() ) - { - if ( f2.isDir() ) - { - f2.addPath( f1.fileName() ); - if ( f2.isFile() && f2.exists() ) - m_sd2.setFileAccess( f2 ); - } - if ( f3.isDir() ) - { - f3.addPath( f1.fileName() ); - if ( f3.isFile() && f3.exists() ) - m_sd3.setFileAccess( f3 ); - } - if ( f4.isDir() ) - { - f4.addPath( f1.fileName() ); - if ( f4.isFile() && f4.exists() ) - m_outputFilename = f4.absFilePath(); - } - } - else if ( f1.isDir() ) - { - m_bDirCompare = true; - if (bCreateNewInstance) - { - emit createNewInstance( f1.absFilePath(), f2.absFilePath(), f3.absFilePath() ); - } - else - { - FileAccess destDir; - if (!m_bDefaultFilename) destDir = f4; - m_pDirectoryMergeSplitter->show(); - if (m_pMainWidget!=0) m_pMainWidget->hide(); - - bool bSuccess = m_pDirectoryMergeWindow->init( - f1, f2, f3, - destDir, // Destdirname - !m_outputFilename.isEmpty() - ); - - m_bDirCompare = true; // This seems redundant but it might have beed reset during full analysis. - - if (bSuccess) - { - m_sd1.reset(); - if (m_pDiffTextWindow1!=0) m_pDiffTextWindow1->init(0,0,0,0,0,false); - m_sd2.reset(); - if (m_pDiffTextWindow2!=0) m_pDiffTextWindow2->init(0,0,0,0,0,false); - m_sd3.reset(); - if (m_pDiffTextWindow3!=0) m_pDiffTextWindow3->init(0,0,0,0,0,false); - } - slotUpdateAvailabilities(); - return bSuccess; - } - } - return true; -} - -void KDiff3App::slotReload() -{ - if ( !canContinue() ) return; - - init(); -} - -bool KDiff3App::canContinue() -{ - // First test if anything must be saved. - if(m_bOutputModified) - { - int result = KMessageBox::warningYesNoCancel(this, - i18n("The merge result hasn't been saved."), - i18n("Warning"), i18n("Save && Continue"), i18n("Continue Without Saving") ); - if ( result==KMessageBox::Cancel ) - return false; - else if ( result==KMessageBox::Yes ) - { - slotFileSave(); - if ( m_bOutputModified ) - { - KMessageBox::sorry(this, i18n("Saving the merge result failed."), i18n("Warning") ); - return false; - } - } - } - - m_bOutputModified = false; - return true; -} - -void KDiff3App::slotCheckIfCanContinue( bool* pbContinue ) -{ - if (pbContinue!=0) *pbContinue = canContinue(); -} - - -void KDiff3App::slotDirShowBoth() -{ - if( dirShowBoth->isChecked() ) - { - if ( m_bDirCompare ) - m_pDirectoryMergeSplitter->show(); - else - m_pDirectoryMergeSplitter->hide(); - - if ( m_pMainWidget!=0 ) - m_pMainWidget->show(); - } - else - { - if ( m_pMainWidget!=0 ) - { - m_pMainWidget->show(); - m_pDirectoryMergeSplitter->hide(); - } - else if ( m_bDirCompare ) - { - m_pDirectoryMergeSplitter->show(); - } - } - - slotUpdateAvailabilities(); -} - - -void KDiff3App::slotDirViewToggle() -{ - if ( m_bDirCompare ) - { - if( ! m_pDirectoryMergeSplitter->isVisible() ) - { - m_pDirectoryMergeSplitter->show(); - if (m_pMainWidget!=0) - m_pMainWidget->hide(); - } - else - { - if (m_pMainWidget!=0) - { - m_pDirectoryMergeSplitter->hide(); - m_pMainWidget->show(); - } - } - } - slotUpdateAvailabilities(); -} - -void KDiff3App::slotShowWindowAToggled() -{ - if ( m_pDiffTextWindow1!=0 ) - { - if ( showWindowA->isChecked() ) m_pDiffTextWindowFrame1->show(); - else m_pDiffTextWindowFrame1->hide(); - slotUpdateAvailabilities(); - } -} - -void KDiff3App::slotShowWindowBToggled() -{ - if ( m_pDiffTextWindow2!=0 ) - { - if ( showWindowB->isChecked() ) m_pDiffTextWindowFrame2->show(); - else m_pDiffTextWindowFrame2->hide(); - slotUpdateAvailabilities(); - } -} - -void KDiff3App::slotShowWindowCToggled() -{ - if ( m_pDiffTextWindow3!=0 ) - { - if ( showWindowC->isChecked() ) m_pDiffTextWindowFrame3->show(); - else m_pDiffTextWindowFrame3->hide(); - slotUpdateAvailabilities(); - } -} - -void KDiff3App::slotEditFind() -{ - m_pFindDialog->currentLine = 0; - m_pFindDialog->currentPos = 0; - m_pFindDialog->currentWindow = 1; - - if ( QDialog::Accepted == m_pFindDialog->exec() ) - { - slotEditFindNext(); - } -} - -void KDiff3App::slotEditFindNext() -{ - QString s = m_pFindDialog->m_pSearchString->text(); - if ( s.isEmpty() ) - { - slotEditFind(); - return; - } - - bool bDirDown = true; - bool bCaseSensitive = m_pFindDialog->m_pCaseSensitive->isChecked(); - - int d3vLine = m_pFindDialog->currentLine; - int posInLine = m_pFindDialog->currentPos; - int l=0; - int p=0; - if ( m_pFindDialog->currentWindow == 1 ) - { - if ( m_pFindDialog->m_pSearchInA->isChecked() && m_pDiffTextWindow1!=0 && - m_pDiffTextWindow1->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) - { - m_pDiffTextWindow1->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(), l, p ); - m_pDiffVScrollBar->setValue(l-m_pDiffVScrollBar->pageStep()/2); - m_pHScrollBar->setValue( max2( 0, p+(int)s.length()-m_pHScrollBar->pageStep()) ); - m_pFindDialog->currentLine = d3vLine; - m_pFindDialog->currentPos = posInLine + 1; - return; - } - m_pFindDialog->currentWindow = 2; - m_pFindDialog->currentLine = 0; - m_pFindDialog->currentPos = 0; - } - - d3vLine = m_pFindDialog->currentLine; - posInLine = m_pFindDialog->currentPos; - if ( m_pFindDialog->currentWindow == 2 ) - { - if ( m_pFindDialog->m_pSearchInB->isChecked() && m_pDiffTextWindow2!=0 && - m_pDiffTextWindow2->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) - { - m_pDiffTextWindow2->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(),l,p ); - m_pDiffVScrollBar->setValue(l-m_pDiffVScrollBar->pageStep()/2); - m_pHScrollBar->setValue( max2( 0, p+(int)s.length()-m_pHScrollBar->pageStep()) ); - m_pFindDialog->currentLine = d3vLine; - m_pFindDialog->currentPos = posInLine + 1; - return; - } - m_pFindDialog->currentWindow = 3; - m_pFindDialog->currentLine = 0; - m_pFindDialog->currentPos = 0; - } - - d3vLine = m_pFindDialog->currentLine; - posInLine = m_pFindDialog->currentPos; - if ( m_pFindDialog->currentWindow == 3 ) - { - if ( m_pFindDialog->m_pSearchInC->isChecked() && m_pDiffTextWindow3!=0 && - m_pDiffTextWindow3->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) - { - m_pDiffTextWindow3->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length(),l,p ); - m_pDiffVScrollBar->setValue(l-m_pDiffVScrollBar->pageStep()/2); - m_pHScrollBar->setValue( max2( 0, p+(int)s.length()-m_pHScrollBar->pageStep()) ); - m_pFindDialog->currentLine = d3vLine; - m_pFindDialog->currentPos = posInLine + 1; - return; - } - m_pFindDialog->currentWindow = 4; - m_pFindDialog->currentLine = 0; - m_pFindDialog->currentPos = 0; - } - - d3vLine = m_pFindDialog->currentLine; - posInLine = m_pFindDialog->currentPos; - if ( m_pFindDialog->currentWindow == 4 ) - { - if ( m_pFindDialog->m_pSearchInOutput->isChecked() && m_pMergeResultWindow!=0 && m_pMergeResultWindow->isVisible() && - m_pMergeResultWindow->findString( s, d3vLine, posInLine, bDirDown, bCaseSensitive ) ) - { - m_pMergeResultWindow->setSelection( d3vLine, posInLine, d3vLine, posInLine+s.length() ); - m_pMergeVScrollBar->setValue(d3vLine - m_pMergeVScrollBar->pageStep()/2); - m_pHScrollBar->setValue( max2( 0, posInLine+(int)s.length()-m_pHScrollBar->pageStep()) ); - m_pFindDialog->currentLine = d3vLine; - m_pFindDialog->currentPos = posInLine + 1; - return; - } - m_pFindDialog->currentWindow = 5; - m_pFindDialog->currentLine = 0; - m_pFindDialog->currentPos = 0; - } - - KMessageBox::information(this,i18n("Search complete."),i18n("Search Complete")); - m_pFindDialog->currentWindow = 1; - m_pFindDialog->currentLine = 0; - m_pFindDialog->currentPos = 0; -} - -void KDiff3App::slotMergeCurrentFile() -{ - if ( m_bDirCompare && m_pDirectoryMergeWindow->isVisible() && m_pDirectoryMergeWindow->isFileSelected() ) - { - m_pDirectoryMergeWindow->mergeCurrentFile(); - } - else if ( m_pMainWidget != 0 && m_pMainWidget->isVisible() ) - { - if ( !canContinue() ) return; - if ( m_outputFilename.isEmpty() ) - { - if ( !m_sd3.isEmpty() && !m_sd3.isFromBuffer() ) - { - m_outputFilename = m_sd3.getFilename(); - } - else if ( !m_sd2.isEmpty() && !m_sd2.isFromBuffer() ) - { - m_outputFilename = m_sd2.getFilename(); - } - else if ( !m_sd1.isEmpty() && !m_sd1.isFromBuffer() ) - { - m_outputFilename = m_sd1.getFilename(); - } - else - { - m_outputFilename = "unnamed.txt"; - m_bDefaultFilename = true; - } - } - init(); - } -} - -void KDiff3App::slotWinFocusNext() -{ - QWidget* focus = qApp->focusWidget(); - if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) - { - slotDirViewToggle(); - } - - std::list visibleWidgetList; - if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); - if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); - if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); - if ( m_pMergeResultWindow && m_pMergeResultWindow->isVisible() ) visibleWidgetList.push_back(m_pMergeResultWindow); - if ( m_bDirCompare /*m_pDirectoryMergeWindow->isVisible()*/ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow); - //if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); - - std::list::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); - ++i; - if ( i==visibleWidgetList.end() ) - i = visibleWidgetList.begin(); - if ( i!=visibleWidgetList.end() ) - { - if ( *i == m_pDirectoryMergeWindow && ! dirShowBoth->isChecked() ) - { - slotDirViewToggle(); - } - (*i)->setFocus(); - } -} - -void KDiff3App::slotWinFocusPrev() -{ - QWidget* focus = qApp->focusWidget(); - if ( focus == m_pDirectoryMergeWindow && m_pDirectoryMergeWindow->isVisible() && ! dirShowBoth->isChecked() ) - { - slotDirViewToggle(); - } - - std::list visibleWidgetList; - if ( m_pDiffTextWindow1 && m_pDiffTextWindow1->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow1); - if ( m_pDiffTextWindow2 && m_pDiffTextWindow2->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow2); - if ( m_pDiffTextWindow3 && m_pDiffTextWindow3->isVisible() ) visibleWidgetList.push_back(m_pDiffTextWindow3); - if ( m_pMergeResultWindow && m_pMergeResultWindow->isVisible() ) visibleWidgetList.push_back(m_pMergeResultWindow); - if (m_bDirCompare /* m_pDirectoryMergeWindow->isVisible() */ ) visibleWidgetList.push_back(m_pDirectoryMergeWindow); - //if ( m_pDirectoryMergeInfo->isVisible() ) visibleWidgetList.push_back(m_pDirectoryMergeInfo->getInfoList()); - - std::list::iterator i = std::find( visibleWidgetList.begin(), visibleWidgetList.end(), focus); - if ( i==visibleWidgetList.begin() ) - i=visibleWidgetList.end(); - --i; - if ( i!=visibleWidgetList.end() ) - { - if ( *i == m_pDirectoryMergeWindow && ! dirShowBoth->isChecked() ) - { - slotDirViewToggle(); - } - (*i)->setFocus(); - } -} - -void KDiff3App::slotWinToggleSplitterOrientation() -{ - if ( m_pDiffWindowSplitter!=0 ) - { - m_pDiffWindowSplitter->setOrientation( - m_pDiffWindowSplitter->orientation()==Qt::Vertical ? Qt::Horizontal : Qt::Vertical - ); - - m_pOptionDialog->m_bHorizDiffWindowSplitting = m_pDiffWindowSplitter->orientation()==Qt::Horizontal; - } -} - -void KDiff3App::slotOverviewNormal() -{ - m_pOverview->setOverviewMode( Overview::eOMNormal ); - m_pMergeResultWindow->setOverviewMode( Overview::eOMNormal ); - slotUpdateAvailabilities(); -} - -void KDiff3App::slotOverviewAB() -{ - m_pOverview->setOverviewMode( Overview::eOMAvsB ); - m_pMergeResultWindow->setOverviewMode( Overview::eOMAvsB ); - slotUpdateAvailabilities(); -} - -void KDiff3App::slotOverviewAC() -{ - m_pOverview->setOverviewMode( Overview::eOMAvsC ); - m_pMergeResultWindow->setOverviewMode( Overview::eOMAvsC ); - slotUpdateAvailabilities(); -} - -void KDiff3App::slotOverviewBC() -{ - m_pOverview->setOverviewMode( Overview::eOMBvsC ); - m_pMergeResultWindow->setOverviewMode( Overview::eOMBvsC ); - slotUpdateAvailabilities(); -} - -void KDiff3App::slotNoRelevantChangesDetected() -{ - if ( m_bTripleDiff && ! m_outputFilename.isEmpty() ) - { - //KMessageBox::information( this, "No relevant changes detected", "KDiff3" ); - if (!m_pOptionDialog->m_IrrelevantMergeCmd.isEmpty()) - { - QString cmd = m_pOptionDialog->m_IrrelevantMergeCmd + " \"" + m_sd1.getAliasName()+ "\" \"" + m_sd2.getAliasName() + "\" \"" + m_sd3.getAliasName(); - ::system( cmd.local8Bit() ); - } - } -} - -static void insertManualDiffHelp( ManualDiffHelpList* pManualDiffHelpList, int winIdx, int firstLine, int lastLine ) -{ - // The manual diff help list must be sorted and compact. - // "Compact" means that upper items can't be empty if lower items contain data. - - // First insert the new item without regarding compactness. - // If the new item overlaps with previous items then the previous items will be removed. - - ManualDiffHelpEntry mdhe; - mdhe.firstLine( winIdx ) = firstLine; - mdhe.lastLine( winIdx ) = lastLine; - - ManualDiffHelpList::iterator i; - for( i=pManualDiffHelpList->begin(); i!=pManualDiffHelpList->end(); ++i ) - { - int& l1 = i->firstLine( winIdx ); - int& l2 = i->lastLine( winIdx ); - if (l1>=0 && l2>=0) - { - if ( firstLine<=l1 && lastLine>=l1 || firstLine <=l2 && lastLine>=l2 ) - { - // overlap - l1 = -1; - l2 = -1; - } - if ( firstLineinsert( i, mdhe ); - break; - } - } - } - if ( i == pManualDiffHelpList->end() ) - { - pManualDiffHelpList->insert( i, mdhe ); - } - - // Now make the list compact - for( int wIdx=1; wIdx<=3; ++wIdx ) - { - ManualDiffHelpList::iterator iEmpty = pManualDiffHelpList->begin(); - for( i=pManualDiffHelpList->begin(); i!=pManualDiffHelpList->end(); ++i ) - { - if ( iEmpty->firstLine(wIdx) >= 0 ) - { - ++iEmpty; - continue; - } - if ( i->firstLine(wIdx)>=0 ) // Current item is not empty -> move it to the empty place - { - iEmpty->firstLine(wIdx) = i->firstLine(wIdx); - iEmpty->lastLine(wIdx) = i->lastLine(wIdx); - i->firstLine(wIdx) = -1; - i->lastLine(wIdx) = -1; - ++iEmpty; - } - } - } - pManualDiffHelpList->remove( ManualDiffHelpEntry() ); // Remove all completely empty items. -} - -void KDiff3App::slotAddManualDiffHelp() -{ - int firstLine = -1; - int lastLine = -1; - int winIdx = -1; - if ( m_pDiffTextWindow1 ) { m_pDiffTextWindow1->getSelectionRange(&firstLine, &lastLine, eFileCoords); winIdx=1; } - if ( firstLine<0 && m_pDiffTextWindow2 ) { m_pDiffTextWindow2->getSelectionRange(&firstLine, &lastLine, eFileCoords); winIdx=2; } - if ( firstLine<0 && m_pDiffTextWindow3 ) { m_pDiffTextWindow3->getSelectionRange(&firstLine, &lastLine, eFileCoords); winIdx=3; } - - if ( firstLine<0 || lastLine <0 || lastLineisChecked() ) - { - if ( m_bDirCompare ) - m_pDirectoryMergeSplitter->show(); - else - m_pDirectoryMergeSplitter->hide(); - - if ( m_pMainWidget!=0 && !m_pMainWidget->isVisible() && - bTextDataAvailable && !m_pDirectoryMergeWindow->isScanning() - ) - m_pMainWidget->show(); - } - - - bool bDiffWindowVisible = m_pMainWidget != 0 && m_pMainWidget->isVisible(); - bool bMergeEditorVisible = m_pMergeWindowFrame !=0 && m_pMergeWindowFrame->isVisible(); - - m_pDirectoryMergeWindow->updateAvailabilities( m_bDirCompare, bDiffWindowVisible, chooseA, chooseB, chooseC ); - - dirShowBoth->setEnabled( m_bDirCompare ); - dirViewToggle->setEnabled( - m_bDirCompare && - (!m_pDirectoryMergeSplitter->isVisible() && m_pMainWidget!=0 && m_pMainWidget->isVisible() || - m_pDirectoryMergeSplitter->isVisible() && m_pMainWidget!=0 && !m_pMainWidget->isVisible() && bTextDataAvailable ) - ); - - bool bDirWindowHasFocus = m_pDirectoryMergeSplitter->isVisible() && m_pDirectoryMergeWindow->hasFocus(); - - showWhiteSpaceCharacters->setEnabled( bDiffWindowVisible ); - autoAdvance->setEnabled( bMergeEditorVisible ); - autoSolve->setEnabled( bMergeEditorVisible && m_bTripleDiff ); - unsolve->setEnabled( bMergeEditorVisible ); - if ( !bDirWindowHasFocus ) - { - chooseA->setEnabled( bMergeEditorVisible ); - chooseB->setEnabled( bMergeEditorVisible ); - chooseC->setEnabled( bMergeEditorVisible && m_bTripleDiff ); - } - chooseAEverywhere->setEnabled( bMergeEditorVisible ); - chooseBEverywhere->setEnabled( bMergeEditorVisible ); - chooseCEverywhere->setEnabled( bMergeEditorVisible && m_bTripleDiff ); - chooseAForUnsolvedConflicts->setEnabled( bMergeEditorVisible ); - chooseBForUnsolvedConflicts->setEnabled( bMergeEditorVisible ); - chooseCForUnsolvedConflicts->setEnabled( bMergeEditorVisible && m_bTripleDiff ); - chooseAForUnsolvedWhiteSpaceConflicts->setEnabled( bMergeEditorVisible ); - chooseBForUnsolvedWhiteSpaceConflicts->setEnabled( bMergeEditorVisible ); - chooseCForUnsolvedWhiteSpaceConflicts->setEnabled( bMergeEditorVisible && m_bTripleDiff ); - mergeHistory->setEnabled( bMergeEditorVisible ); - mergeRegExp->setEnabled( bMergeEditorVisible ); - showWindowA->setEnabled( bDiffWindowVisible && ( m_pDiffTextWindow2->isVisible() || m_pDiffTextWindow3->isVisible() ) ); - showWindowB->setEnabled( bDiffWindowVisible && ( m_pDiffTextWindow1->isVisible() || m_pDiffTextWindow3->isVisible() )); - showWindowC->setEnabled( bDiffWindowVisible && m_bTripleDiff && ( m_pDiffTextWindow1->isVisible() || m_pDiffTextWindow2->isVisible() ) ); - editFind->setEnabled( bDiffWindowVisible ); - editFindNext->setEnabled( bDiffWindowVisible ); - m_pFindDialog->m_pSearchInC->setEnabled( m_bTripleDiff ); - m_pFindDialog->m_pSearchInOutput->setEnabled( bMergeEditorVisible ); - - bool bSavable = bMergeEditorVisible && m_pMergeResultWindow->getNrOfUnsolvedConflicts()==0; - fileSave->setEnabled( m_bOutputModified && bSavable ); - fileSaveAs->setEnabled( bSavable ); - - goTop->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaAboveCurrent() ); - goBottom->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaBelowCurrent() ); - goCurrent->setEnabled( bDiffWindowVisible ); - goPrevUnsolvedConflict->setEnabled( bMergeEditorVisible && m_pMergeResultWindow->isUnsolvedConflictAboveCurrent() ); - goNextUnsolvedConflict->setEnabled( bMergeEditorVisible && m_pMergeResultWindow->isUnsolvedConflictBelowCurrent() ); - goPrevConflict->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isConflictAboveCurrent() ); - goNextConflict->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isConflictBelowCurrent() ); - goPrevDelta->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaAboveCurrent() ); - goNextDelta->setEnabled( bDiffWindowVisible && m_pMergeResultWindow->isDeltaBelowCurrent() ); - - overviewModeNormal->setEnabled( m_bTripleDiff && bDiffWindowVisible ); - overviewModeAB->setEnabled( m_bTripleDiff && bDiffWindowVisible ); - overviewModeAC->setEnabled( m_bTripleDiff && bDiffWindowVisible ); - overviewModeBC->setEnabled( m_bTripleDiff && bDiffWindowVisible ); - Overview::e_OverviewMode overviewMode = m_pOverview==0 ? Overview::eOMNormal : m_pOverview->getOverviewMode(); - overviewModeNormal->setChecked( overviewMode == Overview::eOMNormal ); - overviewModeAB->setChecked( overviewMode == Overview::eOMAvsB ); - overviewModeAC->setChecked( overviewMode == Overview::eOMAvsC ); - overviewModeBC->setChecked( overviewMode == Overview::eOMBvsC ); - - winToggleSplitOrientation->setEnabled( bDiffWindowVisible && m_pDiffWindowSplitter!=0 ); -} diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/smalldialogs.cpp --- a/kdiff3/src/smalldialogs.cpp Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,567 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2006 by Joachim Eibl * - * joachim.eibl at gmx.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "smalldialogs.h" -#include "optiondialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include - - -#include -#include - -// OpenDialog ************************************************************** - -OpenDialog::OpenDialog( - QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, - bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ) -: QDialog( pParent, "OpenDialog", true /*modal*/ ) -{ - m_pOptions = pOptions; - - 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 ); - - m_pLineA = new QComboBox( true, this ); - m_pLineA->insertStringList( m_pOptions->m_recentAFiles ); - m_pLineA->setEditText( KURL(n1).prettyURL() ); - m_pLineA->setMinimumSize( 200, m_pLineA->size().height() ); - QPushButton * button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectFileA() ) ); - QPushButton * button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectDirA() ) ); - connect( m_pLineA, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); - - h->addWidget( label, 0, 0 ); - h->addWidget( m_pLineA, 0, 1 ); - h->addWidget( button, 0, 2 ); - h->addWidget( button2, 0, 3 ); - - label = new QLabel( "B:", this ); - m_pLineB = new QComboBox( true, this ); - m_pLineB->insertStringList( m_pOptions->m_recentBFiles ); - m_pLineB->setEditText( KURL(n2).prettyURL() ); - m_pLineB->setMinimumSize( 200, m_pLineB->size().height() ); - button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectFileB() ) ); - button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectDirB() ) ); - connect( m_pLineB, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); - - h->addWidget( label, 1, 0 ); - h->addWidget( m_pLineB, 1, 1 ); - h->addWidget( button, 1, 2 ); - h->addWidget( button2, 1, 3 ); - - label = new QLabel( i18n("C (Optional):"), this ); - m_pLineC= new QComboBox( true, this ); - m_pLineC->insertStringList( m_pOptions->m_recentCFiles ); - m_pLineC->setEditText( KURL(n3).prettyURL() ); - m_pLineC->setMinimumSize( 200, m_pLineC->size().height() ); - button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectFileC() ) ); - button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectDirC() ) ); - connect( m_pLineC, SIGNAL(textChanged(const QString&)), this, SLOT(inputFilenameChanged() ) ); - - h->addWidget( label, 2, 0 ); - h->addWidget( m_pLineC, 2, 1 ); - h->addWidget( button, 2, 2 ); - h->addWidget( button2, 2, 3 ); - - m_pMerge = new QCheckBox( i18n("Merge"), this ); - h->addWidget( m_pMerge, 3, 0 ); - - 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 ); - - 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++ ); - m->insertItem( i18n("Swap %1<->%2").arg("C").arg("A"), id++ ); - m->insertItem( i18n("Copy %1->Output").arg("A"), id++ ); - m->insertItem( i18n("Copy %1->Output").arg("B"), id++ ); - m->insertItem( i18n("Copy %1->Output").arg("C"), id++ ); - m->insertItem( i18n("Swap %1<->Output").arg("A"), id++ ); - m->insertItem( i18n("Swap %1<->Output").arg("B"), id++ ); - m->insertItem( i18n("Swap %1<->Output").arg("C"), id++ ); - connect( m, SIGNAL(activated(int)), this, SLOT(slotSwapCopyNames(int))); - button->setPopup(m); - - - hl->addStretch(2); - - label = new QLabel( i18n("Output (optional):"), this ); - m_pLineOut = new QComboBox( true, this ); - m_pLineOut->insertStringList( m_pOptions->m_recentOutputFiles ); - m_pLineOut->setEditText( KURL(outputName).prettyURL() ); - m_pLineOut->setMinimumSize( 200, m_pLineOut->size().height() ); - button = new QPushButton( i18n("File..."), this ); - connect( button, SIGNAL(clicked()), this, SLOT( selectOutputName() ) ); - button2 = new QPushButton( i18n("Dir..."), this ); - connect( button2, SIGNAL(clicked()), this, SLOT( selectOutputDir() ) ); - connect( m_pMerge, SIGNAL(stateChanged(int)), this, SLOT(internalSlot(int)) ); - connect( this, SIGNAL(internalSignal(bool)), m_pLineOut, SLOT(setEnabled(bool)) ); - connect( this, SIGNAL(internalSignal(bool)), button, SLOT(setEnabled(bool)) ); - connect( this, SIGNAL(internalSignal(bool)), button2, SLOT(setEnabled(bool)) ); - - m_pMerge->setChecked( !bMerge ); - m_pMerge->setChecked( bMerge ); -// m_pLineOutput->setEnabled( bMerge ); - -// button->setEnabled( bMerge ); - - h->addWidget( label, 4, 0 ); - h->addWidget( m_pLineOut, 4, 1 ); - h->addWidget( button, 4, 2 ); - h->addWidget( button2, 4, 3 ); - - h->addColSpacing( 1, 200 ); - - Q3HBoxLayout* l = new Q3HBoxLayout( v, 5 ); - - button = new QPushButton( i18n("Configure..."), this ); - connect( button, SIGNAL(clicked()), pParent, slotConfigure ); - l->addWidget( button, 1 ); - - l->addStretch(1); - - button = new QPushButton( i18n("&OK"), this ); - button->setDefault( true ); - connect( button, SIGNAL(clicked()), this, SLOT( accept() ) ); - l->addWidget( button, 1 ); - - button = new QPushButton( i18n("&Cancel"), this ); - connect( button, SIGNAL(clicked()), this, SLOT( reject() ) ); - l->addWidget( button,1 ); - - QSize sh = sizeHint(); - setFixedHeight( sh.height() ); - m_bInputFileNameChanged = false; - -#ifdef KREPLACEMENTS_H - m_pLineA->lineEdit()->installEventFilter( this ); - m_pLineB->lineEdit()->installEventFilter( this ); - m_pLineC->lineEdit()->installEventFilter( this ); - m_pLineOut->lineEdit()->installEventFilter( this ); -#endif -} - -// Eventfilter: Only needed under Windows. -// Without this, files dropped in the line edit have URL-encoding. -// This eventfilter decodes the filenames as needed by KDiff3. -bool OpenDialog::eventFilter(QObject* o, QEvent* e) -{ - if (e->type()==QEvent::Drop) - { - QDropEvent* d = static_cast(e); - - if ( !Q3UriDrag::canDecode( d ) ) { - return false; - } - - QStringList lst; - Q3UriDrag::decodeLocalFiles( d, lst ); - - if ( lst.count() > 0 ) - { - static_cast(o)->setText( lst[0] ); - static_cast(o)->setFocus(); - } - - return true; - } - return false; -} - - -void OpenDialog::selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ) -{ - QString current = pLine->currentText(); - if (current.isEmpty() && i>3 ){ current = m_pLineC->currentText(); } - if (current.isEmpty() ){ current = m_pLineB->currentText(); } - if (current.isEmpty() ){ current = m_pLineA->currentText(); } - KURL newURL = bDir ? KFileDialog::getExistingURL( current, this) - : bSave ? KFileDialog::getSaveURL( current, 0, this) - : KFileDialog::getOpenURL( current, 0, this); - if ( !newURL.isEmpty() ) - { - pLine->setEditText( newURL.url() ); - } - // newURL won't be modified if nothing was selected. -} - -void OpenDialog::selectFileA() { selectURL( m_pLineA, false, 1, false ); } -void OpenDialog::selectFileB() { selectURL( m_pLineB, false, 2, false ); } -void OpenDialog::selectFileC() { selectURL( m_pLineC, false, 3, false ); } -void OpenDialog::selectOutputName(){ selectURL( m_pLineOut, false, 4, true ); } -void OpenDialog::selectDirA() { selectURL( m_pLineA, true, 1, false ); } -void OpenDialog::selectDirB() { selectURL( m_pLineB, true, 2, false ); } -void OpenDialog::selectDirC() { selectURL( m_pLineC, true, 3, false ); } -void OpenDialog::selectOutputDir() { selectURL( m_pLineOut, true, 4, true ); } - -void OpenDialog::internalSlot(int i) -{ - emit internalSignal(i!=0); -} - -// Clear the output-filename when any input-filename changed, -// because users forgot to change the output and accidently overwrote it with -// wrong data during a merge. -void OpenDialog::inputFilenameChanged() -{ - if(!m_bInputFileNameChanged) - { - m_bInputFileNameChanged=true; - m_pLineOut->clearEdit(); - } -} - -void OpenDialog::accept() -{ - int maxNofRecentFiles = 10; - - QString s = m_pLineA->currentText(); - s = KURL::fromPathOrURL(s).prettyURL(); - QStringList* sl = &m_pOptions->m_recentAFiles; - // 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->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->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->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->begin()+maxNofRecentFiles, sl->end() ); - - QDialog::accept(); -} - -void OpenDialog::slotSwapCopyNames( int id ) // id selected in the popup menu -{ - QComboBox* cb1=0; - QComboBox* cb2=0; - switch(id) - { - case 0: cb1=m_pLineA; cb2=m_pLineB; break; - case 1: cb1=m_pLineB; cb2=m_pLineC; break; - case 2: cb1=m_pLineC; cb2=m_pLineA; break; - case 3: cb1=m_pLineA; cb2=m_pLineOut; break; - case 4: cb1=m_pLineB; cb2=m_pLineOut; break; - case 5: cb1=m_pLineC; cb2=m_pLineOut; break; - case 6: cb1=m_pLineA; cb2=m_pLineOut; break; - case 7: cb1=m_pLineB; cb2=m_pLineOut; break; - case 8: cb1=m_pLineC; cb2=m_pLineOut; break; - } - if ( cb1 && cb2 ) - { - QString t1 = cb1->currentText(); - QString t2 = cb2->currentText(); - cb2->setCurrentText(t1); - if ( id<=2 || id>=6 ) - { - cb1->setCurrentText( t2 ); - } - } -} - -// FindDialog ********************************************* - -FindDialog::FindDialog(QWidget* pParent) -: QDialog( pParent ) -{ - Q3GridLayout* layout = new Q3GridLayout( this ); - layout->setMargin(5); - layout->setSpacing(5); - - int line=0; - layout->addMultiCellWidget( new QLabel(i18n("Search text:"),this), line,line,0,1 ); - ++line; - - m_pSearchString = new QLineEdit( this ); - layout->addMultiCellWidget( m_pSearchString, line,line,0,1 ); - ++line; - - m_pCaseSensitive = new QCheckBox(i18n("Case sensitive"),this); - layout->addWidget( m_pCaseSensitive, line, 1 ); - - m_pSearchInA = new QCheckBox(i18n("Search A"),this); - layout->addWidget( m_pSearchInA, line, 0 ); - m_pSearchInA->setChecked( true ); - ++line; - - m_pSearchInB = new QCheckBox(i18n("Search B"),this); - layout->addWidget( m_pSearchInB, line, 0 ); - m_pSearchInB->setChecked( true ); - ++line; - - m_pSearchInC = new QCheckBox(i18n("Search C"),this); - layout->addWidget( m_pSearchInC, line, 0 ); - m_pSearchInC->setChecked( true ); - ++line; - - m_pSearchInOutput = new QCheckBox(i18n("Search output"),this); - layout->addWidget( m_pSearchInOutput, line, 0 ); - m_pSearchInOutput->setChecked( true ); - ++line; - - QPushButton* pButton = new QPushButton( i18n("&Search"), this ); - layout->addWidget( pButton, line, 0 ); - connect( pButton, SIGNAL(clicked()), this, SLOT(accept())); - - pButton = new QPushButton( i18n("&Cancel"), this ); - layout->addWidget( pButton, line, 1 ); - connect( pButton, SIGNAL(clicked()), this, SLOT(reject())); - - hide(); -} - - -RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, - const QString& historyStartRegExpToolTip, const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ) -: QDialog( pParent) -{ - int line=0; - setCaption(i18n("Regular Expression Tester")); - Q3GridLayout* pGrid = new Q3GridLayout( this, 11, 2, 5, 5 ); - - QLabel* l = new QLabel(i18n("Auto merge regular expression:"), this); - pGrid->addWidget(l,line,0); - QToolTip::add( l, autoMergeRegExpToolTip ); - m_pAutoMergeRegExpEdit = new QLineEdit(this); - pGrid->addWidget(m_pAutoMergeRegExpEdit,line,1); - connect( m_pAutoMergeRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); - ++line; - - l = new QLabel(i18n("Example auto merge line:"), this); - pGrid->addMultiCellWidget(l,line,line,0,1); - QToolTip::add( l, i18n("For auto merge test copy a line as used in your files.") ); - m_pAutoMergeExampleEdit = new QLineEdit(this); - pGrid->addWidget(m_pAutoMergeExampleEdit,line,1); - connect( m_pAutoMergeExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); - ++line; - - l = new QLabel(i18n("Match result:"), this); - pGrid->addWidget(l,line,0); - m_pAutoMergeMatchResult = new QLineEdit(this); - m_pAutoMergeMatchResult->setReadOnly(true); - pGrid->addWidget(m_pAutoMergeMatchResult,line,1); - ++line; - - pGrid->addItem( new QSpacerItem(100,20), line, 0 ); - pGrid->setRowStretch( line, 5); - ++line; - - l = new QLabel(i18n("History start regular expression:"), this); - pGrid->addWidget(l,line,0); - QToolTip::add( l, historyStartRegExpToolTip ); - m_pHistoryStartRegExpEdit = new QLineEdit(this); - pGrid->addWidget(m_pHistoryStartRegExpEdit,line,1); - connect( m_pHistoryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); - ++line; - - l = new QLabel(i18n("Example history start line (with leading comment):"), this); - pGrid->addMultiCellWidget(l,line,line,0,1); - ++line; - QToolTip::add( l, i18n("Copy a history start line as used in your files,\n" - "including the leading comment.") ); - m_pHistoryStartExampleEdit = new QLineEdit(this); - pGrid->addWidget(m_pHistoryStartExampleEdit,line,1); - connect( m_pHistoryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); - ++line; - - l = new QLabel(i18n("Match result:"), this); - pGrid->addWidget(l,line,0); - m_pHistoryStartMatchResult = new QLineEdit(this); - m_pHistoryStartMatchResult->setReadOnly(true); - pGrid->addWidget(m_pHistoryStartMatchResult,line,1); - ++line; - - pGrid->addItem( new QSpacerItem(100,20), line, 0 ); - pGrid->setRowStretch( line, 5); - ++line; - - l = new QLabel(i18n("History entry start regular expression:"), this); - pGrid->addWidget(l,line,0); - QToolTip::add( l, historyEntryStartRegExpToolTip ); - m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); - pGrid->addWidget(m_pHistoryEntryStartRegExpEdit,line,1); - connect( m_pHistoryEntryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); - ++line; - - l = new QLabel(i18n("History sort key order:"), this); - pGrid->addWidget(l,line,0); - QToolTip::add( l, historySortKeyOrderToolTip ); - m_pHistorySortKeyOrderEdit = new QLineEdit(this); - pGrid->addWidget(m_pHistorySortKeyOrderEdit,line,1); - connect( m_pHistorySortKeyOrderEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); - ++line; - - l = new QLabel(i18n("Example history entry start line (without leading comment):"), this); - pGrid->addMultiCellWidget(l,line,line,0,1); - QToolTip::add( l, i18n("Copy a history entry start line as used in your files,\n" - "but omit the leading comment.") ); - ++line; - m_pHistoryEntryStartExampleEdit = new QLineEdit(this); - pGrid->addWidget(m_pHistoryEntryStartExampleEdit,line,1); - connect( m_pHistoryEntryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc())); - ++line; - - l = new QLabel(i18n("Match result:"), this); - pGrid->addWidget(l,line,0); - m_pHistoryEntryStartMatchResult = new QLineEdit(this); - m_pHistoryEntryStartMatchResult->setReadOnly(true); - pGrid->addWidget(m_pHistoryEntryStartMatchResult,line,1); - ++line; - - l = new QLabel(i18n("Sort key result:"), this); - pGrid->addWidget(l,line,0); - m_pHistorySortKeyResult = new QLineEdit(this); - m_pHistorySortKeyResult->setReadOnly(true); - pGrid->addWidget(m_pHistorySortKeyResult,line,1); - ++line; - - QPushButton* pButton = new QPushButton(i18n("OK"), this); - pGrid->addWidget(pButton,line,0); - connect( pButton, SIGNAL(clicked()), this, SLOT(accept())); - - pButton = new QPushButton(i18n("Cancel"), this); - pGrid->addWidget(pButton,line,1); - connect( pButton, SIGNAL(clicked()), this, SLOT(reject())); - - resize( 800, sizeHint().height() ); -} - -void RegExpTester::init( const QString& autoMergeRegExp, const QString& historyStartRegExp, const QString& historyEntryStartRegExp, const QString historySortKeyOrder ) -{ - m_pAutoMergeRegExpEdit->setText( autoMergeRegExp ); - m_pHistoryStartRegExpEdit->setText( historyStartRegExp ); - m_pHistoryEntryStartRegExpEdit->setText( historyEntryStartRegExp ); - m_pHistorySortKeyOrderEdit->setText( historySortKeyOrder ); -} - -QString RegExpTester::autoMergeRegExp() -{ - return m_pAutoMergeRegExpEdit->text(); -} - -QString RegExpTester::historyStartRegExp() -{ - return m_pHistoryStartRegExpEdit->text(); -} - -QString RegExpTester::historyEntryStartRegExp() -{ - return m_pHistoryEntryStartRegExpEdit->text(); -} - -QString RegExpTester::historySortKeyOrder() -{ - return m_pHistorySortKeyOrderEdit->text(); -} - -void RegExpTester::slotRecalc() -{ - QRegExp autoMergeRegExp( m_pAutoMergeRegExpEdit->text() ); - if ( autoMergeRegExp.exactMatch( m_pAutoMergeExampleEdit->text() ) ) - { - m_pAutoMergeMatchResult->setText( i18n("Match success.") ); - } - else - { - m_pAutoMergeMatchResult->setText( i18n("Match failed.") ); - } - - QRegExp historyStartRegExp( m_pHistoryStartRegExpEdit->text() ); - if ( historyStartRegExp.exactMatch( m_pHistoryStartExampleEdit->text() ) ) - { - m_pHistoryStartMatchResult->setText( i18n("Match success.") ); - } - else - { - m_pHistoryStartMatchResult->setText( i18n("Match failed.") ); - } - - - QStringList parenthesesGroups; - bool bSuccess = findParenthesesGroups( m_pHistoryEntryStartRegExpEdit->text(), parenthesesGroups ); - if ( ! bSuccess ) - { - m_pHistoryEntryStartMatchResult->setText( i18n("Opening and closing parentheses don't match in regular expression.") ); - m_pHistorySortKeyResult->setText( i18n("") ); - return; - } - QRegExp historyEntryStartRegExp( m_pHistoryEntryStartRegExpEdit->text() ); - QString s = m_pHistoryEntryStartExampleEdit->text(); - - if ( historyEntryStartRegExp.exactMatch( s ) ) - { - m_pHistoryEntryStartMatchResult->setText( i18n("Match success.") ); - QString key = calcHistorySortKey( m_pHistorySortKeyOrderEdit->text(),historyEntryStartRegExp,parenthesesGroups); - m_pHistorySortKeyResult->setText(key); - } - else - { - m_pHistoryEntryStartMatchResult->setText( i18n("Match failed.") ); - m_pHistorySortKeyResult->setText( i18n("") ); - } -} - -//#include "smalldialogs.moc" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/smalldialogs.h --- a/kdiff3/src/smalldialogs.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 by Joachim Eibl * - * joachim.eibl at gmx.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef SMALLDIALOGS_H -#define SMALLDIALOGS_H - -#include -//Added by qt3to4: -#include -#include -#include "diff.h" - -class OptionDialog; -class QComboBox; -class QCheckBox; -class QLineEdit; -class QLabel; - -class OpenDialog : public QDialog -{ - Q_OBJECT -public: - OpenDialog( - QWidget* pParent, const QString& n1, const QString& n2, const QString& n3, - bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions ); - - QComboBox* m_pLineA; - QComboBox* m_pLineB; - QComboBox* m_pLineC; - QComboBox* m_pLineOut; - - QCheckBox* m_pMerge; - virtual void accept(); - virtual bool eventFilter(QObject* o, QEvent* e); -private: - OptionDialog* m_pOptions; - void selectURL( QComboBox* pLine, bool bDir, int i, bool bSave ); - bool m_bInputFileNameChanged; -private slots: - void selectFileA(); - void selectFileB(); - void selectFileC(); - void selectDirA(); - void selectDirB(); - void selectDirC(); - void selectOutputName(); - void selectOutputDir(); - void internalSlot(int); - void inputFilenameChanged(); - void slotSwapCopyNames(int); -signals: - void internalSignal(bool); -}; - -class FindDialog : public QDialog -{ - Q_OBJECT -public: - FindDialog(QWidget* pParent); - -signals: - void findNext(); - -public: - QLineEdit* m_pSearchString; - QCheckBox* m_pSearchInA; - QCheckBox* m_pSearchInB; - QCheckBox* m_pSearchInC; - QCheckBox* m_pSearchInOutput; - QCheckBox* m_pCaseSensitive; - - int currentLine; - int currentPos; - int currentWindow; -}; - - -class RegExpTester : public QDialog -{ - Q_OBJECT -private: - QLineEdit* m_pAutoMergeRegExpEdit; - QLineEdit* m_pAutoMergeMatchResult; - QLineEdit* m_pAutoMergeExampleEdit; - QLineEdit* m_pHistoryStartRegExpEdit; - QLineEdit* m_pHistoryStartMatchResult; - QLineEdit* m_pHistoryStartExampleEdit; - QLineEdit* m_pHistoryEntryStartRegExpEdit; - QLineEdit* m_pHistorySortKeyOrderEdit; - QLineEdit* m_pHistoryEntryStartExampleEdit; - QLineEdit* m_pHistoryEntryStartMatchResult; - QLineEdit* m_pHistorySortKeyResult; - OptionDialog* m_pOptionDialog; -public: - RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, const QString& historyStartRegExpToolTip, - const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip ); - void init( const QString& autoMergeRegExp, const QString& historyStartRegExp, const QString& historyEntryStartRegExp, const QString sortKeyOrder ); - QString autoMergeRegExp(); - QString historyStartRegExp(); - QString historyEntryStartRegExp(); - QString historySortKeyOrder(); -public slots: - void slotRecalc(); -}; - -#endif diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/version.h --- a/kdiff3/src/version.h Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#undef VERSION -#define VERSION "0.9.90-Qt4" diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/autoadvance.xpm --- a/kdiff3/src/xpm/autoadvance.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* XPM */ -static const char *autoadvance[] = { -/* columns rows colors chars-per-pixel */ -"16 16 3 1", -". c #0080FF", -"# c #000000", -" c None", -/* pixels */ -" ## # # ### # ", -"# # # # # # #", -"# # # # # # #", -"#### # # # # #", -"# # ### # # ", -" ", -" ", -" ######## ", -" #....# ", -" #..# ", -" ## ", -" ######## ", -" #....# ", -" #..# ", -" ## ", -" " -}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/currentpos.xpm --- a/kdiff3/src/xpm/currentpos.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *currentpos[]={ -"16 16 3 1", -" c #0080FF", -"# c #000000", -". c None", -"................", -"................", -"................", -".#............#.", -".##..........##.", -".# #........# #.", -".# #..##..# #.", -".# ## ## #.", -".# # # #.", -".# ## ## #.", -".# #..##..# #.", -".# #........# #.", -".##..........##.", -".#............#.", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/down1arrow.xpm --- a/kdiff3/src/xpm/down1arrow.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* XPM */ -static const char *down1arrow[] = { -/* columns rows colors chars-per-pixel */ -"16 16 3 1", -" c #0080ff", -"# c #000000", -". c None", -/* pixels */ -"................", -"................", -"................", -"................", -"................", -"..############..", -"...# #...", -"....# #....", -".....# #.....", -"......# #......", -".......##.......", -"................", -"................", -"................", -"................", -"................" -}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/down2arrow.xpm --- a/kdiff3/src/xpm/down2arrow.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* XPM */ -static const char *down2arrow[] = { -/* columns rows colors chars-per-pixel */ -"16 16 3 1", -" c #0080ff", -"# c #000000", -". c None", -/* pixels */ -"................", -"................", -"..############..", -"...# #...", -"....# #....", -".....# #.....", -"......# #......", -".......##.......", -"..############..", -"...# #...", -"....# #....", -".....# #.....", -"......# #......", -".......##.......", -"................", -"................" -}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/downend.xpm --- a/kdiff3/src/xpm/downend.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *downend[]={ -"16 16 3 1", -" c #0080ff", -"# c #000000", -". c None", -"................", -"................", -"................", -"................", -"................", -"..############..", -"...# #...", -"....# #....", -".....# #.....", -"......# #......", -".......##.......", -"..############..", -"................", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/file.xpm --- a/kdiff3/src/xpm/file.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *file_pm[]={ -"16 16 5 1", -". c None", -"# c #000000", -"c c #c0c0c0", -"b c #dcdcdc", -"a c #ffffff", -"..#########.....", -"..#aaaaaabb#....", -"..#aaaaaacab#...", -"..#aaaaaacaab#..", -"..#aaaaaac####..", -"..#aaaaaaaccc#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..############.."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/filenew.xpm --- a/kdiff3/src/xpm/filenew.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char * filenew[] = { -"10 14 5 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #DCDCDC", -"# c #C0C0C0", -"....... ", -".++++@@. ", -".++++#+@. ", -".++++#++@.", -".++++#....", -".+++++###.", -".++++++++.", -".++++++++.", -".++++++++.", -".++++++++.", -".++++++++.", -".++++++++.", -".++++++++.", -".........."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/fileopen.xpm --- a/kdiff3/src/xpm/fileopen.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *fileopen[] = { -" 16 13 5 1", -". c #040404", -"# c #808304", -"a c None", -"b c #f3f704", -"c c #f3f7f3", -"aaaaaaaaa...aaaa", -"aaaaaaaa.aaa.a.a", -"aaaaaaaaaaaaa..a", -"a...aaaaaaaa...a", -".bcb.......aaaaa", -".cbcbcbcbc.aaaaa", -".bcbcbcbcb.aaaaa", -".cbcb...........", -".bcb.#########.a", -".cb.#########.aa", -".b.#########.aaa", -"..#########.aaaa", -"...........aaaaa" -}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/fileprint.xpm --- a/kdiff3/src/xpm/fileprint.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *fileprint[] = { -" 16 14 6 1", -". c #000000", -"# c #848284", -"a c #c6c3c6", -"b c #ffff00", -"c c #ffffff", -"d c None", -"ddddd.........dd", -"dddd.cccccccc.dd", -"dddd.c.....c.ddd", -"ddd.cccccccc.ddd", -"ddd.c.....c....d", -"dd.cccccccc.a.a.", -"d..........a.a..", -".aaaaaaaaaa.a.a.", -".............aa.", -".aaaaaa###aa.a.d", -".aaaaaabbbaa...d", -".............a.d", -"d.aaaaaaaaa.a.dd", -"dd...........ddd" -}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/filesave.xpm --- a/kdiff3/src/xpm/filesave.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* XPM */ -static const char *filesave[] = { -" 14 14 3 1", -". c #040404", -"# c #808304", -"a c #bfc2bf", -"..............", -".#.aaaaaaaa.a.", -".#.aaaaaaaa...", -".#.aaaaaaaa.#.", -".#.aaaaaaaa.#.", -".#.aaaaaaaa.#.", -".#.aaaaaaaa.#.", -".##........##.", -".############.", -".##.........#.", -".##......aa.#.", -".##......aa.#.", -".##......aa.#.", -"a............." -}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/folder.xpm --- a/kdiff3/src/xpm/folder.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *folder_pm[]={ -"16 16 5 1", -". c None", -"# c #040404", -"c c #808304", -"a c #f3f704", -"b c #f3f7f3", -"................", -"................", -"................", -".###............", -"#aba#######.....", -"#babababab#.....", -"#ababababa#.....", -"#baba###########", -"#aba#ccccccccc#.", -"#ba#ccccccccc#..", -"#a#ccccccccc#...", -"##ccccccccc#....", -"###########.....", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/iconA.xpm --- a/kdiff3/src/xpm/iconA.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *iconA[]={ -"16 16 3 1", -" c #0080FF", -"# c #000000", -". c None", -"................", -"................", -"......###.......", -".....# #......", -"....# # #.....", -"...# #.# #....", -"...# #...# #....", -"...# #...# #....", -"...# ##### #....", -"...# #....", -"...# ##### #....", -"...# #...# #....", -"...###...###....", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/iconB.xpm --- a/kdiff3/src/xpm/iconB.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *iconB[]={ -"16 16 3 1", -" c #0080FF", -"# c #000000", -". c None", -"................", -"................", -"...#######......", -"...# #.....", -"...# #### #....", -"...# #...# #....", -"...# #### #....", -"...# #.....", -"...# #### #....", -"...# #...# #....", -"...# #### #....", -"...# #.....", -"...#######......", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/iconC.xpm --- a/kdiff3/src/xpm/iconC.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *iconC[]={ -"16 16 3 1", -" c #0080FF", -"# c #000000", -". c None", -"................", -"................", -"......####......", -".....# #.....", -"....# ### #....", -"...# #...##....", -"...# #..........", -"...# #..........", -"...# #..........", -"...# #..........", -"...# #...##....", -"....# ### #....", -".....# #.....", -"......####......", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/link_arrow.xpm --- a/kdiff3/src/xpm/link_arrow.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* XPM */ -static const char *link_arrow[]={ -"16 16 5 1", -". c None", -"b c #000000", -"# c #585858", -"c c #dcdcdc", -"a c #ffffff", -"................", -"................", -"................", -"................", -"................", -"................", -"................", -"................", -"########........", -"#aaaaaab........", -"#aabbbab........", -"#aac#bab........", -"#acbcbab........", -"#abcaaab........", -"#aaaaaab........", -"#bbbbbbb........"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/nextunsolved.xpm --- a/kdiff3/src/xpm/nextunsolved.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* XPM */ -static const char *nextunsolved[]={ -"16 16 4 1", -". c None", -" c #0080ff", -"# c #000000", -"a c #ff0000", -"..############..", -"...# #...", -"....# #....", -".....# #.....", -"......# #......", -"..############..", -"...# #...", -"....# #....", -".....# #.....", -"......# #......", -"..############..", -"...#aaaaaaaa#...", -"....#aaaaaa#....", -".....#aaaa#.....", -"......#aa#......", -".......##......."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/prevunsolved.xpm --- a/kdiff3/src/xpm/prevunsolved.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* XPM */ -static const char *prevunsolved[]={ -"16 16 4 1", -" c #0080ff", -"# c #000000", -"a c #ff0000", -". c None", -".......##.......", -"......#aa#......", -".....#aaaa#.....", -"....#aaaaaa#....", -"...#aaaaaaaa#...", -"..############..", -"......# #......", -".....# #.....", -"....# #....", -"...# #...", -"..############..", -"......# #......", -".....# #.....", -"....# #....", -"...# #...", -"..############.."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/reload.xpm --- a/kdiff3/src/xpm/reload.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* XPM */ -static const char *reloadIcon[]={ -"16 16 55 1", -". c None", -"e c #25502a", -"# c #25512b", -"d c #25522b", -"g c #26552c", -"c c #27562e", -"n c #27582f", -"b c #28592e", -"M c #285930", -"a c #295a2f", -"q c #295a30", -"G c #295c31", -"t c #2a5e31", -"y c #2b6635", -"U c #2b6636", -"Q c #2f703a", -"H c #327b3d", -"0 c #36843f", -"W c #388943", -"u c #3f7046", -"r c #42764a", -"f c #44754b", -"A c #488653", -"N c #50995b", -"K c #529d5f", -"J c #529f60", -"m c #53885c", -"l c #55a161", -"B c #57a863", -"R c #5aaa66", -"I c #5aad69", -"v c #5baa67", -"X c #5cb16b", -"o c #5db469", -"k c #5eb56c", -"z c #5eb66b", -"s c #5fb26d", -"V c #64b171", -"Y c #64c274", -"j c #69c779", -"Z c #6dc97d", -"p c #729a77", -"O c #73c782", -"i c #7ace89", -"w c #7bce89", -"C c #7ecb8b", -"L c #80d191", -"h c #80d193", -"S c #8dd49b", -"P c #95d8a1", -"D c #a7ddb1", -"x c #bde3c2", -"T c #c0e5c5", -"E c #daf0de", -"F c #f9fdf9", -"................", -"..#abcde#df.....", -"..ghhhijklm.....", -"..nhoooooop.....", -"..qho....rso....", -"..tho...uvwxo...", -"..yhz..ABCDEFo..", -"gGHhIJJAAKLooo..", -"MNOPEFo..Qho....", -".eRSTo...Uho....", -"..eV.....Uho....", -"...W.....Qho....", -"....nXYZihho....", -"....0ooooooo....", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/showequalfiles.xpm --- a/kdiff3/src/xpm/showequalfiles.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* XPM */ -static const char *showequalfiles[]={ -"16 16 4 1", -"# c None", -"a c None", -". c #000000", -"b c #00ff00", -"...........##aaa", -".bbbb.bbbb.##aaa", -".bbbb.bbbb.##aaa", -".bbbb.bbbb.##aaa", -".bbbb.bbbb.##aaa", -"...........##aaa", -"aaaaaaaaaaaaaaaa", -"................", -"aaaaaaaaaaaaaaaa", -"................", -".bbbb.bbbb.bbbb.", -".bbbb.bbbb.bbbb.", -".bbbb.bbbb.bbbb.", -".bbbb.bbbb.bbbb.", -"................", -"aaaaaaaaaaaaaaaa"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/showfilesonlyina.xpm --- a/kdiff3/src/xpm/showfilesonlyina.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* XPM */ -static const char *showfilesonlyina[]={ -"16 16 4 1", -"# c None", -"a c None", -". c #000000", -"b c #00ff00", -"...........##aaa", -".bbbb......##aaa", -".bbbb......##aaa", -".bbbb......##aaa", -".bbbb......##aaa", -"...........##aaa", -"aaaaaaaaaaaaaaaa", -"................", -"aaaaaaaaaaaaaaaa", -"................", -".bbbb...........", -".bbbb...........", -".bbbb...........", -".bbbb...........", -"................", -"aaaaaaaaaaaaaaaa"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/showfilesonlyinb.xpm --- a/kdiff3/src/xpm/showfilesonlyinb.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* XPM */ -static const char *showfilesonlyinb[]={ -"16 16 4 1", -"# c None", -"a c None", -". c #000000", -"b c #00ff00", -"...........##aaa", -"......bbbb.##aaa", -"......bbbb.##aaa", -"......bbbb.##aaa", -"......bbbb.##aaa", -"...........##aaa", -"aaaaaaaaaaaaaaaa", -"................", -"aaaaaaaaaaaaaaaa", -"................", -"......bbbb......", -"......bbbb......", -"......bbbb......", -"......bbbb......", -"................", -"aaaaaaaaaaaaaaaa"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/showfilesonlyinc.xpm --- a/kdiff3/src/xpm/showfilesonlyinc.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *showfilesonlyinc[]={ -"16 16 3 1", -". c None", -"# c #000000", -"a c #00ff00", -"................", -"................", -"................", -"................", -"................", -"################", -"###########aaaa#", -"###########aaaa#", -"###########aaaa#", -"###########aaaa#", -"################", -"................", -"................", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/showlinenumbers.xpm --- a/kdiff3/src/xpm/showlinenumbers.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* XPM */ -static const char *showlinenumbers[]={ -"16 16 2 1", -". c None", -"# c #000040", -"................", -"................", -"................", -"................", -"...#...##..###..", -"..##..#..#....#.", -"...#.....#....#.", -"...#....#...##..", -"...#...#......#.", -"...#..#.......#.", -"..###.####.###..", -"................", -"................", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/showwhitespace.xpm --- a/kdiff3/src/xpm/showwhitespace.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *showwhitespace[]={ -"16 16 3 1", -". c None", -"# c #000000", -"a c #ffffff", -"................", -"................", -"..############..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..#aaaaaaaaaa#..", -"..############..", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/showwhitespacechars.xpm --- a/kdiff3/src/xpm/showwhitespacechars.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* XPM */ -static const char *showwhitespacechars[]={ -"16 16 2 1", -". c None", -"# c #000040", -"................", -"................", -"................", -"................", -"................", -"................", -"................", -"................", -"................", -"................", -".####.####.####.", -".####.####.####.", -"................", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/startmerge.xpm --- a/kdiff3/src/xpm/startmerge.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* XPM */ -static const char *startmerge[]={ -"16 16 6 1", -". c None", -"# c #000000", -"b c #0000ff", -"c c #00ffff", -"d c #ff0000", -"a c #ffff00", -".......##.......", -"......#aa#......", -"......#aa#......", -"...b.b.##.b.b...", -"...bb......bb...", -"...bbb....bbb...", -".##..........##.", -"#cc#........#cc#", -"#cc#........#cc#", -".##.b.b..b.b.##.", -".....bb..bb.....", -"....bbb..bbb....", -".......##.......", -"......#dd#......", -"......#dd#......", -".......##......."}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/up1arrow.xpm --- a/kdiff3/src/xpm/up1arrow.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *up1arrow[]={ -"16 16 3 1", -". c None", -"# c #000000", -"a c #0080ff", -"................", -"................", -"................", -"................", -"................", -".......##.......", -"......#aa#......", -".....#aaaa#.....", -"....#aaaaaa#....", -"...#aaaaaaaa#...", -"..############..", -"................", -"................", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/up2arrow.xpm --- a/kdiff3/src/xpm/up2arrow.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* XPM */ -static const char *up2arrow[] = { -/* columns rows colors chars-per-pixel */ -"16 16 3 1", -" c #0080ff", -"# c #000000", -". c None", -/* pixels */ -"................", -"................", -".......##.......", -"......# #......", -".....# #.....", -"....# #....", -"...# #...", -"..############..", -".......##.......", -"......# #......", -".....# #.....", -"....# #....", -"...# #...", -"..############..", -"................", -"................" -}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/src/xpm/upend.xpm --- a/kdiff3/src/xpm/upend.xpm Sun May 14 20:12:21 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* XPM */ -static const char *upend[]={ -"16 16 3 1", -" c #0080ff", -"# c #000000", -". c None", -"................", -"................", -"................", -"................", -"..############..", -".......##.......", -"......# #......", -".....# #.....", -"....# #....", -"...# #...", -"..############..", -"................", -"................", -"................", -"................", -"................"}; diff -r 069521efec1a -r 08ea9b86c12c kdiff3/windows_installer/COPYING.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/windows_installer/COPYING.txt Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,323 @@ +This package contains + +KDiff3 : Copyright (C) 2002-2006 Joachim Eibl + License: GNU-General Public License (see below) + +Diff-Ext-For-KDiff3 : Copyright (c) 2003-2006, Sergey Zorin + Extensions for KDiff3 by Joachim Eibl + License: See bottom + +---------------------------------------------------------------------- + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +(End of GNU-General Public License) + +------------------------------------------------------------------------ + +Diff-Ext-License: + +Diff-Ext: Copyright (c) 2003-2006, Sergey Zorin + All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + 1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff -r 069521efec1a -r 08ea9b86c12c kdiff3/windows_installer/DIFF-EXT-LICENSE.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/windows_installer/DIFF-EXT-LICENSE.txt Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,25 @@ +Diff-Ext: Copyright (c) 2003-2006, Sergey Zorin + All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + 1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -r 069521efec1a -r 08ea9b86c12c kdiff3/windows_installer/README_WIN.txt --- a/kdiff3/windows_installer/README_WIN.txt Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/windows_installer/README_WIN.txt Sat Nov 04 00:05:00 2006 +0000 @@ -3,7 +3,7 @@ Author: Joachim Eibl (joachim.eibl@gmx.de) Copyright: (C) 2002-2006 by Joachim Eibl -KDiff3-Version: 0.9.89 +KDiff3-Version: 0.9.91 Homepage: http://kdiff3.sourceforge.net KDiff3 is a program that @@ -29,7 +29,7 @@ Note that there is NO WARRANTY for this program. Installation: -- The installer was created by Sebastien Fricker (sebastien.fricker@web.de). +- The installer was initially created by Sebastien Fricker (sebastien.fricker@web.de). It is based on the Nullsoft Scriptable Install System (http://nsis.sourceforge.net) - You can place the directory where you want it. But don't separate the file @@ -37,11 +37,29 @@ - Integration with WinCVS: When selected the installer sets KDiff3 to be the default diff-tool for WinCVS if available. + Registry HKEY_CURRENT_USER\Software\WinCvs\wincvs\CVS settings: "P_Extdiff" and "P_DiffUseExtDiff" -- Integration with Explorer: When selected KDiff3 will be added to the "Send To" +- Integration with TortoiseSVN: When selected the installer sets KDiff3 to be the + default diff-tool for TortoiseSVN if available. + Registry HKEY_CURRENT_USER\Software\TortoiseSVN: "Diff" and "Merge" + +- Integration with Explorer (1): When selected KDiff3 will be added to the "Send To" menu in the context menu. If you then select two files or two directories and choose "Send To"->"KDiff3" then KDiff3 will start and compare the specified files. +- Integration with Explorer (2): When selected Diff-Ext-For-KDiff3 will be installed. + This is a Shell-Extension which adds an entry "KDiff3" into the context menu of + Windows Explorer. (e.g. when right-clicking a file or directory) With this it + is possible to select files and directories sequentially and in separate directories + for comparison with KDiff3. This is based on Diff-Ext by Sergey Zorin + (http://diff-ext.sourceforge.net) with extensions for KDiff3 by Joachim Eibl. + This extension is not under GPL but under a BSD-style licence. (See file DIFF-EXT-LICENSE.txt.) + +- SVN Merge Tool: Allows to use KDiff3 for explicit graphical merges with Subversion. + This installation option copies a file diff3_cmd.bat into your Application Data subdirectory. + (C:\Documents and Settings\Username\Application Data\Subversion\config\diff3_cmd.bat) + (Installation is disabled by default) + Since this program was actually developed for GNU/Linux, there might be Windows specific problems I don't know of yet. Please write me about problems you encounter. diff -r 069521efec1a -r 08ea9b86c12c kdiff3/windows_installer/diff3_cmd.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/windows_installer/diff3_cmd.bat Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,32 @@ +@ECHO OFF + +REM In file "c:\Documents and Settings\\Application +REM Data\Subversion\config" you can change that behavior by +REM modifying "diff3-cmd" line to call KDiff3 instead of +REM automatic merge. Well, you need a batch file actually (based on +REM http://svn.collab.net/repos/svn/trunk/contrib/client-side/diff3wrap.bat): + +REM Configure your favorite diff3/merge program here. +SET DIFF3="C:\Program Files\KDiff3\kdiff3.exe" + +REM Subversion provides the paths we need as the ninth, tenth, and eleventh +REM parameters. But we only have access to nine parameters at a time, so we +REM shift our nine-parameter window twice to let us get to what we need. +SHIFT +SHIFT +SET MINE=%7 +SET OLDER=%8 +SET YOURS=%9 + +REM Call the merge command (change the following line to make sense for +REM your merge program). +%DIFF3% %OLDER% %MINE% %YOURS% -o merged.txt + +REM After performing the merge, this script needs to print the contents +REM of the merged file to stdout. Do that in whatever way you see fit. +REM Return an errorcode of 0 on successful merge, 1 if unresolved conflicts +REM remain in the result. Any other errorcode will be treated as fatal. + +type merged.txt + +del merged.txt diff -r 069521efec1a -r 08ea9b86c12c kdiff3/windows_installer/installForAllUsersPage.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kdiff3/windows_installer/installForAllUsersPage.ini Sat Nov 04 00:05:00 2006 +0000 @@ -0,0 +1,19 @@ +[Settings] +NumFields=2 + +[Field 1] +Type=label +Text=Install for all users or only for the current user? (Installing for all users requires admin rights.) +Left=0 +Right=-1 +Top=0 +Bottom=10 + +[Field 2] +Type=checkbox +Text=Install for all users +Left=0 +Right=-1 +Top=30 +Bottom=40 +State=1 \ No newline at end of file diff -r 069521efec1a -r 08ea9b86c12c kdiff3/windows_installer/kdiff3.nsi --- a/kdiff3/windows_installer/kdiff3.nsi Sun May 14 20:12:21 2006 +0000 +++ b/kdiff3/windows_installer/kdiff3.nsi Sat Nov 04 00:05:00 2006 +0000 @@ -1,9 +1,10 @@ ;KDiff3-NSIS configuration ;Based on Modern User Interface example files ;Apdapted for KDiff3 by Sebastien Fricker and Joachim Eibl -;Requires nsis_v2.16 +;Requires nsis_v2.19 -!define KDIFF3_VERSION "0.9.90" +!define KDIFF3_VERSION "0.9.91" +!define DIFF_EXT_CLSID "{9F8528E4-AB20-456E-84E5-3CE69D8720F3}" ;-------------------------------- ;Include Modern UI @@ -47,9 +48,11 @@ ;-------------------------------- ;Pages + ;!insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE $(MUILicense) !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY + Page custom CustomPageC ;Start Menu Folder Page Configuration !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" @@ -60,6 +63,13 @@ !insertmacro MUI_PAGE_INSTFILES + !define MUI_FINISHPAGE_RUN KDiff3.exe + !define MUI_FINISHPAGE_RUN_NOTCHECKED + !define MUI_FINISHPAGE_SHOWREADME README_WIN.txt + !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED + + !insertmacro MUI_PAGE_FINISH + !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES @@ -177,17 +187,34 @@ ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) !insertmacro MUI_RESERVEFILE_LANGDLL + ReserveFile "installForAllUsersPage.ini" + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;-------------------------------- +;Variables + + Var INSTALL_FOR_ALL_USERS + +;-------------------------------- ;Installer Sections Section "Software" SecSoftware SectionIn RO + ;Read a value from an InstallOptions INI file + !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_FOR_ALL_USERS "installForAllUsersPage.ini" "Field 2" "State" + + ;Set ShellVarContext: Defines if SHCTX points to HKLM or HKCU + StrCmp $INSTALL_FOR_ALL_USERS "0" "" +3 + SetShellVarContext current + Goto +2 + SetShellVarContext all - ; Make the KDiff3 uninstaller visible via "System Settings: Add or Remove Programs", (Systemsteuerung/Software) - WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\KDiff3" "" "$INSTDIR" - WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" "DisplayName" "KDiff3 (remove only)" - WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" "UninstallString" '"$INSTDIR\Uninstall.exe"' + WriteRegStr HKCU "Software\KDiff3" "InstalledForAllUsers" "$INSTALL_FOR_ALL_USERS" + + ; Make the KDiff3 uninstaller visible via "System Settings: Add or Remove Programs", (Systemsteuerung/Software) + WriteRegStr SHCTX "Software\KDiff3" "" "$INSTDIR" + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" "DisplayName" "KDiff3 (remove only)" + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" "UninstallString" '"$INSTDIR\Uninstall.exe"' SetOutPath "$INSTDIR" @@ -212,6 +239,7 @@ CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\KDiff3.lnk" "$INSTDIR\kdiff3.exe" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Readme.lnk" "$INSTDIR\Readme_Win.txt" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GPL.lnk" "$INSTDIR\Copying.txt" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$QUICKLAUNCH\KDiff3.lnk" "$INSTDIR\kdiff3.exe" @@ -241,6 +269,30 @@ CreateShortCut "$SMPROGRAMS\..\..\SendTo\KDiff3.lnk" '"$INSTDIR\kdiff3.exe"' SectionEnd +Section "Diff-Ext" SecIntegrationDiffExtForKDiff3 + DetailPrint "Diff-Ext for KDiff3" + + IfFileExists "$INSTDIR\diff_ext_for_kdiff3_old.dll" 0 +2 + Delete "$INSTDIR\diff_ext_for_kdiff3_old.dll" + + IfFileExists "$INSTDIR\diff_ext_for_kdiff3.dll" 0 +2 + Rename "$INSTDIR\diff_ext_for_kdiff3.dll" "$INSTDIR\diff_ext_for_kdiff3_old.dll" + + File "diff_ext_for_kdiff3.dll" + File "DIFF-EXT-LICENSE.txt" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Diff-Ext License.lnk" "$INSTDIR\DIFF-EXT-LICENSE.txt" + WriteRegStr HKCU "Software\KDiff3\diff-ext" "" "" + WriteRegStr SHCTX "Software\KDiff3\diff-ext" "InstallDir" "$INSTDIR" + WriteRegStr SHCTX "Software\KDiff3\diff-ext" "diffcommand" "$INSTDIR\kdiff3.exe" + WriteRegStr SHCTX "Software\Classes\CLSID\${DIFF_EXT_CLSID}" "" "diff-ext-for-kdiff3" + WriteRegStr SHCTX "Software\Classes\CLSID\${DIFF_EXT_CLSID}\InProcServer32" "" "$INSTDIR\diff_ext_for_kdiff3.dll" + WriteRegStr SHCTX "Software\Classes\CLSID\${DIFF_EXT_CLSID}\InProcServer32" "ThreadingModel" "Apartment" + WriteRegStr SHCTX "Software\Classes\*\shellex\ContextMenuHandlers\diff-ext-for-kdiff3" "" "${DIFF_EXT_CLSID}" + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "${DIFF_EXT_CLSID}" "diff-ext-for-kdiff3" + WriteRegStr SHCTX "Software\Classes\Folder\shellex\ContextMenuHandlers\diff-ext-for-kdiff3" "" "${DIFF_EXT_CLSID}" + WriteRegStr SHCTX "Software\Classes\Directory\shellex\ContextMenuHandlers\diff-ext-for-kdiff3" "" "${DIFF_EXT_CLSID}" +SectionEnd + Section "WinCVS" SecIntegrationWinCVS DetailPrint "Integration to WinCVS" #MessageBox MB_OK "If WinCVS is running, please close it before proceeding." @@ -253,6 +305,13 @@ WriteRegStr HKCU "Software\TortoiseSVN\" "Diff" '$INSTDIR\kdiff3.exe %base %mine --L1 Base --L2 Mine' WriteRegStr HKCU "Software\TortoiseSVN\" "Merge" '$INSTDIR\kdiff3.exe %base %mine %theirs -o %merged --L1 Base --L2 Mine --L3 Theirs' SectionEnd + +Section /o "SVN Merge tool" SecIntegrationSubversionDiff3Cmd + DetailPrint "Integrate diff3_cmd.bat for Subversion" + File "diff3_cmd.bat" + CreateDirectory '$APPDATA\Subversion\config' + CopyFiles '$INSTDIR\diff3_cmd.bat' '$APPDATA\Subversion\config' +SectionEnd SubSectionEnd ;-------------------------------- @@ -261,6 +320,14 @@ Function .onInit !insertmacro MUI_LANGDLL_DISPLAY + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "installForAllUsersPage.ini" + +FunctionEnd + +Function CustomPageC + + !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY "installForAllUsersPage.ini" FunctionEnd @@ -274,10 +341,12 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SecSoftware} "Main program." !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} "English documentation in HTML-format (Docs for other languages are available on the homepage.)" !insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} "Translations for visible strings in many languages. Not needed for US-English." - !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegration} "Integrate KDiff3 with certain programs." + !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegration} "Integrate KDiff3 with certain programs. (See also the Readme for details.)" !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationExplorer} "Integrate KDiff3 with Explorer. Adds an entry for KDiff3 in the Send-To context menu." + !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationDiffExtForKDiff3} "Installs Diff-Ext by Sergey Zorin. Adds entries for KDiff3 in Explorer context menu." !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationWinCVS} "Integrate KDiff3 with WinCVS. (Please close WinCVS before proceeding.)" !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationTortoiseSVN} "Integrate KDiff3 with TortoiseSVN." + !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationSubversionDiff3Cmd} "Install diff3_cmd.bat for Subversion merge" !insertmacro MUI_FUNCTION_DESCRIPTION_END @@ -285,12 +354,20 @@ ;Uninstaller Section Section "Uninstall" + ReadRegStr $INSTALL_FOR_ALL_USERS HKCU "Software\KDiff3" "InstalledForAllUsers" + ;Set ShellVarContext: Defines if SHCTX points to HKLM or HKCU + StrCmp $INSTALL_FOR_ALL_USERS "0" "" +3 + SetShellVarContext current + Goto +2 + SetShellVarContext all Delete "$INSTDIR\Uninstall.exe" Delete "$INSTDIR\kdiff3.exe" Delete "$INSTDIR\COPYING.txt" Delete "$INSTDIR\Readme_Win.txt" Delete "$INSTDIR\ChangeLog.txt" + Delete "$INSTDIR\diff_ext_for_kdiff3.dll" + Delete "$INSTDIR\DIFF-EXT-LICENSE.txt" RMDir /r "$INSTDIR\doc" RMDir /r "$INSTDIR\translations" @@ -301,6 +378,9 @@ Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\KDiff3.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Readme.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\GPL.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\Diff-Ext License.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\Documentation.lnk" Delete "$QUICKLAUNCH\KDiff3.lnk" Delete "$SMPROGRAMS\..\..\SendTo\KDiff3.lnk" @@ -318,9 +398,16 @@ StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: - DeleteRegKey /ifempty HKCU "Software\KDiff3" - DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\KDiff3" - DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" + DeleteRegKey HKCU "Software\KDiff3" + DeleteRegKey SHCTX "Software\KDiff3" + DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" + + ; diff_ext_for_kdiff3 + DeleteRegKey SHCTX "Software\Classes\CLSID\${DIFF_EXT_CLSID}" + DeleteRegKey SHCTX "Software\Classes\*\shellex\ContextMenuHandlers\diff-ext-for-kdiff3" + DeleteRegKey SHCTX "Software\Classes\Folder\shellex\ContextMenuHandlers\diff-ext-for-kdiff3" + DeleteRegKey SHCTX "Software\Classes\Directory\shellex\ContextMenuHandlers\diff-ext-for-kdiff3" + DeleteRegValue SHCTX "Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "${DIFF_EXT_CLSID}" SectionEnd