Update the sync-storage path every time you sync

Instead of updating the storage path every time you add or remove a removable drive, we now update the storage path every time you press the button to sync. That way this detail has no impact on performance of other parts of Cura if they don't use this button. It also makes the code a bit simpler.
The only downside is that this FileDialog then contains state, instead of automatically syncing with the MaterialManagement property for its folder property. I see that as a lesser of two evils.

Contributes to issue CURA-8055.
This commit is contained in:
Ghostkeeper 2021-07-23 15:16:38 +02:00
parent 82c7f19164
commit a4f6e94ae0
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
2 changed files with 11 additions and 33 deletions

View file

@ -201,6 +201,7 @@ Item
onClicked:
{
forceActiveFocus();
exportAllMaterialsDialog.folder = base.materialManagementModel.getPreferredExportAllPath();
exportAllMaterialsDialog.open();
}
visible: Cura.MachineManager.activeMachine.supportsMaterialExport
@ -388,7 +389,6 @@ Item
title: catalog.i18nc("@title:window", "Export All Materials")
selectExisting: false
nameFilters: ["Material archives (*.umm)", "All files (*)"]
folder: base.materialManagementModel.preferredExportAllPath
onAccepted:
{
base.materialManagementModel.exportAll(fileUrl);