refactor file_model.dart
This commit is contained in:
parent
8b46639ef6
commit
2dd4545be0
@ -90,7 +90,7 @@ class _FileManagerPageState extends State<FileManagerPage>
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
model.onClose().whenComplete(() {
|
||||
model.close().whenComplete(() {
|
||||
_ffi.close();
|
||||
_ffi.dialogManager.dismissAll();
|
||||
if (!Platform.isLinux) {
|
||||
|
@ -38,7 +38,7 @@ class _FileManagerPageState extends State<FileManagerPage> {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
model.onClose().whenComplete(() {
|
||||
model.close().whenComplete(() {
|
||||
gFFI.close();
|
||||
gFFI.dialogManager.dismissAll();
|
||||
Wakelock.disable();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -166,17 +166,18 @@ class FfiModel with ChangeNotifier {
|
||||
} else if (name == 'file_dir') {
|
||||
parent.target?.fileModel.receiveFileDir(evt);
|
||||
} else if (name == 'job_progress') {
|
||||
parent.target?.fileModel.tryUpdateJobProgress(evt);
|
||||
parent.target?.fileModel.jobController.tryUpdateJobProgress(evt);
|
||||
} else if (name == 'job_done') {
|
||||
parent.target?.fileModel.jobDone(evt);
|
||||
parent.target?.fileModel.jobController.jobDone(evt);
|
||||
parent.target?.fileModel.refreshAll();
|
||||
} else if (name == 'job_error') {
|
||||
parent.target?.fileModel.jobError(evt);
|
||||
parent.target?.fileModel.jobController.jobError(evt);
|
||||
} else if (name == 'override_file_confirm') {
|
||||
parent.target?.fileModel.overrideFileConfirm(evt);
|
||||
} else if (name == 'load_last_job') {
|
||||
parent.target?.fileModel.loadLastJob(evt);
|
||||
parent.target?.fileModel.jobController.loadLastJob(evt);
|
||||
} else if (name == 'update_folder_files') {
|
||||
parent.target?.fileModel.updateFolderFiles(evt);
|
||||
parent.target?.fileModel.jobController.updateFolderFiles(evt);
|
||||
} else if (name == 'add_connection') {
|
||||
parent.target?.serverModel.addConnection(evt);
|
||||
} else if (name == 'on_client_remove') {
|
||||
@ -1571,9 +1572,6 @@ class FFI {
|
||||
}();
|
||||
// every instance will bind a stream
|
||||
this.id = id;
|
||||
if (isFileTransfer) {
|
||||
fileModel.initFileFetcher();
|
||||
}
|
||||
}
|
||||
|
||||
/// Login with [password], choose if the client should [remember] it.
|
||||
|
Loading…
Reference in New Issue
Block a user