From 30d2d7b8f51d8a9cd6dfb47818d1372aa982c787 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 27 Jan 2016 06:49:17 +0100 Subject: [PATCH] minor changes to todo list tool and front end --- cetodo/cetodo.d | 33 ++++++++++++++++++--------------- src/ce_main.pas | 1 + src/ce_todolist.pas | 9 ++++++--- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/cetodo/cetodo.d b/cetodo/cetodo.d index 939759a0..693595b1 100644 --- a/cetodo/cetodo.d +++ b/cetodo/cetodo.d @@ -148,12 +148,12 @@ void main(string[] args) // efficient appending if the item text ~ fields is about 100 chars lfmApp.reserve(todoItems.length * 128 + 64); - + // serialize the items using the pascal component streaming text format lfmApp.put("object TTodoItems\r items = <"); foreach(todoItem; todoItems) todoItem.serialize(lfmApp); lfmApp.put(">\rend\r\n"); - + // the widget has the LFM script in the output write(lfmApp.data); @@ -192,7 +192,7 @@ void main(string[] args) { identifier ~= std.ascii.toUpper(text.front); text.popFront; - if (canFind(["TODO","FIXME"], identifier)) + if (identifier.among("TODO","FIXME")) { isTodoComment = true; break; @@ -213,7 +213,7 @@ void main(string[] args) if (front == ':') { if (identifier.length) fields = identifier; - isWellFormed = (text.length > 0); + isWellFormed = text.length > 0; break; } } @@ -223,24 +223,27 @@ void main(string[] args) // parses the item description fields string a, c, p, s; - if (fields.length) while (!fields.empty) + while (!fields.empty) { - auto front = fields.front; + dchar front = fields.front; fields.popFront; if ((front == '-' || fields.empty) && identifier.length > 2) { - auto field0 = identifier[0..2].toUpper; - auto field1 = identifier[2..$].strip; - if (field0 == "-A") a = field1; - else if (field0 == "-C") c = field1; - else if (field0 == "-P") p = field1; - else if (field0 == "-S") s = field1; - identifier = ""; + string fieldContent = identifier[2..$].strip; + switch(identifier[0..2].toUpper) + { + default: break; + case "-A": a = fieldContent; break; + case "-C": c = fieldContent; break; + case "-P": p = fieldContent; break; + case "-S": s = fieldContent; break; + } + identifier = ""; } identifier ~= front; } - - + + string line; try line = to!string(atok.line); catch(ConvException e) line = "0"; diff --git a/src/ce_main.pas b/src/ce_main.pas index 21097ae2..0a1d6b29 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -2177,6 +2177,7 @@ begin begin TForm(widg.Parent).FormStyle := fstyle[onTop]; //TODO-cbugfix: floating widg on top from true to false, widg remains on top + // OK on linux (LCL 1.6.0), initially observed on win & LCL 1.4.2 if TForm(widg.Parent).Visible then if not onTop then TForm(widg.Parent).SendToBack; end; diff --git a/src/ce_todolist.pas b/src/ce_todolist.pas index f1b64292..59166f30 100644 --- a/src/ce_todolist.pas +++ b/src/ce_todolist.pas @@ -404,6 +404,7 @@ end; procedure TCETodoListWidget.callToolProcess; var ctxt: TTodoContext; + i: integer; begin clearTodoList; if not exeInSysPath(ToolExeName) then @@ -423,9 +424,11 @@ begin // files passed to the tool argument if ctxt = tcProject then - fToolProc.Parameters.AddText(symbolExpander.get('')) - else - fToolProc.Parameters.Add(symbolExpander.get('')); + begin + for i := 0 to fProj.sourcesCount-1 do + fToolProc.Parameters.Add(fProj.sourceAbsolute(i)); + end + else fToolProc.Parameters.Add(fDoc.fileName); // fToolProc.Execute; end;