image previews #267

Merged
sarah merged 29 commits from ipreview into trunk 2021-12-19 20:05:09 +00:00
3 changed files with 4 additions and 3 deletions
Showing only changes of commit d329e7cc06 - Show all commits

View File

@ -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);

View File

@ -700,7 +700,7 @@ class CwtchFfi implements Cwtch {
@override
String defaultDownloadPath() {
Map<String, String> envVars = Platform.environment;
return path.join(envVars['HOME']!, "Downloads");
return path.join(envVars[Platform.isWindows ? 'UserProfile' : 'HOME']!, "Downloads");
}
@override

View File

@ -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) {