summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels Weber <niels.weber@digia.com>2013-05-02 16:09:59 +0200
committerNiels Weber <niels.weber@digia.com>2013-05-07 16:02:53 +0200
commit7b062bd6af86452ed231009b0c48d663ce93976a (patch)
tree7c2613e073335dc757a3cad6cfacd91264e95952
parente3bd8afc6bda58e482771e09adf8294e75b89eff (diff)
Remove local filetime.
This leads to time being wrong by a couple of hours depending on usage of local time vs UTC. This has been deemed acceptable for now. Also skip the test failing because of that difference. Needs to be re-enabled when all time functionality has been rewritten. Change-Id: I23d78371df65878d16e0e428c9fca9387e29a908 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
-rw-r--r--src/libs/7zip/unix/CPP/Windows/PropVariantConversions.cpp7
-rw-r--r--src/libs/7zip/unix/CPP/include_windows/windows.h2
-rw-r--r--src/libs/installer/lib7z_facade.cpp8
-rw-r--r--tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp3
4 files changed, 11 insertions, 9 deletions
diff --git a/src/libs/7zip/unix/CPP/Windows/PropVariantConversions.cpp b/src/libs/7zip/unix/CPP/Windows/PropVariantConversions.cpp
index 61d524d07..abd5b46c4 100644
--- a/src/libs/7zip/unix/CPP/Windows/PropVariantConversions.cpp
+++ b/src/libs/7zip/unix/CPP/Windows/PropVariantConversions.cpp
@@ -76,13 +76,10 @@ bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool
#else
BOOLEAN WINAPI RtlTimeToSecondsSince1970( const LARGE_INTEGER *Time, DWORD *Seconds );
- FILETIME filetime;
- LocalFileTimeToFileTime(&ft, &filetime);
-
LARGE_INTEGER ltime;
- ltime.QuadPart = filetime.dwHighDateTime;
- ltime.QuadPart = (ltime.QuadPart << 32) | filetime.dwLowDateTime;
+ ltime.QuadPart = ft.dwHighDateTime;
+ ltime.QuadPart = (ltime.QuadPart << 32) | ft.dwLowDateTime;
DWORD dw;
RtlTimeToSecondsSince1970(&ltime, &dw );
diff --git a/src/libs/7zip/unix/CPP/include_windows/windows.h b/src/libs/7zip/unix/CPP/include_windows/windows.h
index 7591903fc..871d9f3ae 100644
--- a/src/libs/7zip/unix/CPP/include_windows/windows.h
+++ b/src/libs/7zip/unix/CPP/include_windows/windows.h
@@ -142,9 +142,7 @@ typedef struct _SYSTEMTIME {
extern "C" {
#endif
-BOOL WINAPI FileTimeToLocalFileTime(CONST FILETIME *,FILETIME *);
BOOL WINAPI FileTimeToSystemTime(CONST FILETIME *,SYSTEMTIME *);
-BOOL WINAPI LocalFileTimeToFileTime(CONST FILETIME *,FILETIME *);
VOID WINAPI GetSystemTime(SYSTEMTIME *);
BOOL WINAPI SystemTimeToFileTime(const SYSTEMTIME*,FILETIME *);
diff --git a/src/libs/installer/lib7z_facade.cpp b/src/libs/installer/lib7z_facade.cpp
index a818e9a61..5459cd22b 100644
--- a/src/libs/installer/lib7z_facade.cpp
+++ b/src/libs/installer/lib7z_facade.cpp
@@ -277,8 +277,12 @@ QDateTime getDateTimeProperty(IInArchive* archive, int index, int propId, const
return defaultValue;
FILETIME localFileTime;
- if (!FileTimeToLocalFileTime(&fileTime, &localFileTime))
- throw SevenZipException(QObject::tr("Could not convert file time to local time"));
+#ifndef Q_OS_UNIX
+ if (!FileTimeToLocalFileTime(&fileTime, &localFileTime))
+ throw SevenZipException(QObject::tr("Could not convert file time to local time"));
+#else
+ localFileTime = fileTime;
+#endif
SYSTEMTIME st;
if (!BOOLToBool(FileTimeToSystemTime(&localFileTime, &st)))
diff --git a/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp b/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp
index d6945bf68..bae42fed9 100644
--- a/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp
+++ b/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp
@@ -93,6 +93,9 @@ private slots:
QVector<Lib7z::File> files = Lib7z::listArchive(&file);
QCOMPARE(files.count(), 1);
+#ifdef Q_OS_UNIX
+ QSKIP("This test requires the tme handling to be repaired first.", SkipSingle);
+#endif
QCOMPARE(files.first(), m_file);
}