IDE: clean up

git-svn-id: trunk@45179 -
This commit is contained in:
mattias 2014-05-25 21:00:04 +00:00
parent 1797870a52
commit b51d55bfad
3 changed files with 20 additions and 35 deletions

View File

@ -138,9 +138,9 @@ type
function HasSourcePosition: boolean;
procedure GetAttributes(List: TStrings);
public
property Index: integer read FIndex; // index in Lines (Note: Lines can have more or less lines than the raw output)
property Index: integer read FIndex; // index in Lines (Note: Lines can have more or less items than the raw output has text lines)
property Urgency: TMessageLineUrgency read FUrgency write SetUrgency;
property SubTool: string read FSubTool write SetSubTool; // e.g. FPC, make, linker, windres
property SubTool: string read FSubTool write SetSubTool; // e.g. SubToolFPC, SubToolMake, SubToolFPCLinker
property SubType: PtrUInt read FSubType write SetSubType; // depends on SubTool
property Msg: string read FMsg write SetMsg; // improved message without filename, line, column
property MsgID: integer read FMsgID write SetMsgID; // message id (depends on parser, e.g. fpc writes them with -vq, MsgID<>0 if valid)
@ -343,7 +343,7 @@ type
function ApplyPending: boolean; virtual; // true if something changed (main thread)
procedure InputClosed; virtual; // called by Tool when source closed (main thread)
function LineFits(Line: TMessageLine): boolean; virtual; // called by ProcessNewMessages (worker thread)
procedure EnterCriticalSection; virtual;
procedure EnterCriticalSection; virtual; // Note: when using Tool and View: always lock Tool before View
procedure LeaveCriticalSection; virtual;
procedure ConsistencyCheck; virtual;
public
@ -442,7 +442,7 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure EnterCriticalSection; virtual; // always use before access
procedure EnterCriticalSection; virtual; // always use before access, when using Tool and View: always lock Tool before View
procedure LeaveCriticalSection; virtual;
property Thread: TThread read FThread write FThread;
procedure ConsistencyCheck; virtual;
@ -2078,15 +2078,14 @@ begin
//debugln(['TExtToolView.ProcessNewMessages Msg="',SrcMsg.Msg,'" Fits=',LineFits(SrcMsg)]);
if LineFits(SrcMsg) then begin
NewProgressLine:=nil;
end else begin
NewProgressLine:=SrcMsg;
continue;
end;
Changed:=true;
NewMsg:=PendingLines.CreateLine(-1);
NewMsg.Assign(SrcMsg);
//debugln(['TExtToolView.ProcessNewMessages NewMsg=',Lines.Count,'="',NewMsg.Msg,'"']);
PendingLines.Add(NewMsg);
end else begin
NewProgressLine:=SrcMsg;
end;
end;
FLastWorkerMessageCount:=Tool.WorkerMessages.Count-1;
if (NewProgressLine<>nil) and Running then begin

View File

@ -1321,7 +1321,6 @@ function TIDEFPCParser.CheckForLinkingErrors(p: PChar): boolean;
var
OldStart: PChar;
MsgLine: TMessageLine;
PrevMsgLine: TMessageLine;
procedure AddLinkerMsg;
begin
@ -1336,18 +1335,6 @@ begin
Result:=true;
OldStart:=p;
PrevMsgLine:=Tool.WorkerMessages.GetLastLine;
if PrevMsgLine<>nil then begin
if (PrevMsgLine.SubTool=SubToolFPCLinker)
or ((PrevMsgLine.SubTool=SubToolFPC) and (PrevMsgLine.MsgID=9015)) // (9015) Linking <progname>
then begin
// this is a follow up linker warning/error
AddLinkerMsg;
MsgLine.Urgency:=PrevMsgLine.Urgency;
exit;
end;
end;
// check "Closing script ppas.sh"
if CompStr('Closing script ppas.sh',p) then begin
AddLinkerMsg;

View File

@ -150,7 +150,7 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function LineFits(Line: TMessageLine): boolean; override;
function LineFits(Line: TMessageLine): boolean; override; // (worker thread)
property Control: TMessagesCtrl read FControl;
function HasContent: boolean;
function GetShownLineCount(WithHeader, WithProgressLine: boolean): integer;
@ -1270,10 +1270,6 @@ begin
// debugln(['TLMsgWndView.RebuildLines i=',i,' Msg="',SrcMsg.Msg,'" Fits=',LineFits(SrcMsg),' ',dbgs(SrcMsg.Flags),' ',SrcMsg.OutputIndex]);
if LineFits(SrcMsg) then begin
NewProgressLine:=nil;
end else begin
NewProgressLine:=SrcMsg;
continue;
end;
NewMsg:=Lines.CreateLine(-1);
NewMsg.Assign(SrcMsg);
// adapt line,col due to src changes
@ -1284,6 +1280,9 @@ begin
NewMsg.SetSourcePosition(NewMsg.Filename,Line,Col);
//debugln(['TLMsgWndView.RebuildLines NewMsg=',Lines.Count,'="',NewMsg.Msg,'"']);
Lines.Add(NewMsg);
end else begin
NewProgressLine:=SrcMsg;
end;
end;
FLastWorkerMessageCount:=Tool.WorkerMessages.Count-1;
if (NewProgressLine<>nil) and Running then begin