diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-03-05 00:34:00 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-03-05 00:34:00 +0000 |
commit | f2361da57c1540ae289bcde41ec92960686c1178 (patch) | |
tree | 6f934f43b69754eaaf103430ca79494926d7d08b | |
parent | 538aab87a672a4dda0da5aebe54847f46a5a6e96 (diff) | |
download | mgaonline-f2361da57c1540ae289bcde41ec92960686c1178.tar mgaonline-f2361da57c1540ae289bcde41ec92960686c1178.tar.gz mgaonline-f2361da57c1540ae289bcde41ec92960686c1178.tar.bz2 mgaonline-f2361da57c1540ae289bcde41ec92960686c1178.tar.xz mgaonline-f2361da57c1540ae289bcde41ec92960686c1178.zip |
(checkNetwork) revert 238578 ("(checkConfig) remove unreachable code")
-rwxr-xr-x | mdkapplet | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -57,7 +57,7 @@ my $in = interactive->vnew(''); ugtk2::add_icon_path("/usr/share/mdkonline/pixmaps/"); my $online_site = "http://www.mandrivalinux.com/"; -my ($menu, $timeout, $state_global); +my ($menu, $timeout, $network_timeout, $state_global); my $localdir = "$ENV{HOME}/.MdkOnline"; my $localfile = "$localdir/mdkonline"; @@ -396,13 +396,13 @@ sub okState() { logIt(N_("System is up-to-date\n")); go2State('okay') } sub setup_cyclic_check() { + $network_timeout = Glib::Timeout->add(2000, \&checkNetwork); $timeout = Glib::Timeout->add($config{UPDATE_FREQUENCY}*1000, sub { my $first_run if 0; if (!$first_run) { $first_run = 1; return 1; } - checkNetwork(); checkUpdates(); 1; }); @@ -423,7 +423,8 @@ sub checkNetwork() { if (!isNetwork()) { logIt(N_("Checking Network: seems disabled\n")); go2State('disconnected'); - } + } elsif (member($state_global, qw(disconnected))) { + silentCheck(); #- state has changed, update } sub checkUpdates() { @@ -530,5 +531,6 @@ LASTCHECK=$date sub mainQuit() { # setAutoStart('FALSE'); Glib::Source->remove($timeout) if $timeout; + Glib::Source->remove($network_timeout) if $network_timeout; Gtk2->main_quit; } |