summaryrefslogtreecommitdiffstats
path: root/lib/network/net_applet
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-03-03 18:17:12 +0000
committerOlivier Blin <oblin@mandriva.com>2009-03-03 18:17:12 +0000
commita63db013c53a49a6654a55a99f83a36d81b74d27 (patch)
tree97b62a70c6eefb7ff7d58a133f447b77565afd89 /lib/network/net_applet
parent5aa345a630f9bd8324e3693d322cec1afcc542b5 (diff)
downloaddrakx-net-a63db013c53a49a6654a55a99f83a36d81b74d27.tar
drakx-net-a63db013c53a49a6654a55a99f83a36d81b74d27.tar.gz
drakx-net-a63db013c53a49a6654a55a99f83a36d81b74d27.tar.bz2
drakx-net-a63db013c53a49a6654a55a99f83a36d81b74d27.tar.xz
drakx-net-a63db013c53a49a6654a55a99f83a36d81b74d27.zip
fix crash in net_applet when mandi is started (happens if mandi was not available at net_applet start), this requires some API change to split init code, so that we do not add the dbus filters every time we try to reconnect the network::ifw object
Diffstat (limited to 'lib/network/net_applet')
-rw-r--r--lib/network/net_applet/ifw.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/network/net_applet/ifw.pm b/lib/network/net_applet/ifw.pm
index f7fd326..22fc432 100644
--- a/lib/network/net_applet/ifw.pm
+++ b/lib/network/net_applet/ifw.pm
@@ -5,8 +5,8 @@ use network::ifw;
use ugtk2 qw(:create :helpers :wrappers :dialogs);
use mygtk2 qw(gtknew gtkset);
-sub create() {
- $network::net_applet::ifw = network::ifw->new($network::net_applet::dbus, sub {
+sub init() {
+ network::ifw::init($network::net_applet::dbus, sub {
my ($_con, $msg) = @_;
my $member = $msg->get_member;
if ($member eq 'Attack') {
@@ -14,12 +14,21 @@ sub create() {
} elsif ($member eq 'Listen') {
handle_ifw_listen($msg->get_args_list);
} elsif ($member eq 'Init') {
- $network::net_applet::ifw->attach_object;
- main::checkNetworkForce();
+ create();
} elsif ($member eq 'AlertAck') {
$network::net_applet::ifw_alert = 0;
}
});
+ create();
+}
+
+sub create() {
+ if ($network::net_applet::ifw) {
+ $network::net_applet::ifw->attach_object;
+ main::checkNetworkForce();
+ } else {
+ $network::net_applet::ifw = eval { network::ifw->new($network::net_applet::dbus) };
+ }
}
sub enable_ifw_alert() {