summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2009-03-22 11:37:43 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2009-03-22 11:37:43 +0000
commitdea01faa805d728be3fcc887ba4cbe5b9c986559 (patch)
tree41ae38443a93028ab579f9a1ebd08de86cc73091 /src
parent1e5618cc94dd0fc3acdab5c42e2cc8ca56e03795 (diff)
downloadfpGUI-dea01faa805d728be3fcc887ba4cbe5b9c986559.tar.xz
* Removed X11 alternate implementations for FreeBSD and Linux systems when reading file username and groupname values.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/x11/fpg_x11.pas48
1 files changed, 3 insertions, 45 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index a906ff2b..7a1c04d5 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -284,8 +284,6 @@ type
TfpgFileListImpl = class(TfpgFileListBase)
function EncodeModeString(FileMode: longword): TFileModeString;
- function GetUserName(uid: integer): string;
- function GetGroupName(gid: integer): string;
constructor Create; override;
function InitializeEntry(sr: TSearchRec): TFileEntry; override;
procedure PopulateSpecialDirs(const aDirectory: TfpgString); override;
@@ -299,8 +297,7 @@ implementation
uses
baseunix,
- // Graeme: temporary. libc is not available for FreeBSD.
- {$if defined(linux) and defined(cpu386)}libc,{$endif}
+ users, { for *nix user and group name support }
fpg_main,
fpg_widget,
fpg_popupwindow,
@@ -2364,51 +2361,12 @@ begin
end;
end;
-{$if defined(linux) and defined(cpu386)}
-function TfpgFileListImpl.GetUserName(uid: integer): string;
-var
- p: PPasswd;
-begin
- p := getpwuid(uid);
- if p <> nil then
- result := p^.pw_name
- else
- result := '';
-end;
-{$else}
-// Still need to find an alternative for FreeBSD as we can't use the libc unit.
-function TfpgFileListImpl.GetUserName(uid: integer): string;
-begin
- result := IntToStr(uid);
-end;
-{$endif}
-
constructor TfpgFileListImpl.Create;
begin
inherited Create;
FHasFileMode := true;
end;
-{$if defined(linux) and defined(cpu386)}
-function TfpgFileListImpl.GetGroupName(gid: integer): string;
-var
- p: PGroup;
-begin
- p := getgrgid(gid);
- if p <> nil then
- result := p^.gr_name;
-end;
-
-{$else}
-// Still need to find an alternative for FreeBSD as we can't use the libc unit.
-function TfpgFileListImpl.GetGroupName(gid: integer): string;
-begin
- result := IntToStr(gid);
-end;
-
-
-{$endif}
-
function TfpgFileListImpl.InitializeEntry(sr: TSearchRec): TFileEntry;
var
info: Tstat;
@@ -2425,8 +2383,8 @@ begin
Fpstat(PChar(fullname), info);
{Result.GroupID := info.st_gid;
Result.OwnerID := info.st_uid;}
- Result.Owner := GetUserName(info.st_uid);
- Result.Group := GetGroupName(info.st_uid);
+ Result.Owner := GetUserName(TUID(info.st_uid));
+ Result.Group := GetGroupName(TGID(info.st_uid));
end;
end;