Get "/Library/Application Support" folder path in Mac OS X 10.7 using Qt 4.7.4
How to retrieve "Library/Application Support" folder using standard Qt means?
"/Library/Application Support" - global level
"/System/Library/Application Support" - system level
"/Users/<user>/Library/Application Support" - user level
I want to get 1) - the global level folder path.
QDesktopServices::storageLocation( QDesktopServices::DataLocation ) returns 3).
QSettings class digs into "/Library/Preferences".
Any idea how to get "/Library/Application Support" using Qt means?
I don't want to hardcode the folder path.
You can grab the sources of QDesktopServices::storageLocation in src/gui/util/qdesktopservices_mac.cpp and adapt for your needs. You wil bascially just need to replace kUserDomain (for #3) with kOnSystemDisk (for #1) or kSystemDomain (for #2 - but without "Application Support"!)
Qt does not provide some builtin means for retrieving another path than #3.
Qt 5 does. I added QStandardPaths::standardLocations() for exactly this :)
I know nothing about programming but had a simple question some of you maybe able to answer. In my old version of OSX (10.6) users/user/library/application support used to show up on the left side bar of the finder but now I've upgraded to OSX 10.7.4 none of those folders are showing & a search for them in the finder doesn't show them either. Is this normal for 10.7.4 or is there something wrong with my version?
Your OSX is just fine, Apple just decided that users don't need to see the folder. Press left Alt and it will appear in the "go to" menu of the Finder.
There is also a command line option to make it permanantly visible
Thanks heaps hardcodes. I always use Library, glad to have it back! :)