| 1805 | } |
| 1806 | |
| 1807 | Core::FileLocation Account::readFileLocation(MediaKey location) { |
| 1808 | const auto aliasIt = _fileLocationAliases.constFind(location); |
| 1809 | if (aliasIt != _fileLocationAliases.cend()) { |
| 1810 | location = aliasIt.value(); |
| 1811 | } |
| 1812 | |
| 1813 | for (auto i = _fileLocations.find(location); (i != _fileLocations.end()) && (i.key() == location);) { |
| 1814 | if (!i.value().inMediaCache() && !i.value().check()) { |
| 1815 | _fileLocationPairs.remove(i.value().fname); |
| 1816 | i = _fileLocations.erase(i); |
| 1817 | writeLocationsDelayed(); |
| 1818 | continue; |
| 1819 | } |
| 1820 | return i.value(); |
| 1821 | } |
| 1822 | return Core::FileLocation(); |
| 1823 | } |
| 1824 | |
| 1825 | EncryptionKey Account::cacheKey() const { |
| 1826 | Expects(_localKey != nullptr); |
no test coverage detected