Revert accidental commit.
This commit is contained in:
parent
8884298f29
commit
80f713f366
|
@ -707,34 +707,28 @@ long long TimestampDir( const wxString& aDirPath, const wxString& aFilespec )
|
||||||
{
|
{
|
||||||
long long timestamp = 0;
|
long long timestamp = 0;
|
||||||
|
|
||||||
#if defined(__WIN32__)
|
#ifdef __WINDOWS__
|
||||||
// Win32 version.
|
// wxFileName construction is egregiously slow. Construct it once and just swap out
|
||||||
// Save time by not searching for each path twice: once in wxDir.GetNext() and once in
|
// the filename thereafter.
|
||||||
// wxFileName.GetModificationTime(). Also cuts out wxWidgets string-matching and case
|
WX_FILENAME fn( aDirPath, wxT( "dummyName" ) );
|
||||||
// conversion by staying on the MSW side of things.
|
wxDir dir( aDirPath );
|
||||||
std::string filespec( aDirPath.t_str() );
|
wxString fullname;
|
||||||
filespec += '\\';
|
|
||||||
filespec += aFilespec.t_str();
|
|
||||||
|
|
||||||
WIN32_FIND_DATA findData;
|
if( dir.IsOpened() )
|
||||||
wxDateTime lastModDate;
|
{
|
||||||
|
if( dir.GetFirst( &fullname, aFilespec ) )
|
||||||
HANDLE fileHandle = ::FindFirstFile( filespec, &findData );
|
|
||||||
|
|
||||||
if( fileHandle != INVALID_HANDLE_VALUE )
|
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ConvertFileTimeToWx( lastModDate, findData.ftLastWriteTime );
|
fn.SetFullName( fullname );
|
||||||
timestamp += lastModDate.GetValue().GetValue();
|
timestamp += fn.GetTimestamp();
|
||||||
|
}
|
||||||
|
while( dir.GetNext( &fullname ) );
|
||||||
}
|
}
|
||||||
while ( FindNextFile( fileHandle, &findData ) != 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FindClose( fileHandle );
|
|
||||||
#else
|
#else
|
||||||
// POSIX version.
|
// POSIX version. Save time by not converting between encodings -- do everything on
|
||||||
// Save time by not converting between encodings -- do everything on the file-system side.
|
// the file-system side.
|
||||||
std::string filespec( aFilespec.fn_str() );
|
std::string filespec( aFilespec.fn_str() );
|
||||||
std::string dir_path( aDirPath.fn_str() );
|
std::string dir_path( aDirPath.fn_str() );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue