Problem with accessing mime info using gnome-vfs API.
- From: "725eb0c8ef771c09ee" <zjc99 mails tsinghua edu cn>
- To: gnome-vfs-list gnome org
- Subject: Problem with accessing mime info using gnome-vfs API.
- Date: Mon, 30 Dec 2002 09:59:37 +0800
Hi everyone:
I've seen in the doc of gnome-vfs, the mime info is stored in a database
consisting
gnome-vfs.mime, gnome-vfs.keys, and some .applications files. The API of
gnome-vfs
is said to access this the database. I have two questions here, please help.
Question# 1.
I've untared and built package gnome-vfs-2.0.4.tar.gz, and installed it at
./gnome-vfs-2.0.4
When I run: ./gnome-vfs-2.0.4/test/test-mime-info "test/html"
the result is as follows:
Type: test/html
Description: (null)
Default Action
(none)
Default Application
(none)
Default Component
(none)
Short List Applications
(none)
Short List Components
(none)
All Applications
(none)
All Components
(none)
But at /usr/share/mime-info/gnome-vfs.mime, there is the following item:
text/html
ext: html htm HTML
and at /usr/share/mime-info/gnome-vfs.keys, there is the following item:
ext/html
description=HTML page
[az]description=HTMl səhifəsi
.......
[zh_TW]description=HTML ™n
default_action_type=application
default_application_id=htmlview
short_list_component_iids=......
short_list_component_iids_for_novice_user_level=......
short_list_component_iids_for_intermediate_user_level=......
short_list_component_iids_for_advanced_user_level=......
short_list_application_ids_for_novice_user_level=htmlview,mozilla,netscape,galeon
short_list_application_ids_for_intermediate_user_level=htmlview,mozilla,netscape,g
aleon
short_list_application_ids_for_advanced_user_level=htmlview,mozilla,netscape,lynx,
galeon
category=Documents/World Wide Web
use_category_default=yes
So the result of ./gnome-vfs-2.0.4/test/test-mime-info "test/html" shouldn't be
like that.
Could anybody help to tell me the problem.
Question# 2.
With ./gnome-vfs-2.0.4/test/test-mime-info.c, there are following lines:
39 gnome_vfs_init ();
40
> 41 /* test reading of gnome-vfs.keys file */
42 value = gnome_vfs_mime_get_value ("x-directory/normal",
"description");
43 if (value == NULL || strcmp (value, "folder") != 0) {
> 89 /* test reading of gnome-vfs.mime file */
90 {
......
95 list = gnome_vfs_mime_get_extensions_list
("application/postscript");
> 121 /* test writing the users' user.keys file. It should overide the
system default */
122 {
123 const char *value;
124 gnome_vfs_mime_set_value ("application/postscript",
125 "foo",
126 "bar");
> 171 /* test to try to modify the user.mime file */
172 {
173 char *value, *save;
174
175 save = gnome_vfs_mime_get_extensions_string
("application/postscript");
176 gnome_vfs_mime_set_registered_type_key
("application/postscript", "ext", "foo");
Then how it can tell when to access gnome-vfs.keys, but not user.keys, or vice
verse ?
Since the APIs are the same, and there is no flag to indicate this.
Please help.
Thanks.
-GeorgeZ.
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]