View Full Version : Customize FileDialog to allow access only to removable drives

15th June 2010, 10:44

In my application, I'm trying to restrict user access to the local drives. Hence I am looking to customize the File Dialog to display only removable drives (e.g. USB devices). Any idea how to go about this? Appreciate any help. Thanks. :)

15th June 2010, 10:53
No suggestions on how to do it. Just a warning not to. It's my computer, and if I want to store or read a file on or from any drive or other device I own, that's my decision. I really, really despise software that tries to make such decisions for me.

At most, examine the drive requested and put up a warning dialog that using non-removable drives may not be wise, offering a reason. And be sure to put a checkbox on the dialog that allows the user to shut it up if they're not interested in heeding your advice.

15th June 2010, 11:06
This is not portable, and has nothing to do with Qt.
You have to look at the documentation for the OS you want to support with this feature- you will have to access the device properties and see if the device you are looking at is a removable or not.