Get "/Library/Application Support" folder path in Mac OS X 10.7 using Qt 4.7.4
-
wrote on 27 Sept 2011, 09:20 last edited by
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. -
wrote on 27 Sept 2011, 11:01 last edited by
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.
-
wrote on 25 Mar 2012, 10:45 last edited by
Qt 5 does. I added QStandardPaths::standardLocations() for exactly this :)
-
wrote on 4 Nov 2012, 14:37 last edited by
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?
Thanks.
-
wrote on 4 Nov 2012, 23:00 last edited by
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"http://osxdaily.com/2011/07/04/show-library-directory-in-mac-os-x-lion/":http://osxdaily.com/2011/07/04/show-library-directory-in-mac-os-x-lion/
-
wrote on 5 Nov 2012, 00:47 last edited by
Thanks heaps hardcodes. I always use Library, glad to have it back! :)