From fd7913901deefb8204c386e01ab6b18b2cac6874 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 23 Aug 2010 09:35:21 +0200 Subject: Use fpGUI wrapper functions instead of RTL functions directly. fpGUI's wrapper functions handle unicode conversions from OS automatically. --- docview/src/HelpFile.pas | 3 ++- docview/src/frm_main.pas | 2 +- src/corelib/fpg_base.pas | 2 +- src/gui/fpg_dialogs.pas | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index a3801aa5..4cd36edc 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -186,6 +186,7 @@ uses // ACLFileIOUtility, // ACLLanguageUnit; fpg_main + ,fpg_utils ,nvUtilities ,ACLStringUtility ; @@ -1219,7 +1220,7 @@ var fstream: TFileStream; Ext: string; begin - Ext := ExtractFileExt( Filename ); + Ext := fpgExtractFileExt( Filename ); Result := ''; if SameText( Ext, '.inf' ) diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 4defc759..8a3aa84a 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -1034,7 +1034,7 @@ begin if dlg.RunOpenFile then begin - Settings.LastOpenDirectory := ExtractFilePath(dlg.Filename); + Settings.LastOpenDirectory := fpgExtractFilePath(dlg.Filename); OpenFile(dlg.Filename, '', true); end; { TODO -oGraeme : Add support for multiple files. } diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index 199004ba..b9bc394b 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -2415,7 +2415,7 @@ var begin e := TFileEntry.Create; e.Name := sr.Name; - e.Extension := ExtractFileExt(e.Name); + e.Extension := fpgExtractFileExt(e.Name); e.Size := sr.Size; // e.Attributes := sr.Attr; // this is incorrect and needs to improve! e.ModTime := FileDateToDateTime(sr.Time); diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 73c668c3..25f01da9 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -1369,7 +1369,7 @@ begin if (i >= 0) and (i < FFilterList.Count) then Result := FFilterList[i] else - Result := '*'; + Result := AllFilesMask; end; function TfpgFileDialog.RunOpenFile: boolean; @@ -1378,12 +1378,12 @@ var fname: string; begin FOpenMode := True; - sdir := ExtractFileDir(FileName); + sdir := fpgExtractFileDir(FileName); if sdir = '' then sdir := '.'; SetCurrentDirectory(sdir); - fname := ExtractFileName(FileName); + fname := fpgExtractFileName(FileName); if not HighlightFile(fname) then edFilename.Text := fname; -- cgit v1.2.3-70-g09d2