File: GnomeVFSApplicationRegistry

package info (click to toggle)
libgnome2-vfs-perl 1.060-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 464 kB
  • ctags: 71
  • sloc: perl: 1,188; ansic: 446; makefile: 53
file content (55 lines) | stat: -rw-r--r-- 1,769 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl -w
use strict;
use Gnome2::VFS;

use Test::More;

# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gnome2-VFS/t/GnomeVFSApplicationRegistry,v 1.6 2004/07/29 17:36:03 kaffeetisch Exp $

plan -d "$ENV{ HOME }/.gnome" ?
  (tests => 12) :
  (skip_all => "You have no ~/.gnome");

Gnome2::VFS -> init();
Gnome2::VFS::ApplicationRegistry -> reload();

###############################################################################

ok(Gnome2::VFS::ApplicationRegistry -> get_applications());

my $application = Gnome2::VFS::ApplicationRegistry -> new("gnome-terminal");
isa_ok($application, "Gnome2::VFS::Application");

ok($application -> exists());
ok($application -> get_keys());
is($application -> peek_value("name"), "Terminal");
is_deeply([$application -> get_bool_value("can_open_multiple_files")], [0, 1]);

$application -> set_value("name", "Terminal Bla");
$application -> set_bool_value("can_open_multiple_files", 0);
$application -> unset_key("name");

ok($application -> get_mime_types());
ok($application -> supports_mime_type(($application -> get_mime_types())[0]));

$application -> add_mime_type("text/plain");
$application -> remove_mime_type("text/plain");

$application -> clear_mime_types();

ok(not $application -> supports_uri_scheme("http"));

my $mime_application = $application -> get_mime_application();
isa_ok($mime_application, "Gnome2::VFS::Mime::Application");
ok(not $mime_application -> is_user_owned());
$mime_application -> save();

$application -> remove_application();

###############################################################################

Gnome2::VFS::ApplicationRegistry -> reload();
is(Gnome2::VFS::ApplicationRegistry -> sync(), "ok");

Gnome2::VFS::ApplicationRegistry -> shutdown();
Gnome2::VFS -> shutdown();