Skip to content

Commit a92c074

Browse files
- melhoria na ordem da propriedade do CompressType
- mudança no tipo da propriedade DatabaseLink do TRALDBModule de StringRAL para String
1 parent 95a0394 commit a92c074

4 files changed

Lines changed: 25 additions & 7 deletions

File tree

src/base/RALRegister.pas

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ TRALBaseURLEditor = class(TClassProperty)
3838

3939
TRALCompressEditor = class(TEnumProperty)
4040
public
41+
function GetAttributes: TPropertyAttributes; override;
4142
procedure GetValues(Proc: TGetStrProc); override;
4243
end;
4344

@@ -163,6 +164,14 @@ procedure TRALBaseURLEditor.SetValue(const Value: string);
163164

164165
{ TRALCompressEditor }
165166

167+
function TRALCompressEditor.GetAttributes: TPropertyAttributes;
168+
begin
169+
Result := [paValueList];
170+
{$IFDEF FPC}
171+
Result := Result + [paPickList];
172+
{$ENDIF}
173+
end;
174+
166175
procedure TRALCompressEditor.GetValues(Proc: TGetStrProc);
167176
var
168177
vStr: TStringList;

src/database/RALDBModule.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface
1515
TRALDBModule = class(TRALModuleRoutes)
1616
private
1717
FDatabase: StringRAL;
18-
FDatabaseLink: StringRAL;
18+
FDatabaseLink: String;
1919
FDatabaseType: TRALDatabaseType;
2020
FHostname: StringRAL;
2121
FPassword: StringRAL;
@@ -43,7 +43,7 @@ TRALDBModule = class(TRALModuleRoutes)
4343
constructor Create(AOwner: TComponent); override;
4444
published
4545
property Database: StringRAL read FDatabase write FDatabase;
46-
property DatabaseLink: StringRAL read FDataBaseLink write FDataBaseLink;
46+
property DatabaseLink: String read FDataBaseLink write FDataBaseLink;
4747
property DatabaseType: TRALDatabaseType read FDatabaseType write FDatabaseType;
4848
property Hostname: StringRAL read FHostname write FHostname;
4949
property Password: StringRAL read FPassword write FPassword;

src/database/raldbregister.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ procedure Register;
4848
RegisterComponents('RAL - Client', [TRALDBConnection]);
4949
RegisterComponents('RAL - Modules', [TRALDBModule]);
5050

51-
RegisterPropertyEditor(TypeInfo(StringRAL), TRALDBModule, 'DatabaseLink', TRALDBDatabases);
51+
RegisterPropertyEditor(TypeInfo(String), TRALDBModule, 'DatabaseLink', TRALDBDatabases);
5252

5353
{$IFNDEF FPC}
5454
RegisterSelectionEditor(TRALDBModule, TRALDBModuleSelectionEditor);

src/utils/RALCompress.pas

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,23 @@ procedure GetCompressList(AList: TStrings);
125125
var
126126
vInt : IntegerRAL;
127127
vStrType : StringRAL;
128+
vList : TStringList;
128129
begin
129130
CheckCompressDefs;
130131

131-
vStrType := GetEnumName(TypeInfo(TRALCompressType), Ord(ctNone));
132-
AList.Add(vStrType);
132+
vList := TStringList.Create;
133+
try
134+
for vInt := 0 to Pred(CompressDefs.Count) do
135+
vList.Add(CompressDefs.Names[vInt]);
133136

134-
for vInt := 0 to Pred(CompressDefs.Count) do
135-
AList.Add(CompressDefs.Names[vInt]);
137+
vList.Sort;
138+
AList.Assign(vList);
139+
finally
140+
FreeAndNil(vList);
141+
end;
142+
143+
vStrType := GetEnumName(TypeInfo(TRALCompressType), Ord(ctNone));
144+
AList.Insert(0, vStrType);
136145
end;
137146

138147
function GetSuportedCompress: TRALCompressTypes;

0 commit comments

Comments
 (0)