Hallo,
ich habe eine Anwendung, die ein Objekt auf dem D-Bus-Systembus veröffentlicht, das von einer anderen Anwendung dann verwendet wird. Die D-Bus-Konfiguration habe ich entsprechend angepasst, dass das erlaubt wird. Mit OpenSUSE 10.3 hat das auch alles noch funktioniert (Qt 4.3.1), aber seit dem Upgrade auf 11.2 funktioniert genau das nicht mehr (Qt 4.5.3). Die Funktion QDBusConnection.registerObject meldet Erfolg, aber die andere Anwendung kann das Objekt nicht abrufen. Also entweder das Veröffentlichen ist jetzt kaputt, oder das Abrufen - oder Qt hat sich irgendwo unterwegs verändert. Der Code hat sich jedenfalls nicht geändert.
Kann man diesen D-Bus denn irgendwie von innen anschauen, um zu sehen, was dort grade alles registriert ist?
D-Bus-Objekt wird nicht veröffentlicht
-
LonelyPixel
- Beiträge: 23
- Registriert: 5. Juli 2008 23:21
Re: D-Bus-Objekt wird nicht veröffentlicht
Es gibt da ein Perl-Script: dbus-lists-objects.plLonelyPixel hat geschrieben: Kann man diesen D-Bus denn irgendwie von innen anschauen, um zu sehen, was dort grade alles registriert ist?
Code: Alles auswählen
#!/usr/bin/perl
=head1 NAME
dbus-list-services.pl - List the services available in D-Bus.
=head1 DESCRIPTION
This program list the services registered in D-Bus. It uses the introspection
mechanism defined in D-Bus for listing all services.
=head1 SYNOPSIS
dbus-list-services.pl [OPTION]
Options:
--system use the system bus.
--session use the session bus.
=head1 AUTHOR
Emmanuel Rodriguez E<lt>potyl@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright 2008 by Emmanuel Rodriguez
=cut
use strict;
use warnings;
use Net::DBus;
use Data::Dumper;
use Getopt::Long qw(:config auto_help pass_through);
exit main();
sub main {
my $use_session = 1;
GetOptions(
'system' => sub {$use_session = 0},
'session' => sub {$use_session = 1},
);
# Get the D-Bus object
my $bus = $use_session ? Net::DBus->session : Net::DBus->system;
my $dbus = $bus
->get_service('org.freedesktop.DBus')
->get_object('/org/freedesktop/DBus')
or die "Can't get the DBus instance"
;
# Get the list of services offered by the bus
my $names = $dbus->ListNames();
foreach my $name (sort @{ $names }) {
# Discard all unnamed services (these are the D-Bus clients)
next if $name =~ /^:\d+\.\d+$/;
print "$name\n";
}
return 0;
}
Code: Alles auswählen
#!/usr/bin/perl
=head1 NAME
dbus-list-services.pl - List the services available in D-Bus.
=head1 DESCRIPTION
This program list the services registered in D-Bus. It uses the introspection
mechanism defined in D-Bus for listing all services.
=head1 SYNOPSIS
dbus-list-services.pl [OPTION]
Options:
--system use the system bus.
--session use the session bus.
=head1 AUTHOR
Emmanuel Rodriguez E<lt>potyl@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright 2008 by Emmanuel Rodriguez
=cut
use strict;
use warnings;
use Net::DBus;
use Data::Dumper;
use Getopt::Long qw(:config auto_help pass_through);
exit main();
sub main {
my $use_session = 1;
GetOptions(
'system' => sub {$use_session = 0},
'session' => sub {$use_session = 1},
);
# Get the D-Bus object
my $bus = $use_session ? Net::DBus->session : Net::DBus->system;
my $dbus = $bus
->get_service('org.freedesktop.DBus')
->get_object('/org/freedesktop/DBus')
or die "Can't get the DBus instance"
;
# Get the list of services offered by the bus
my $names = $dbus->ListNames();
foreach my $name (sort @{ $names }) {
# Discard all unnamed services (these are the D-Bus clients)
next if $name =~ /^:\d+\.\d+$/;
print "$name\n";
}
return 0;
}
-
LonelyPixel
- Beiträge: 23
- Registriert: 5. Juli 2008 23:21