diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2015-02-06 10:58:46 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2015-02-06 10:59:06 +0300 |
commit | 9622771ee8745960efc3ef44f3bb905c0143f0ca (patch) | |
tree | 28c6e1fb45e656dc5bedc018599aadae2da2365f /main | |
parent | 5673de1d8a74c8074cfb5f8c16a8de4d211002e6 (diff) |
[Ide] Search progress bar is now smoother.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs index 9871ce0192..ebe74b0b42 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs @@ -89,7 +89,7 @@ namespace MonoDevelop.Ide.FindInFiles } IsRunning = true; FoundMatchesCount = SearchedFilesCount = 0; - monitor.BeginTask (scope.GetDescription (filter, pattern, replacePattern), 50); + monitor.BeginTask (scope.GetDescription (filter, pattern, replacePattern), 150); try { int totalWork = scope.GetTotalWork (filter); int step = Math.Max (1, totalWork / 50); @@ -98,7 +98,10 @@ namespace MonoDevelop.Ide.FindInFiles var contents = new List<Tuple<FileProvider, string, List<SearchResult>>>(); foreach (var provider in scope.GetFiles (monitor, filter)) { try { + searchedFilesCount++; contents.Add(Tuple.Create (provider, provider.ReadString (), new List<SearchResult> ())); + if (searchedFilesCount % step == 0) + monitor.Step (2); } catch (FileNotFoundException) { MessageService.ShowError (string.Format (GettextCatalog.GetString ("File {0} not found.")), provider.FileName); } @@ -115,7 +118,7 @@ namespace MonoDevelop.Ide.FindInFiles results.AddRange (content.Item3); } FoundMatchesCount += content.Item3.Count; - if (searchedFilesCount % step == 0)
+ if (searchedFilesCount % step == 0) monitor.Step (1); } catch (Exception e) { LoggingService.LogError("Exception during search.", e); |