Require Qt5.
This commit is contained in:
+3
-24
@@ -16,9 +16,7 @@
|
||||
#include <ctype.h>
|
||||
#include <locale.h>
|
||||
#include <zlib.h>
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
#include <QtConcurrent>
|
||||
#endif
|
||||
|
||||
#if MAX_MEM_LEVEL >= 8
|
||||
# define DEF_MEM_LEVEL 8
|
||||
@@ -33,12 +31,8 @@
|
||||
lcPiecesLibrary::lcPiecesLibrary()
|
||||
: mLoadMutex(QMutex::Recursive)
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
QStringList cachePathList = QStandardPaths::standardLocations(QStandardPaths::CacheLocation);
|
||||
mCachePath = cachePathList.first();
|
||||
#else
|
||||
mCachePath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
|
||||
#endif
|
||||
|
||||
QDir Dir;
|
||||
Dir.mkpath(mCachePath);
|
||||
@@ -426,19 +420,12 @@ void lcPiecesLibrary::ReadArchiveDescriptions(const QString& OfficialFileName, c
|
||||
QFileInfo UnofficialInfo(UnofficialFileName);
|
||||
|
||||
mArchiveCheckSum[0] = OfficialInfo.size();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0))
|
||||
mArchiveCheckSum[1] = OfficialInfo.lastModified().toMSecsSinceEpoch();
|
||||
#else
|
||||
mArchiveCheckSum[1] = OfficialInfo.lastModified().toTime_t();
|
||||
#endif
|
||||
|
||||
if (!UnofficialFileName.isEmpty())
|
||||
{
|
||||
mArchiveCheckSum[2] = UnofficialInfo.size();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0))
|
||||
mArchiveCheckSum[3] = UnofficialInfo.lastModified().toMSecsSinceEpoch();
|
||||
#else
|
||||
mArchiveCheckSum[3] = UnofficialInfo.lastModified().toTime_t();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -692,11 +679,7 @@ void lcPiecesLibrary::ReadDirectoryDescriptions(const QFileInfoList (&FileLists)
|
||||
const char* Description = FileName + strlen(FileName) + 1;
|
||||
const uint64_t CachedFileTime = *(uint64_t*)(Description + strlen(Description) + 1 + 4 + 1);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0))
|
||||
quint64 FileTime = FileLists[Info->mFolderType][Info->mFolderIndex].lastModified().toMSecsSinceEpoch();
|
||||
#else
|
||||
quint64 FileTime = FileLists[Info->mFolderType][Info->mFolderIndex].lastModified().toTime_t();
|
||||
#endif
|
||||
|
||||
if (FileTime == CachedFileTime)
|
||||
{
|
||||
@@ -746,7 +729,7 @@ void lcPiecesLibrary::ReadDirectoryDescriptions(const QFileInfoList (&FileLists)
|
||||
|
||||
while (!LoadFuture.isFinished())
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) || QT_VERSION < QT_VERSION_CHECK(5, 0, 0) )
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
||||
ProgressDialog->setValue(FilesLoaded);
|
||||
#else
|
||||
ProgressDialog->setValue(FilesLoaded.load());
|
||||
@@ -754,7 +737,7 @@ void lcPiecesLibrary::ReadDirectoryDescriptions(const QFileInfoList (&FileLists)
|
||||
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
}
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) || QT_VERSION < QT_VERSION_CHECK(5, 0, 0) )
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
||||
ProgressDialog->setValue(FilesLoaded);
|
||||
#else
|
||||
ProgressDialog->setValue(FilesLoaded.load());
|
||||
@@ -793,11 +776,7 @@ void lcPiecesLibrary::ReadDirectoryDescriptions(const QFileInfoList (&FileLists)
|
||||
|
||||
NewIndexFile.WriteU8(Info->mFolderType);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0))
|
||||
quint64 FileTime = FileLists[Info->mFolderType][Info->mFolderIndex].lastModified().toMSecsSinceEpoch();
|
||||
#else
|
||||
quint64 FileTime = FileLists[Info->mFolderType][Info->mFolderIndex].lastModified().toTime_t();
|
||||
#endif
|
||||
|
||||
NewIndexFile.WriteU64(FileTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user