Fixed: a workaround for timestamp bug in the QFileInfo.

This commit is contained in:
alqualos 2006-03-13 19:48:55 +00:00
parent 2906aac9b1
commit d2e214766b
2 changed files with 9 additions and 4 deletions

View file

@ -3,7 +3,7 @@
######################################################################
TEMPLATE = lib
CONFIG += staticlib qt warn_on release
CONFIG += staticlib qt warn_on debug
QT -= gui
LIBS += -lz
DEPENDPATH += .

View file

@ -12,12 +12,17 @@ QuaZipNewInfo::QuaZipNewInfo(const QString& name, const QString& file):
name(name), internalAttr(0), externalAttr(0)
{
QFileInfo info(file);
if(!info.exists()) dateTime=QDateTime::currentDateTime();
else dateTime=info.lastModified();
QDateTime lm = info.lastModified();
if (!info.exists())
dateTime = QDateTime::currentDateTime();
else
dateTime = lm;
}
void QuaZipNewInfo::setFileDateTime(const QString& file)
{
QFileInfo info(file);
if(info.exists()) dateTime=info.lastModified();
QDateTime lm = info.lastModified();
if (info.exists())
dateTime = lm;
}