Revert "Cleanup DeviceInfo"

This reverts commit 981d7db305.
This commit is contained in:
Lasan Mahaliyana
2026-06-13 18:28:09 +05:30
parent 981d7db305
commit 024fcb1457
10 changed files with 133 additions and 56 deletions
+17 -4
View File
@@ -44,19 +44,32 @@ api::DeviceInfo::OsType DeviceInfoImpl::GetOsType() const {
}
FilePath DeviceInfoImpl::GetDownloadPath() const {
return device_info_impl_->GetDownloadPath();
std::optional<FilePath> path = device_info_impl_->GetDownloadPath();
if (path.has_value()) {
return *path;
}
return Files::GetTemporaryDirectory();
}
FilePath DeviceInfoImpl::GetAppDataPath() const {
return device_info_impl_->GetLocalAppDataPath(FilePath());
std::optional<FilePath> path = device_info_impl_->GetLocalAppDataPath();
if (path.has_value()) {
return *path;
}
return Files::GetTemporaryDirectory();
}
FilePath DeviceInfoImpl::GetTemporaryPath() const {
return device_info_impl_->GetTemporaryPath();
std::optional<FilePath> path = device_info_impl_->GetTemporaryPath();
if (path.has_value()) {
return *path;
}
return Files::GetTemporaryDirectory();
}
FilePath DeviceInfoImpl::GetLogPath() const {
return device_info_impl_->GetLogPath();
std::optional<FilePath> path = device_info_impl_->GetLogPath();
return path.value_or(GetTemporaryPath());
}
std::optional<size_t> DeviceInfoImpl::GetAvailableDiskSpaceInBytes(