20
20
namespace Defaults {
22
void map_types_to_app (string[] types, GLib.AppInfo app) {
24
for (int i=0; i < types.length; i++) {
25
app.set_as_default_for_type(types[i]);
27
} catch (GLib.Error e) {
22
void map_types_to_app (string[] types, GLib.AppInfo app) {
24
for (int i=0; i < types.length; i++) {
25
app.set_as_default_for_type(types[i]);
27
} catch (GLib.Error e) {
28
28
stdout.printf("Error: %s\n", e.message);
33
33
* Get the essential types for the apps
36
string[] get_types_for_app (string app) {
36
string[] get_types_for_app (string app) {
38
38
case "web_browser":
39
39
return { "x-scheme-handler/http",
40
"x-scheme-handler/https",
42
"application/x-extension-htm",
43
"application/x-extension-html",
44
"application/x-extension-shtml",
45
"application/xhtml+xml",
46
"application/x-extension-xht"
40
"x-scheme-handler/https",
42
"application/x-extension-htm",
43
"application/x-extension-html",
44
"application/x-extension-shtml",
45
"application/xhtml+xml",
46
"application/x-extension-xht"
49
49
case "email_client":
50
50
return { "x-scheme-handler/mailto"
54
54
return { "text/calendar"
57
57
case "video_player":
58
58
return { "application/x-quicktimeplayer",
59
"application/vnd.rn-realmedia",
61
"application/x-mplayer2",
62
"application/x-ms-wmv",
65
"video/vnd.rn-realvideo",
66
"video/x-ms-asf-plugin",
59
"application/vnd.rn-realmedia",
61
"application/x-mplayer2",
62
"application/x-ms-wmv",
65
"video/vnd.rn-realvideo",
66
"video/x-ms-asf-plugin",
93
93
case "music_player":
94
94
return { "audio/ogg",
98
"application/x-musepack",
99
"application/musepack",
104
"application/x-vorbis+ogg",
105
"application/x-flac",
106
"application/vnd.rn-realaudio",
107
"application/x-nsv-vp3-mp3",
124
"audio/x-vorbis+ogg",
135
"audio/x-pn-realaudio",
137
"audio/x-pn-realaudio-plugin",
98
"application/x-musepack",
99
"application/musepack",
104
"application/x-vorbis+ogg",
105
"application/x-flac",
106
"application/vnd.rn-realaudio",
107
"application/x-nsv-vp3-mp3",
124
"audio/x-vorbis+ogg",
135
"audio/x-pn-realaudio",
137
"audio/x-pn-realaudio-plugin",
155
155
case "image_viewer":
156
156
return { "image/jpeg",
184
"image/x-minolta-mrw",
190
"image/x-olympus-orf",
192
"image/x-panasonic-raw",
194
"image/x-pentax-pef",
184
"image/x-minolta-mrw",
190
"image/x-olympus-orf",
192
"image/x-panasonic-raw",
194
"image/x-pentax-pef",
214
214
case "text_editor":
215
215
return { "application/xml",
220
220
case "file_browser":
221
return { "inode/directory",
222
"x-directory/normal",
223
"x-directory/gnome-default-handler"
221
return { "inode/directory",
222
"x-directory/normal",
223
"x-directory/gnome-default-handler"
b'\\ No newline at end of file'