From 1c96f0253a3548a8f56b66687b50760ba5f05670 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Mar 2008 15:50:44 +0000 Subject: (silentCheck) rename as firstCheck() and simplify since we're now called only once at startup git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@241088 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94 --- draksnapshot-applet | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'draksnapshot-applet') diff --git a/draksnapshot-applet b/draksnapshot-applet index 43876a4..d1d1a09 100755 --- a/draksnapshot-applet +++ b/draksnapshot-applet @@ -42,7 +42,7 @@ use Gtk2::Notify '-init', 'draksnapshot'; ugtk2::add_icon_path("/usr/share/draksnapshot/pixmaps/"); -my ($menu, @discs, $state_global); +my ($menu, $state_global); my $localfile = "$ENV{HOME}/.draksnapshot"; @@ -83,7 +83,7 @@ shouldStart() or die "$localfile should be set to TRUE: please use --force or -f go2State('okay'); gtkflush(); -silentCheck(); +firstCheck(); $SIG{USR1} = 'IGNORE'; @@ -135,24 +135,9 @@ sub configure() { go2State('config_in_progress'); } -sub silentCheck() { - state @old_discs; - return if $config_pid; - my $w = $::main_window ? $::main_window->window : undef; - gtkset_mousecursor_wait($w); - - # force refreshing cache: - detect_devices::probeall_update_cache(); - @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI(); - go2State('okay') if !@discs; - - # are there any updates ? - my @a = difference2(\@discs, \@old_discs); - if (@a && $state_global ne 'disk_found') { - go2State('disk_found'); - } - @old_discs = @discs; - gtkset_mousecursor_normal($w) if !$insensitive_while_running_a_child; +sub firstCheck() { + my @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI(); + go2State(@discs ? 'disk_found' : 'okay'); } sub go2State { -- cgit v1.2.1