From 255271bbc79619267ec6e2214fea9056adcf644e Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sun, 24 Jun 2018 13:19:57 +0200 Subject: [PATCH] More work related to #336, take explicitly stderr now that it's not done implictly --- src/ce_ceproject.pas | 2 ++ src/ce_dubproject.pas | 2 ++ src/ce_main.lfm | 2 +- src/ce_processes.pas | 9 ++++++++- src/ce_projgroup.lfm | 22 +++++++++++----------- src/ce_tools.pas | 2 ++ 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/ce_ceproject.pas b/src/ce_ceproject.pas index 999b3c6c..b2c69581 100644 --- a/src/ce_ceproject.pas +++ b/src/ce_ceproject.pas @@ -923,6 +923,8 @@ var begin lst := TStringList.Create; try + if not fCompilProc.Running then + fCompilProc.appendStdErr; fCompilProc.getFullLines(lst); for str in lst do fMsgs.message(str, fAsProjectItf, amcProj, amkAuto); diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index e67c187e..39aa0792 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -944,6 +944,8 @@ var begin lst := TStringList.Create; try + if not fDubProc.Running then + fDubProc.appendStdErr; fDubProc.getFullLines(lst); for str in lst do fMsgs.message(str, fAsProjectItf, amcProj, amkAuto); diff --git a/src/ce_main.lfm b/src/ce_main.lfm index 0dd91a60..b2b78552 100644 --- a/src/ce_main.lfm +++ b/src/ce_main.lfm @@ -1472,7 +1472,7 @@ object CEMainForm: TCEMainForm OnResize = FormResize OnWindowStateChange = FormWindowStateChange ShowHint = True - LCLVersion = '1.8.2.0' + LCLVersion = '1.8.4.0' Visible = False object mainMenu: TMainMenu top = 1 diff --git a/src/ce_processes.pas b/src/ce_processes.pas index 9979a9da..32d060ee 100644 --- a/src/ce_processes.pas +++ b/src/ce_processes.pas @@ -9,6 +9,9 @@ uses type + //TODO: follow up https://bugs.freepascal.org/view.php?id=33897 + //which is the cause of the timer workaround + { The stanndard process wrapper used in Coedit. @@ -16,6 +19,7 @@ type - OnTerminate event is never called under Linux. Here a timer perdiodically check the process and call the event accordingly. + (STILL DOES NOT WORK) - TAsyncProcess.OnReadData event is not usable to read full output lines. Here the output is accumulated in a TMemoryStream which allows to keep data at the left of an unterminated line when a buffer is available. @@ -39,7 +43,6 @@ type procedure checkTerminated(sender: TObject); procedure setOnTerminate(value: TNotifyEvent); procedure setOnReadData(value: TNotifyEvent); - procedure appendStdErr; protected procedure internalDoOnReadData(sender: TObject); virtual; procedure internalDoOnTerminate(sender: TObject); virtual; @@ -50,7 +53,11 @@ type constructor create(aOwner: TComponent); override; destructor destroy; override; procedure execute; override; + // Check if process is terminated (bug 33897). + // Not to be called in the OnTerminated handler. procedure checkTerminated; + // Add stderr to stdout, to be called when terminated + procedure appendStdErr; // reads TProcess.OUtput in OutputStack procedure fillOutputStack; // fills list with the full lines contained in OutputStack diff --git a/src/ce_projgroup.lfm b/src/ce_projgroup.lfm index ed82d382..6a48d4f1 100644 --- a/src/ce_projgroup.lfm +++ b/src/ce_projgroup.lfm @@ -20,7 +20,7 @@ inherited CEProjectGroupWidget: TCEProjectGroupWidget ClientWidth = 328 object lstProj: TListView[0] Left = 4 - Height = 140 + Height = 124 Top = 4 Width = 320 Align = alClient @@ -30,22 +30,22 @@ inherited CEProjectGroupWidget: TCEProjectGroupWidget item AutoSize = True Caption = 'Name' - Width = 47 + Width = 51 end item AutoSize = True Caption = 'Type' - Width = 41 + Width = 42 end item AutoSize = True Caption = 'Async' - Width = 47 + Width = 51 end item AutoSize = True Caption = 'Configuration' - Width = 89 + Width = 174 end> GridLines = True HideSelection = False @@ -59,19 +59,19 @@ inherited CEProjectGroupWidget: TCEProjectGroupWidget end object Panel2: TPanel[1] Left = 4 - Height = 7 - Top = 148 + Height = 23 + Top = 132 Width = 320 Align = alBottom AutoSize = True BorderSpacing.Around = 4 BevelOuter = bvNone - ClientHeight = 7 + ClientHeight = 23 ClientWidth = 320 TabOrder = 1 object btnFreeFocus: TSpeedButton Left = 312 - Height = 7 + Height = 23 Hint = 'Put the focus on the ungrouped project' Top = 0 Width = 4 @@ -83,7 +83,7 @@ inherited CEProjectGroupWidget: TCEProjectGroupWidget end object StaticText1: TStaticText Left = 2 - Height = 3 + Height = 19 Top = 2 Width = 308 Align = alClient @@ -94,7 +94,7 @@ inherited CEProjectGroupWidget: TCEProjectGroupWidget end object btnAddUnfocused: TSpeedButton Left = 316 - Height = 7 + Height = 23 Hint = 'Put the ungrouped project in the group' Top = 0 Width = 4 diff --git a/src/ce_tools.pas b/src/ce_tools.pas index 53d18909..cf4fba96 100644 --- a/src/ce_tools.pas +++ b/src/ce_tools.pas @@ -254,6 +254,8 @@ begin begin lst := TStringList.Create; try + if not fProcess.Running then + fProcess.appendStdErr; fProcess.getFullLines(lst); for str in lst do fMsgs.message(str, nil, amcMisc, amkAuto);