Idea is like this:
- Implement KDE dbus-daemon to inform user ask to umount some medium
- When user asks to umount medium, this daemon send a message to each registered in daemon app
- When user click umount, message to each registered app was send, and currently displayed text (list of app, which has files opened on medium) + information that umounting is under process
- When app close opened files, it sends reposnse
- When got response, KDE tries to umount medium again
- other registered apps behaves in similar way …
- When KDE daemon got last response, it try to umount again and maybe with success…
But:
- Some apps could deny to close files
- In this case, break procedure and show info, what happened