mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 14:59:15 +02:00
+ Add progress every 100 files
This commit is contained in:
parent
f1abd077e5
commit
ce1a3e5b62
@ -235,6 +235,8 @@ Type
|
|||||||
TInstantSearchIndexTreeThread = class(TInstantSearchIndexThread)
|
TInstantSearchIndexTreeThread = class(TInstantSearchIndexThread)
|
||||||
private
|
private
|
||||||
FTrees : TSourceTreeDefinitionList;
|
FTrees : TSourceTreeDefinitionList;
|
||||||
|
FCurrentTree : string;
|
||||||
|
FProcessedCount : Integer;
|
||||||
procedure DoCheckTerminate(Sender: TObject; const aFileName: String; var aContinue: Boolean);
|
procedure DoCheckTerminate(Sender: TObject; const aFileName: String; var aContinue: Boolean);
|
||||||
function IndexTree(aTree: TSourceTreeDefinition): Integer;
|
function IndexTree(aTree: TSourceTreeDefinition): Integer;
|
||||||
Public
|
Public
|
||||||
@ -400,6 +402,9 @@ end;
|
|||||||
procedure TInstantSearchIndexTreeThread.DoCheckTerminate(Sender: TObject;
|
procedure TInstantSearchIndexTreeThread.DoCheckTerminate(Sender: TObject;
|
||||||
const aFileName: String; var aContinue: Boolean);
|
const aFileName: String; var aContinue: Boolean);
|
||||||
begin
|
begin
|
||||||
|
inc(FProcessedCount);
|
||||||
|
if (FProcessedCount mod 100)=0 then
|
||||||
|
DoLog(mlkProgress,lrsIndexingTreeFileCount,[FCurrentTree,FProcessedCount]);
|
||||||
if Terminated then
|
if Terminated then
|
||||||
aContinue:=False;
|
aContinue:=False;
|
||||||
end;
|
end;
|
||||||
@ -410,20 +415,21 @@ procedure TInstantSearchIndexTreeThread.Execute;
|
|||||||
var
|
var
|
||||||
I,aCount : Integer;
|
I,aCount : Integer;
|
||||||
aTree : TSourceTreeDefinition;
|
aTree : TSourceTreeDefinition;
|
||||||
aName : string;
|
|
||||||
begin
|
begin
|
||||||
For I:=0 to FTrees.Count-1 do
|
For I:=0 to FTrees.Count-1 do
|
||||||
try
|
try
|
||||||
|
FProcessedCount:=0;
|
||||||
aTree:=FTrees[i];
|
aTree:=FTrees[i];
|
||||||
aName:=aTree.Name;
|
FCurrentTree:=aTree.Name;
|
||||||
DoLog(mlkProgress,lrsStartIndexingTree,[aName,aTree.BaseDir]);
|
DoLog(mlkProgress,lrsStartIndexingTree,[FCurrentTree,aTree.BaseDir]);
|
||||||
aCount:=IndexTree(aTree);
|
aCount:=IndexTree(aTree);
|
||||||
DoLog(mlkProgress,lrsFinishedIndexingTree,[aName,aCount]);
|
DoLog(mlkProgress,lrsFinishedIndexingTree,[FCurrentTree,aCount]);
|
||||||
if Terminated then
|
if Terminated then
|
||||||
Break;
|
Break;
|
||||||
except
|
except
|
||||||
On E : exception do
|
On E : exception do
|
||||||
DoLog(mlkError,'Exception %s while indexing tree %s : %s',[E.ClassName,aName,E.Message]);
|
DoLog(mlkError,'Exception %s while indexing tree %s : %s',[E.ClassName,FCurrentTree,E.Message]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -109,6 +109,7 @@ Resourcestring
|
|||||||
lrsCannotIndexIndexInProgress = 'Cannot start an index operation while another one is in progress.';
|
lrsCannotIndexIndexInProgress = 'Cannot start an index operation while another one is in progress.';
|
||||||
lrsFinishedIndexingTree = 'Finished indexing tree "%s". Processed %d files.';
|
lrsFinishedIndexingTree = 'Finished indexing tree "%s". Processed %d files.';
|
||||||
lrsStartIndexingTree = 'Start indexing tree "%s", directory: "%s"';
|
lrsStartIndexingTree = 'Start indexing tree "%s", directory: "%s"';
|
||||||
|
lrsIndexingTreeFileCount = 'Tree "%s", indexed file count: %d';
|
||||||
lrsFinishedIndexingProject = 'Finished indexing project "%s". Processed %d files.';
|
lrsFinishedIndexingProject = 'Finished indexing project "%s". Processed %d files.';
|
||||||
lrsIndexingProjectTerminated = 'Indexing project "%s" was terminated. Processed %d files.';
|
lrsIndexingProjectTerminated = 'Indexing project "%s" was terminated. Processed %d files.';
|
||||||
lrsStartIndexingProject = 'Start indexing project "%s", directory: "%s"';
|
lrsStartIndexingProject = 'Start indexing project "%s", directory: "%s"';
|
||||||
|
@ -195,6 +195,11 @@ msgstr ""
|
|||||||
msgid "Indexing project \"%s\" was terminated. Processed %d files."
|
msgid "Indexing project \"%s\" was terminated. Processed %d files."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: instantsearchstrings.lrsindexingtreefilecount
|
||||||
|
#, object-pascal-format
|
||||||
|
msgid "Tree \"%s\", indexed file count: %d"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: instantsearchstrings.lrsindexlater
|
#: instantsearchstrings.lrsindexlater
|
||||||
msgid "No, do not index now"
|
msgid "No, do not index now"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -219,6 +219,11 @@ msgstr "Индексирование и поиск"
|
|||||||
msgid "Indexing project \"%s\" was terminated. Processed %d files."
|
msgid "Indexing project \"%s\" was terminated. Processed %d files."
|
||||||
msgstr "Индексирование проекта \"%s\" прервано. Обработано файлов: %d."
|
msgstr "Индексирование проекта \"%s\" прервано. Обработано файлов: %d."
|
||||||
|
|
||||||
|
#: instantsearchstrings.lrsindexingtreefilecount
|
||||||
|
#, object-pascal-format
|
||||||
|
msgid "Tree \"%s\", indexed file count: %d"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: instantsearchstrings.lrsindexlater
|
#: instantsearchstrings.lrsindexlater
|
||||||
msgid "No, do not index now"
|
msgid "No, do not index now"
|
||||||
msgstr "Нет, не индексировать сейчас"
|
msgstr "Нет, не индексировать сейчас"
|
||||||
|
Loading…
Reference in New Issue
Block a user