diff options
-rwxr-xr-x | src/ivymon | 49 |
1 files changed, 25 insertions, 24 deletions
@@ -2162,32 +2162,33 @@ sub loadfile { } # end loadfile +#______ sub stepsnumber { - my $step = 0; - my $timefound; - my $lc; - # select loading mode - # if the 1rst message contains a time field, a dialog window - # will be displayed in order to select replay mode or simple - # display mode. - while(<IN>) { - chomp; - next if (/^applications=/ or /^(marker\d+)$/); - if (/^messages_number=(.*)/) { - $step = int($1/10); - next; - } - my ($sender, $message) = split(/\s+/, $_, 2); - $timefound = 1 if $message =~ /^(\d[\d\.]+\d)\s+.*/; - last if $step; - $lc++; - } - $step = int($lc/10) unless $step; - $progressbar->configure(-to => $step*10); - seek(IN, 0, 0); - return ($step, $timefound); - + my $step = 0; + my $timefound; + my $lc = 0; + # select loading mode + # if the 1rst message contains a time field, a dialog window + # will be displayed in order to select replay mode or simple + # display mode. + + # get lines number and test if exists time field + while(<IN>) { + chomp; + next if (/^applications=/ or /^(marker\d+)$/ or /^(messages_number=)/ + or /^\#/); + my ($sender, $message) = split(/\s+/, $_, 2); + if ($message =~ /^(\d[\d\.]+\d)\s+.*/) { + $timefound = 1; + } + $lc++; + } + $step = int($lc/10); + $progressbar->configure(-to => $step*10); + seek(IN, 0, 0); + return ($step, $timefound); + } # end stepsnumber |