I want to read list of applications from the Applications folder on Mac using Qt or Carbon.
I am not sure how to do this. So any pointers will be appreciated.
Thanks
Rahul
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest solution is to get the Applications dir and then use the Qt helpers to iterate over it – i.e QDir, and finding bundles as directories whose names end in ‘.app’. Here’s some code to get a QDir from a folder reference type – there are many similar constants, to get the desktop/trash/library folders. The ‘domain’ value is important – for many folders (eg, Library) there’s a per-user version as well as global and network versions. FileVault can complicate things further.
The documentation on FSFindFolder should make things clearer, and there’s examples all over the web.