Commit 2202d5a2 authored by Joachim Eibl's avatar Joachim Eibl

Version 0.9.83


git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@61 c8aa9fed-2811-0410-8543-893ada326672
parent e26510d9
Version 0.9.83 - 2004/03/06
===========================
- Reading directorys fixed for Win95/98
- Caseinsensitive filename matching for windows.
- Autocopy to selection for systems that support this. (Patch by Stefan Partheymueller)
- Drawing during recalc suppressed in merge result editor.
- Cursor could go beyond last line in merge result editor. (Corrected NrOfLine-counting.)
- Windows: Start with invalid cmd-line-options brings up a messagebox with the list of options.
- Corrected encoding when copying to or pasting from clipboard.
- Corrected char-by-char-diff at beginning of line. ("012345 12345 xyz" <-> "012345 xyz")
- Warning when merging with preprocessor or upcase-conversion enabled.
- Rewrite of preprocessing code should fix several problems. E.g.:
- Ignore C/C++-comments only worked with a preprocessor active.
- Preprocessor output now is input of line-matching preprocessor.
- Paste to diff-window, didn't work if LMPP or Ignore C/C++-Comments was set.
Version 0.9.82 - 2004/02/02
===========================
- DirectoryMerge: Running merge op for last item in a folder, performed the
merge op for all following items in following folders. (Possible data loss!)
- Fix: Preprocessors and "Ignore Comments" didn't work at the same time.
- Fix: Preprocessors crashed with remote files.
- Open-Dialog: When either input is changed, then reset the output to be empty.
(To avoid accidental overwrites.)
- Icon for "Highlight white space differences."
- Editor-Option: Line End Style for saving: Dos/Windows "\r\n" vs. Unix "\n"
- Merge output editor: Corrected wrong encoding for output-filename and
user-typed characters.
- Speedup for reading directories under Windows.
- Enhanced progress dialog responsiveness during local file copy.
- Fix for non-KDE-version: No URL-encoding when dropping files in open dialog.
Version 0.9.81 - 2004/01/08
===========================
- Allow to compile with --enable-final
......@@ -40,7 +72,7 @@ Other Improvements:
- Default diff-view now again side by side instead of one above the other.
Version 0.9.71 - 2003/10/14
Version 0.9.71 - 2003/10/17
===========================
- Windows-Installer by Sebastien Fricker.
- Bugfixes for Windows. (Problems with setFont() in paintEvent().)
......
......@@ -3,7 +3,7 @@ KDiff3-Readme
Author: Joachim Eibl (joachim.eibl@gmx.de)
Copyright: (C) 2002-2003 by Joachim Eibl
KDiff3-Version: 0.9.81
KDiff3-Version: 0.9.83
KDiff3 is a program that
......@@ -45,12 +45,12 @@ Exception from the GPL:
Requirements & Installation:
Version 0.9.81 provides special support for KDE3, but it can also be
Version 0.9.83 provides special support for KDE3, but it can also be
built without KDE3 if the Qt-libraries are available.
(I also tested the program under Windows.)
You always need
- kdiff3-0.9.81.tar.gz
- kdiff3-0.9.83.tar.gz
For building the KDE3-version
- KDE>=3.1 and QT>=3.1-libraries.
......@@ -67,7 +67,7 @@ Installation for KDE3:
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt3)
- cd into the directory kdiff3-0.9.81 and type
- cd into the directory kdiff3-0.9.83 and type
- ./configure --prefix=/opt/kde3 (your KDE3 directory here)
- (make clean) (Required if you already compiled once.)
- make (Run compilation)
......@@ -78,6 +78,9 @@ Installation for KDE3:
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 and Mandrake the prefix usually is /usr.
For a local installation, that doesn't need root rights try
......@@ -105,7 +108,7 @@ Installation for the Qt-only-platforms for Un*x:
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt)
- cd into the directory kdiff3-0.9.81/src and type
- cd into the directory kdiff3-0.9.83/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)
......@@ -124,7 +127,7 @@ Build for Mac:
- I couldn't test this, so you might have to experiment a bit.
- Start by generating a Makefile with
- qmake kdiff3.pro -o Makefile
- If you succeed, I'd like to know how so I can document it here.
- If you succeed, I'd like to know how, so I can document it here.
Start from commandline:
......
......@@ -3,7 +3,78 @@ This file contains some feature-wishes for future KDiff3-versions.
TODO
====
- Automatic line wrap in the difference windows
- Automatic line wrap for too long lines in the difference windows
- Printing of the diff-windows (requires automatic line wrap)
- Undo function in the merge-editor.
- More viewing options for directory widget.
- And one observation. When select Cyrillic charset - it looks like it was
not saved. When open this dialog again - Latin charset is selected anyway.
- Add options to specify a language and charset.
- Ask before saving to a file that already exists (optionally).
- Don't overwrite existing .orig-file, when saving the second time.
- File Menu: Close (Ctrl-F4): Close current file (check if saved and forget the data)
- Dirview:
- Multiselections: Changing Operations or applying ops for all selected items.
- Optionally show size/date for A/B/C
- Choose what to see (all or only different items)
- If only different items are visible: copy the others nevertheless to destdir.
- Improve Ctrl-1/2/3 shortcuts in Dirview.
- Warnung wenn Datum in B oder C älter als A ist.
- Zielverzeichnis nachträglich änderbar
- Bei Kopie von Remote nach lokal: Auf jeden Fall das modification Datum setzen.
- Ctrl-Space doesn't work when a file comparison takes place.
- Option to allow case-insensitive filename-matching.
- Options to show/suppress annoying messages
- Unicode-support
- What's this-Help.
- Tip of the day.
More Statistics before the merge begins:
- How many files are there?
- How many files are equal/different?
- How many files would be copies/merged/ignored?
- Allow to view and merge CVS-conflict files (and diff3-output) and allow to save output
with conflicts in diff3 output-format.
- Provide configure-rules for systems without KDE. (I need help here.)
- Allow different comment-styles (e.g. via a regexp for comments)
- Possibility to jump to next difference in the same line (for very long lines).
- Allow analysis of unified directory-diff/patch-file.
- Add example for line-matching preprocessor to the documentation.
Simple testcase: Consider file a.txt (6 lines):
aa
ba
ca
da
ea
fa
And file b.txt (3 lines):
cg
dg
eg
And the following line matching preprocessor command, that replaces 'g' with 'a':
/usr/bin/perl -p -e 's/g/a/;'
Without that command the following lines would be placed next to each other:
aa - cg
ba - dg
ca - eg
da
ea
fa
But with this command the result of the comparison would be:
aa
ba
ca - cg
da - dg
ea - eg
fa
#MIN_CONFIG(3.0.0)
#MIN_CONFIG(3.1)
AM_INIT_AUTOMAKE(kdiff3, 0.9.70)
AM_INIT_AUTOMAKE(kdiff3, 0.9.82)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN
......@@ -2,7 +2,7 @@
common.h - Things that are needed often
-------------------
begin : Mon Mar 18 2002
copyright : (C) 2002 by Joachim Eibl
copyright : (C) 2002-2004 by Joachim Eibl
email : joachim.eibl@gmx.de
***************************************************************************/
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
diff.h - description
-------------------
begin : Mon Mar 18 2002
copyright : (C) 2002 by Joachim Eibl
copyright : (C) 2002-2004 by Joachim Eibl
email : joachim.eibl@gmx.de
***************************************************************************/
......@@ -28,7 +28,7 @@
#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.
......@@ -123,47 +123,74 @@ struct LineData
int size;
LineData(){ pLine=0; size=0; occurances=0; bContainsPureComment=false; }
int width(); // Calcs width considering tabs.
int width() const; // Calcs width considering tabs.
int occurances;
bool whiteLine(){ return pFirstNonWhiteChar-pLine == size; }
bool whiteLine() const { return pFirstNonWhiteChar-pLine == size; }
bool bContainsPureComment;
};
void prepareOccurances( LineData* p, int size );
class SourceData
{
public:
SourceData(){ m_pBuf=0;m_size=0;m_vSize=0;m_bIsText=false;m_bPreserve=false; }
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
std::vector<LineData> m_v;
bool m_bIsText;
bool m_bPreserve;
void reset();
void readPPFile( bool bPreserveCR, const QString& ppCmd, bool bUpCase );
void readLMPPFile( SourceData* pOrigSource, const QString& ppCmd, bool bUpCase, bool bRemoveComments );
void readFile(const QString& filename, bool bFollowLinks, bool bUpCase );
void preprocess(bool bPreserveCR );
void removeComments( LineData* pLD );
void setData( const QString& data, bool bUpCase );
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() { return getFilename().isEmpty(); }
private:
QString m_fileName;
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 );
void readAndPreprocess();
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; }
~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
std::vector<LineData> m_v;
bool m_bIsText;
bool readFile( const QString& filename );
bool writeFile( const QString& filename );
void preprocess(bool bPreserveCR );
void reset();
void removeComments();
void copyBufFrom( const FileData& src );
};
FileData m_normalData;
FileData m_lmppData;
};
void calcDiff3LineListTrim( Diff3LineList& d3ll, LineData* pldA, LineData* pldB, LineData* pldC );
void calcWhiteDiff3Lines( Diff3LineList& d3ll, LineData* pldA, LineData* pldB, LineData* pldC );
void calcDiff3LineListTrim( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC );
void calcWhiteDiff3Lines( Diff3LineList& d3ll, const LineData* pldA, const LineData* pldB, const LineData* pldC );
void calcDiff3LineVector( const Diff3LineList& d3ll, Diff3LineVector& d3lv );
......@@ -214,6 +241,7 @@ public:
class OptionDialog;
QString decodeString( const char*s , OptionDialog* );
QCString encodeString( const QString& s , OptionDialog* );
class DiffTextWindow : public QWidget
{
......@@ -226,7 +254,7 @@ public:
);
void init(
const QString& fileName,
LineData* pLineData,
const LineData* pLineData,
int size,
const Diff3LineVector* pDiff3LineVector,
int winIdx,
......@@ -271,7 +299,7 @@ public slots:
private:
bool m_bPaintingAllowed;
LineData* m_pLineData;
const LineData* m_pLineData;
int m_size;
QString m_filename;
......@@ -438,6 +466,7 @@ public slots:
void slotAutoSolve();
void slotUnsolve();
void slotSetFastSelectorLine(int);
void setPaintingAllowed(bool);
signals:
void scroll( int deltaX, int deltaY );
......@@ -463,6 +492,8 @@ private:
const Diff3LineList* m_pDiff3LineList;
const TotalDiffStatus* m_pTotalDiffStatus;
bool m_bPaintingAllowed;
private:
class MergeEditLine
{
......@@ -496,19 +527,33 @@ private:
private:
typedef std::list<MergeEditLine> BASE;
int m_size;
int* m_pTotalSize;
public:
typedef std::list<MergeEditLine>::iterator iterator;
typedef std::list<MergeEditLine>::const_iterator const_iterator;
MergeEditLineList(){m_size=0;}
void clear() { m_size=0; BASE::clear(); }
void push_back( const MergeEditLine& m) { ++m_size; BASE::push_back(m); }
void push_front( const MergeEditLine& m) { ++m_size; BASE::push_front(m); }
iterator erase( iterator i ) { --m_size; return BASE::erase(i); }
iterator insert( iterator i, const MergeEditLine& m ) { ++m_size; return BASE::insert(i,m); }
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(){ /*assert(int(BASE::size())==m_size);*/ return m_size;}
iterator begin(){return BASE::begin();}
iterator end(){return BASE::end();}
bool empty() { return m_size==0; }
void setTotalSizePtr(int* pTotalSize)
{
m_pTotalSize = pTotalSize;
*m_pTotalSize += m_size;
}
private:
void ds(int deltaSize)
{
m_size+=deltaSize;
if (m_pTotalSize!=0) *m_pTotalSize+=deltaSize;
}
};
friend class MergeEditLine;
......@@ -569,6 +614,7 @@ private:
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;
......@@ -597,8 +643,8 @@ private slots:
void fineDiff(
Diff3LineList& diff3LineList,
int selector,
LineData* v1,
LineData* v2,
const LineData* v1,
const LineData* v2,
bool& bTextsTotalEqual
);
......
......@@ -2,7 +2,7 @@
difftextwindow.cpp - description
-------------------
begin : Mon Apr 8 2002
copyright : (C) 2002 by Joachim Eibl
copyright : (C) 2002-2004 by Joachim Eibl
email : joachim.eibl@gmx.de
***************************************************************************/
......@@ -59,7 +59,7 @@ DiffTextWindow::DiffTextWindow(
void DiffTextWindow::init(
const QString& filename,
LineData* pLineData,
const LineData* pLineData,
int size,
const Diff3LineVector* pDiff3LineVector,
int winIdx,
......@@ -862,7 +862,7 @@ QCString DiffTextWindow::getString( int line )
if (lineIdx==-1) return QCString();
else
{
LineData* ld = &m_pLineData[lineIdx];
const LineData* ld = &m_pLineData[lineIdx];
return QCString( ld->pLine, ld->size + 1 );
}
return QCString();
......@@ -962,13 +962,15 @@ QString DiffTextWindow::getSelection()
int spaces = 1;
if ( pLine[i]=='\t' )
{
spaces = tabber( outPos, g_tabSize );
}
if( selection.within( line, outPos ) )
{
selectionString += pLine[i];
char buf[2];
buf[0] = pLine[i];
buf[1] = '\0';
selectionString += decodeString( buf, m_pOptionDialog );
}
outPos += spaces;
......@@ -983,8 +985,6 @@ QString DiffTextWindow::getSelection()
}
}
++line;
}
......@@ -1041,3 +1041,17 @@ QString decodeString( const char*s , OptionDialog* pOptions )
else
return QString(s);
}
QCString encodeString( const QString& s , OptionDialog* pOptions )
{
if ( pOptions->m_bStringEncoding )
{
QTextCodec* c = QTextCodec::codecForLocale();
if (c!=0)
return c->fromUnicode( s );
else
return QCString( s.ascii() );
}
else
return QCString( s.ascii() );
}
/***************************************************************************
directorymergewindow.cpp
-------------------
-----------------
begin : Sat Oct 19 2002
copyright : (C) 2002 by Joachim Eibl
copyright : (C) 2002-2004 by Joachim Eibl
email : joachim.eibl@gmx.de
***************************************************************************/
......@@ -347,6 +347,15 @@ static void calcDirStatus( bool bThreeDirs, DirMergeItem* i, int& nofFiles,
calcDirStatus( bThreeDirs, static_cast<DirMergeItem*>(p), nofFiles, nofDirs, nofEqualFiles, nofManualMerges );
}
static QString sortString(const QString& s)
{
#ifdef _WIN32
return s.upper();
#else
return s;
#endif
}
bool DirectoryMergeWindow::init
(
FileAccess& dirA,
......@@ -439,7 +448,7 @@ bool DirectoryMergeWindow::init
for (i=dirListA.begin(); i!=dirListA.end();++i )
{
MergeFileInfos& mfi = m_fileMergeMap[i->filePath()];
MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath())];
//std::cout <<i->filePath()<<std::endl;
mfi.m_bExistsInA = true;
mfi.m_fileInfoA = *i;
......@@ -461,7 +470,7 @@ bool DirectoryMergeWindow::init
for (i=dirListB.begin(); i!=dirListB.end();++i )
{
MergeFileInfos& mfi = m_fileMergeMap[i->filePath()];
MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath())];
mfi.m_bExistsInB = true;
mfi.m_fileInfoB = *i;
}
......@@ -483,7 +492,7 @@ bool DirectoryMergeWindow::init
for (i=dirListC.begin(); i!=dirListC.end();++i )
{
MergeFileInfos& mfi = m_fileMergeMap[i->filePath()];
MergeFileInfos& mfi = m_fileMergeMap[sortString(i->filePath())];
mfi.m_bExistsInC = true;
mfi.m_fileInfoC = *i;
}
......@@ -949,7 +958,6 @@ void DirectoryMergeWindow::prepareListView()
t.start();
for( j=m_fileMergeMap.begin(); j!=m_fileMergeMap.end(); ++j )
{
const QString& fileName = j->first;
MergeFileInfos& mfi = j->second;
mfi.m_subPath = mfi.m_fileInfoA.exists() ? mfi.m_fileInfoA.filePath() :
......@@ -957,6 +965,9 @@ void DirectoryMergeWindow::prepareListView()
mfi.m_fileInfoC.exists() ? mfi.m_fileInfoC.filePath() :
QString("");
// const QString& fileName = j->first;
const QString& fileName = mfi.m_subPath;
g_pProgressDialog->setInformation(
i18n("Processing ") + QString::number(currentIdx) +" / "+ QString::number(nrOfFiles)
+"\n" + fileName, double(currentIdx) / nrOfFiles, false );
......@@ -994,7 +1005,7 @@ void DirectoryMergeWindow::prepareListView()
}
else
{
MergeFileInfos& dirMfi = m_fileMergeMap[dirPart]; // parent
MergeFileInfos& dirMfi = m_fileMergeMap[sortString(dirPart)]; // parent
assert(dirMfi.m_pDMI!=0);
new DirMergeItem( dirMfi.m_pDMI, filePart, &mfi );
mfi.m_pParent = &dirMfi;
......
......@@ -2,7 +2,7 @@
directorymergewindow.h
-------------------
begin : Sat Oct 19 2002
copyright : (C) 2002 by Joachim Eibl
copyright : (C) 2002-2004 by Joachim Eibl
email : joachim.eibl@gmx.de
***************************************************************************/
......
......@@ -35,6 +35,7 @@
#ifdef _WIN32
#include <sys/utime.h>
#include <io.h>
#include <windows.h>
#else
#include <unistd.h> // Needed for creating symbolic links via symlink().
#include <utime.h>
......@@ -204,9 +205,11 @@ void FileAccess::addPath( const QString& txt )
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 )
{
#ifndef KREPLACEMENTS_H
KIO::UDSEntry::const_iterator ei;
long acc = 0;
long fileType = 0;
......@@ -262,8 +265,8 @@ void FileAccess::setUdsEntry( const KIO::UDSEntry& e )
m_name = m_path.mid( pos );
}
m_bHidden = m_name[0]=='.';
#endif
}
#endif
bool FileAccess::isValid() const { return m_bValidData; }
......@@ -342,7 +345,7 @@ bool FileAccess::readFile( void* pDestBuffer, unsigned long maxLength )
return false;
}
bool FileAccess::writeFile( void* pSrcBuffer, unsigned long length )
bool FileAccess::writeFile( const void* pSrcBuffer, unsigned long length )
{
if (m_bLocal)
{
......@@ -424,7 +427,7 @@ QString FileAccess::tempFileName()
for(int i=0; ;++i)
{
// short filenames for WIN98 because for system() the command must not exceed 120 characters.
fileName = tmpDir + "/" + QString::number(i);
fileName = tmpDir + "\\" + QString::number(i);
if ( ! FileAccess::exists(fileName) )
break;
}
......@@ -624,7 +627,7 @@ void FileAccessJobHandler::slotGetData( KIO::Job* pJob, const QByteArray& newDat
}
}
bool FileAccessJobHandler::put(void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume, int permissions )
bool FileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume, int permissions )
{
if ( maxLength>0 )
{
......@@ -1167,6 +1170,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
m_bSuccess = QDir::setCurrent( m_pFileAccess->absFilePath() );
if ( m_bSuccess )
{
#ifndef _WIN32
m_bSuccess = true;
QDir dir( "." );
......@@ -1192,6 +1196,75 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
pDirList->push_back( FileAccess( nicePath(*fi) ) );
}
}
#else
QString pattern ="*.*";
WIN32_FIND_DATA findData;
WIN32_FIND_DATAA& findDataA=*(WIN32_FIND_DATAA*)&findData; // Needed for Win95
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( ! g_pProgressDialog->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(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
{
return false;
}
#endif
}
}
else
......
......@@ -57,7 +57,7 @@ public:
bool isLocal() const;
bool readFile(void* pDestBuffer, unsigned long maxLength );
bool writeFile(void* pSrcBuffer, unsigned long length );
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 );
......@@ -121,7 +121,7 @@ public:
FileAccessJobHandler( FileAccess* pFileAccess );
bool get( void* pDestBuffer, long maxLength );
bool put( void* pSrcBuffer, long maxLength, bool bOverwrite, bool bResume=false, int permissions=-1 );
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 );
......
......@@ -2,7 +2,7 @@
kdiff3.cpp - description
-------------------
begin : Don Jul 11 12:31:29 CEST 2002
copyright : (C) 2002 by Joachim Eibl
copyright : (C) 2002-2004 by Joachim Eibl
email : joachim.eibl@gmx.de
***************************************************************************/
......@@ -108,6 +108,16 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part