/usr/share/perlpanel/PerlPanel/DesktopEntry.pm is in perlpanel 1:0.9.1+cvs20051225-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | # $Id: DesktopEntry.pm,v 1.12 2005/01/03 18:52:12 jodrell Exp $
# This file is part of PerlPanel.
#
# PerlPanel is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PerlPanel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PerlPanel; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Copyright: (C) 2004 Gavin Brown <gavin.brown@uk.com>
#
package PerlPanel::DesktopEntry;
use Carp;
use X11::FreeDesktop::DesktopEntry;
use base 'X11::FreeDesktop::DesktopEntry';
use Gnome2::VFS;
use strict;
=pod
=head1 NAME
PerlPanel::DesktopEntry - an interface to .desktop files for the PerlPanel.
=head1 INHERITANCE
This modules inherits from X11::FreeDesktop::DesktopEntry. See L<X11::FreeDesktop::DesktopEntry>
for more information.
=head1 CONSTRUCTOR
my $entry = PerlPanel::DesktopEntry->new($uri);
returns a desktop entry object using the data found at C<$uri>. Gnome2::VFS is
used to retrieve the URI.
=cut
sub new {
my ($package, $uri) = @_;
Gnome2::VFS->init;
my $data = get_file_contents($uri);
if ($data eq '') {
carp("got no data for $uri");
return undef;
}
my $self = X11::FreeDesktop::DesktopEntry->new_from_data($data);
if (!defined($self)) {
return undef;
} else {
bless($self, $package);
return $self;
}
}
sub get_file_contents {
my $uri = shift;
my ($result, $info) = Gnome2::VFS->get_file_info($uri, 'default');
if ($result eq 'ok' && $info->{type} eq 'regular') {
return Gnome2::VFS->read_entire_file($uri);
} else {
return undef;
}
}
=pod
=head1 SEE ALSO
=over
=item * L<perlpanel>
=item * L<X11::FreeDesktop::DesktopEntry>
=back
=cut
1;
|