From d329e7cc06bcf6474fcd32dc7ee3196fcd58adea Mon Sep 17 00:00:00 2001 From: erinn Date: Sat, 18 Dec 2021 17:43:32 -0800 Subject: [PATCH] image previews - dan comments - wip --- lib/cwtch/cwtch.dart | 2 ++ lib/cwtch/ffi.dart | 2 +- lib/model.dart | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cwtch/cwtch.dart b/lib/cwtch/cwtch.dart index 8a2c740e..67d77c08 100644 --- a/lib/cwtch/cwtch.dart +++ b/lib/cwtch/cwtch.dart @@ -49,12 +49,14 @@ abstract class Cwtch { void ShareFile(String profile, int handle, String filepath); // ignore: non_constant_identifier_names void DownloadFile(String profile, int handle, String filepath, String manifestpath, String filekey); + // android-only // ignore: non_constant_identifier_names void CreateDownloadableFile(String profile, int handle, String filenameSuggestion, String filekey); // ignore: non_constant_identifier_names void CheckDownloadStatus(String profile, String fileKey); // ignore: non_constant_identifier_names void VerifyOrResumeDownload(String profile, int handle, String filekey); + // android-only // ignore: non_constant_identifier_names void ExportPreviewedFile(String sourceFile, String suggestion); diff --git a/lib/cwtch/ffi.dart b/lib/cwtch/ffi.dart index 3c829794..84d1a559 100644 --- a/lib/cwtch/ffi.dart +++ b/lib/cwtch/ffi.dart @@ -700,7 +700,7 @@ class CwtchFfi implements Cwtch { @override String defaultDownloadPath() { Map envVars = Platform.environment; - return path.join(envVars['HOME']!, "Downloads"); + return path.join(envVars[Platform.isWindows ? 'UserProfile' : 'HOME']!, "Downloads"); } @override diff --git a/lib/model.dart b/lib/model.dart index fe95d93f..6c1ddd7b 100644 --- a/lib/model.dart +++ b/lib/model.dart @@ -399,15 +399,14 @@ class ProfileInfoState extends ChangeNotifier { if (progress < 0) { this._downloads[fileKey]!.interrupted = true; } - notifyListeners(); } else { if (this._downloads[fileKey]!.interrupted) { this._downloads[fileKey]!.interrupted = false; } this._downloads[fileKey]!.chunksDownloaded = progress; this._downloads[fileKey]!.chunksTotal = numChunks; - notifyListeners(); } + notifyListeners(); } void downloadMarkManifest(String fileKey) {