RFE: User-Understandable Default folders in Home Directory
Dan Williams
dcbw at redhat.com
Wed Aug 11 13:22:27 UTC 2004
On Wed, 2004-08-11 at 12:17 +0200, Sindre Pedersen Bjordal wrote:
> I love this idea. It was proposed for in an article I read somewhere
> some time ago, but I can't locate it. What struck me then, and strikes
> me now is: What about the non-english users? Sure, having the names of
> the the folder internationalized shouldn't prove that difficult, but how
> do we make rhythmbox or Evolution look in the internationalized folders?
Hi,
The way Apple has done it for the past 15 years is a system call
FindFolder(), into which you pass some constants, and get back a folder
reference number:
enum {
kSystemFolderType = 'macs',
kDesktopFolderType = 'desk',
kSystemDesktopFolderType = 'sdsk',
kTrashFolderType = 'trsh',
kSystemTrashFolderType = 'strs',
...
kExtensionFolderType = 'extn',
kFontsFolderType = 'font',
kPreferencesFolderType = 'pref',
kSystemPreferencesFolderType = 'sprf',
kTemporaryFolderType = 'temp'
};
I would imagine that on Linux you would, of course, get back the name of
that folder using the current system encoding. It would have to be a
base-level library, not tied to GNOME or KDE, since other programs could
conceivably use it as well. Hence, maybe its a good idea for a
freedesktop.org project with a small library or something. I don't
think it's a bad idea at all.
So, perhaps:
char *user_doc_folder_name = fl_get_folder_name (USER_DOCUMENTS_FOLDER);
if (user_doc_folder_name)
{
<concatenate "/home/bob/" with user_doc_folder_name>
<do something with folder path>
free (user_doc_folder_name);
}
Dan
More information about the Fedora-desktop-list
mailing list