aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-06-05 13:51:23 +0000
committerThierry Vignaud <tv@mandriva.org>2007-06-05 13:51:23 +0000
commit03c61d357d2cefac2c8d1c295f993ad9a9ed6ec4 (patch)
treec4f564b9c7cf962849d082ab680417f2e05fbb3e
parent7e72ea3b0c121881e7a252aa1652235af6aa05c2 (diff)
downloadrpmdrake-03c61d357d2cefac2c8d1c295f993ad9a9ed6ec4.tar
rpmdrake-03c61d357d2cefac2c8d1c295f993ad9a9ed6ec4.tar.gz
rpmdrake-03c61d357d2cefac2c8d1c295f993ad9a9ed6ec4.tar.bz2
rpmdrake-03c61d357d2cefac2c8d1c295f993ad9a9ed6ec4.tar.xz
rpmdrake-03c61d357d2cefac2c8d1c295f993ad9a9ed6ec4.zip
(do_search) limit the number of results to 2000, else Gtk2::TreeView
takes quite a lot of time in order to render the lsit (#30355)
-rwxr-xr-xrpmdrake7
1 files changed, 6 insertions, 1 deletions
diff --git a/rpmdrake b/rpmdrake
index 761c3fa2..31cd5fee 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -135,7 +135,12 @@ sub do_search($$$$$$$) {
$searchw->destroy;
}
} else {
- @search_results = grep { $_ =~ $entry_rx } @filtered_pkgs;
+ my $count;
+ foreach (@filtered_pkgs) {
+ next if !/$entry_rx/;
+ push @search_results, $_;
+ last if $count++ > 2000;
+ }
}
if (@search_results) {
$options->{add_nodes}->(map { [ $_, N("Search results") . ($options->{tree_mode} eq 'by_presence'