mirror of
https://github.com/tnodir/fort
synced 2024-11-15 10:35:10 +00:00
UI: FileUtil::fileModTime: Use QFileInfo's file times in UTC
.. because it's faster.
This commit is contained in:
parent
3f38f86b61
commit
a2b8cdfe84
@ -151,6 +151,12 @@ bool extractVersionInfo(const QString &appPath, AppInfo &appInfo)
|
||||
appInfo.productName = extractInfoText(infoData, langInfo, L"ProductName");
|
||||
appInfo.fileDescription = extractInfoText(infoData, langInfo, L"FileDescription");
|
||||
|
||||
// File description
|
||||
if (appInfo.fileDescription.isEmpty()) {
|
||||
appInfo.fileDescription =
|
||||
!appInfo.productName.isEmpty() ? appInfo.productName : FileUtil::fileName(appPath);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -170,6 +176,7 @@ bool getInfo(const QString &appPath, AppInfo &appInfo)
|
||||
|
||||
QString path = appPath;
|
||||
|
||||
// Service Name: Set real path
|
||||
QString serviceName;
|
||||
if (FileUtil::isSvcHostService(appPath, serviceName)) {
|
||||
path = ServiceInfoManager::getSvcHostServiceDll(serviceName);
|
||||
@ -178,19 +185,13 @@ bool getInfo(const QString &appPath, AppInfo &appInfo)
|
||||
|
||||
const auto wow64FsRedir = disableWow64FsRedirection();
|
||||
|
||||
// File modification time
|
||||
appInfo.fileModTime = FileUtil::fileModTime(path);
|
||||
|
||||
const bool ok = extractVersionInfo(path, appInfo);
|
||||
|
||||
revertWow64FsRedirection(wow64FsRedir);
|
||||
|
||||
// File description
|
||||
if (appInfo.fileDescription.isEmpty()) {
|
||||
appInfo.fileDescription =
|
||||
!appInfo.productName.isEmpty() ? appInfo.productName : FileUtil::fileName(path);
|
||||
}
|
||||
|
||||
// File modification time
|
||||
appInfo.fileModTime = FileUtil::fileModTime(path);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
@ -57,10 +57,12 @@ void TaskZoneDownloader::loadLocalFile()
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
if (sourceModTime() != FileUtil::fileModTime(url())
|
||||
|| !FileUtil::fileExists(cacheFileBinPath())) {
|
||||
const auto fileModTime = FileUtil::fileModTime(url());
|
||||
|
||||
if (sourceModTime() != fileModTime || !FileUtil::fileExists(cacheFileBinPath())) {
|
||||
const auto buffer = FileUtil::readFileData(url());
|
||||
downloader()->setBuffer(buffer);
|
||||
setSourceModTime(fileModTime);
|
||||
success = true;
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ bool writeFileData(const QString &filePath, const QByteArray &data)
|
||||
QDateTime fileModTime(const QString &filePath)
|
||||
{
|
||||
QFileInfo fi(filePath);
|
||||
return fi.lastModified();
|
||||
return fi.lastModified(QTimeZone::UTC);
|
||||
}
|
||||
|
||||
QString expandPath(const QString &path)
|
||||
|
Loading…
Reference in New Issue
Block a user