Bug 446280

Summary: Removable device mounted in PTP mode is unexpectedly present under Remote > Network > MTP Devices
Product: [Frameworks and Libraries] kio-extras Reporter: Patrick Silva <bugseforuns>
Component: MTPAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: RESOLVED FIXED    
Severity: normal CC: kfm-devel, sitter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot

Description Patrick Silva 2021-11-30 15:16:44 UTC
Created attachment 144085 [details]
screenshot

STEPS TO REPRODUCE
1. connect an Android device to usb port
2. set usb mode of your Android device to MTP
3. open Dolphin by pressing meta+e
4. go to Remote > Network > MTP Devices, open your Android device and open any file in it
5. close the file, go to Home and do NOT close Dolphin
6. change the usb mode of your Android device to PTP
7. try to open a file in your Android device again by repeating the step 4

OBSERVED RESULT
"The file or folder /path/file does not exist." error message seen in the attached screenshot.

EXPECTED RESULT
Android device mounted in PTP usb mode should never be present under Remote > Network > MTP Devices.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.23.80
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.3
Graphics Platform: X11t
Comment 1 Harald Sitter 2021-12-01 10:40:26 UTC
That is consistent behavior, is it not? If you navigate to a samba share and unplug the ethernet cable the file listing remains and clicking on a file results in an error. Same for all protocols that depend on a remote.

I mean, technically this can be solved by kio-mtp implementing kdirnotify, but I'm not sure that is actually worthwhile because all protocols works this way.
Comment 2 Patrick Silva 2021-12-01 10:53:51 UTC
If I switch the usb mode of my device while Dolphin is running, the new mode is not detected until Dolphin is restarted.
I don't think this is the expected behavior.
Comment 3 Harald Sitter 2022-01-06 12:01:48 UTC
Master now throws away the view after 5 seconds