Commit 5e55e1d3 authored by Joachim Eibl's avatar Joachim Eibl

Improvements for compilation on Windows

git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@164 c8aa9fed-2811-0410-8543-893ada326672
parent 9001116d
......@@ -16,7 +16,7 @@
#endif
struct ReplacementItem
{ char* fileType; char* operationType; };
{ const char* fileType; const char* operationType; };
ReplacementItem g_replacementTable[] = {
{"text_file_delta", "xcompare"},
......
......@@ -1588,12 +1588,8 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
#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 )
);
Qt::HANDLE searchHandle = FindFirstFileW( (const wchar_t*)pattern.utf16(), &findData );
if ( searchHandle != INVALID_HANDLE_VALUE )
{
......@@ -1604,18 +1600,13 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
{
if (!bFirst)
{
if ( ! QT_WA_INLINE(
FindNextFile(searchHandle,&findData),
FindNextFileA(searchHandle,&findDataA)) )
if ( ! FindNextFileW(searchHandle,&findData) )
break;
}
bFirst = false;
FileAccess fa;
fa.m_filePath = QT_WA_INLINE(
QString::fromUtf16((const ushort*)findData.cFileName),
QString::fromLocal8Bit(findDataA.cFileName)
);
fa.m_filePath = QString::fromUtf16((const ushort*)findData.cFileName);
if ( fa.m_filePath!="." && fa.m_filePath!=".." )
{
fa.m_size = ( qint64( findData.nFileSizeHigh ) << 32 ) + findData.nFileSizeLow;
......
......@@ -93,15 +93,15 @@ bool GnuDiff::lines_differ (const QChar *s1, size_t len1, const QChar *s2, size_
else
{
while ( t1!=s1end &&
( bIgnoreWhiteSpace && isWhite( *t1 ) ||
bIgnoreNumbers && (t1->isDigit() || *t1=='-' || *t1=='.' )))
( (bIgnoreWhiteSpace && isWhite( *t1 )) ||
(bIgnoreNumbers && (t1->isDigit() || *t1=='-' || *t1=='.' ))))
{
++t1;
}
while ( t2 != s2end &&
( bIgnoreWhiteSpace && isWhite( *t2 ) ||
bIgnoreNumbers && (t2->isDigit() || *t2=='-' || *t2=='.' )))
( (bIgnoreWhiteSpace && isWhite( *t2 )) ||
(bIgnoreNumbers && (t2->isDigit() || *t2=='-' || *t2=='.' ))))
{
++t2;
}
......@@ -168,7 +168,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
case IGNORE_ALL_SPACE:
while ( p<bufend && (c = *p) != '\n' )
{
if (! (isWhite(c) || bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) ))
if (! (isWhite(c) || (bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' )) ))
h = HASH (h, c.toLower().unicode());
++p;
}
......@@ -188,7 +188,7 @@ void GnuDiff::find_and_hash_each_line (struct file_data *current)
case IGNORE_ALL_SPACE:
while ( p<bufend && (c = *p) != '\n')
{
if (! (isWhite(c)|| bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' ) ))
if (! (isWhite(c)|| (bIgnoreNumbers && (c.isDigit() || c=='-' || c=='.' )) ))
h = HASH (h, c.unicode());
++p;
}
......
......@@ -1719,7 +1719,7 @@ void OptionDialog::slotApply( void )
emit applyDone();
#ifdef _WIN32
QString locale = m_language;
QString locale = m_options.m_language;
if ( locale == "Auto" || locale.isEmpty() )
locale = QLocale::system().name().left(2);
int spacePos = locale.indexOf(' ');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment