Qt-interest Archive, January 2007
storing user-shared data files
Message 1 in thread
I have some shared data files in my application that I wanted shared
among all the users.
I want to do this the "right way" on Windows, OS X, and Linux.
On OS X, I think that storing these files in "/Library/Application
Support/ProductName" is the right place.
On Linux, "/usr/share/product"?
On Windows, should I use the "All Users" profile "Application Data"
directory?
Any suggestions?
Is there a QT mechanism to get "the right path" automatically?
--
[ signature omitted ]
Message 2 in thread
Paul Miller wrote:
> I have some shared data files in my application that I wanted shared
> among all the users.
In case you are referring to "application settings" (which toolboxes are
visible etc.) then QSettings is your friend, together with the
parameters QSettings::SystemScope (settings for all users).
But I believe you are talking about "shared data files" as in "shared
image data", "example documents" and so on.
> I want to do this the "right way" on Windows, OS X, and Linux.
>
> On OS X, I think that storing these files in "/Library/Application
> Support/ProductName" is the right place.
Don't know.
>
> On Linux, "/usr/share/product"?
If you install your product binaries under /usr/product, then yes. If on
the other hand you install the binaries under /usr/local/product then it
would be /usr/local/share/product. But it could also be
"/usr/local/product/shared data". And yet on another hand if you decide
to install your product under /opt/product ... ;)
You see, there are plenty of "correct" places, and each Linux
distribution has other "correct" places. I remember there's an attempt
to make a distribution independent file system standard, google it up.
Or see how OpenOffice does it, for example (they install the shared data
in the application directory).
>
> On Windows, should I use the "All Users" profile "Application Data"
> directory?
Yes, that would be c:\Documents and Settings\All Users\Application
Data\Company\Product for example.
Cheers, Oliver
--
[ signature omitted ]