From 0f7616a007edaa1d19c4672a4fd390c072b1eba6 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 13 Dec 2009 14:32:58 +0100 Subject: Error system transformation to GError Note that most coreworkers are broken at the moment. --- UCoreUtils.pas | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'UCoreUtils.pas') diff --git a/UCoreUtils.pas b/UCoreUtils.pas index f319d44..faf6eb5 100644 --- a/UCoreUtils.pas +++ b/UCoreUtils.pas @@ -34,9 +34,6 @@ const ConstERRSpawn = 26; ConstQuotationCharacters = [' ', '"', '''', '(', ')', ':', '&']; ConstURIIllegalCharacters = '%:@/'; -function GetErrorString(ErrorNo: integer): string; -function GetSignalString(SignalNo: integer): string; - function FormatSize(Value: Int64; Base: integer; OverrideSizeFormat: integer = -1): string; function FormatDate(Value: time_t; const FormatTime, FormatDate: boolean; OverrideTimeFormat: integer = -1; OverrideDateFormat: integer = -1; OverrideDateTimeFormat: integer = -1; OverrideCustomDateFormat: string = ''; OverrideCustomTimeFormat: string = ''): string; function StripDate(Value: time_t): time_t; @@ -143,24 +140,6 @@ implementation uses DateUtils, GTKForms, GTKUtils, GTKView, ULocale, UConfig, UCore, UGnome, UMain, UFileAssoc; -(********************************************************************************************************************************) -function GetErrorString(ErrorNo: integer): string; -begin - if ErrorNo >= 0 then Result := StrToUTF8(String(strerror(ErrorNo))) - else - case ErrorNo of - ERRException : Result := LANGUnknownException; - ERRNoAccess : Result := LANGNoAccess; - else Result := LANGUnknownError; - end; -end; - -(********************************************************************************************************************************) -function GetSignalString(SignalNo: integer): string; -begin - Result := StrToUTF8(strsignal(SignalNo)); -end; - (********************************************************************************************************************************) function FormatFloat64(Value: Int64; Sep: string): string; var i : integer; @@ -1127,13 +1106,18 @@ end; (********************************************************************************************************************************) procedure DebugMsg(Params: array of const); -var - I: Integer; +var I: Integer; + P: PChar; begin if ParamDebug then begin for I := 0 to High(Params) do with Params[I] do case VType of + vtPointer: begin + P := g_strdup_printf('%p', VPointer); + Write(ErrOutput, P); + g_free(P); + end; vtInteger: Write(ErrOutput, IntToStr(VInteger)); vtBoolean: Write(ErrOutput, VBoolean); vtChar: Write(ErrOutput, VChar); -- cgit v1.2.3