forked from 1b-agent/opencadstudio-upstream
refactor(io): set up file association once, not on every launch (#205)
Drop the every-launch (re)registration thread. File association is now set up once via the first-launch prompt (Yes → register + set default; No → decline, persisted as file_assoc_enabled) and managed afterwards by the FILEASSOC command. set_default_app now registers the handler entries (.desktop / mime / ProgIDs) itself before asking the OS to default to us, since boot no longer does — so the default never points at a missing handler. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
9ea800f049
commit
54186309b2
3 files changed
+11
-16
No files matched your search
@@ -2590,14 +2590,18 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
Message::AssocPromptYes => {
|
||||
self.file_assoc_enabled = true;
|
||||
self.mark_assoc_prompted();
|
||||
self.active_modal = None;
|
||||
// set_default_app registers the handler first, then makes us the
|
||||
// default — boot no longer does this automatically.
|
||||
Task::perform(
|
||||
crate::io::file_association::set_default_app(),
|
||||
Message::AssocResult,
|
||||
)
|
||||
}
|
||||
Message::AssocPromptNo => {
|
||||
self.file_assoc_enabled = false;
|
||||
self.mark_assoc_prompted();
|
||||
self.active_modal = None;
|
||||
Task::none()
|
||||
|
||||
Reference in new issue
Block a user