Wizard: sort wallets by last modified

This commit is contained in:
tobtoht 2020-12-31 03:37:32 +01:00
parent 5b679da427
commit 469c783a48
No known key found for this signature in database
GPG key ID: 1CADD27F41F45C3C

View file

@ -18,7 +18,14 @@ WalletKeysFiles::WalletKeysFiles(const QFileInfo &info, int networkType, QString
m_modified(info.lastModified().toSecsSinceEpoch()), m_modified(info.lastModified().toSecsSinceEpoch()),
m_path(QDir::toNativeSeparators(info.absoluteFilePath())), m_path(QDir::toNativeSeparators(info.absoluteFilePath())),
m_networkType(networkType), m_networkType(networkType),
m_address(std::move(address)) {} m_address(std::move(address))
{
QFileInfo cacheFile = QFileInfo(info.absoluteFilePath().replace(QRegExp(".keys$"), ""));
qint64 cacheLastModified = cacheFile.lastModified().toSecsSinceEpoch();
if (cacheFile.exists()) {
m_modified = (cacheLastModified > m_modified) ? cacheLastModified : m_modified;
}
}
QString WalletKeysFiles::fileName() const { QString WalletKeysFiles::fileName() const {
return m_fileName; return m_fileName;