Skip to content

Commit 5540d82

Browse files
author
delphidabbler
committed
Changed first run processing of proxy information to simply delete the ProxyServer config file section
1 parent 6cfd920 commit 5540d82

File tree

3 files changed

+8
-39
lines changed

3 files changed

+8
-39
lines changed

Src/FirstRun.FmV4ConfigDlg.pas

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ function TV4ConfigDlg.HeadingText(const PageIdx: Integer): string;
339339
procedure TV4ConfigDlg.ListChanges;
340340
resourcestring
341341
sHiliter = 'Syntax highlighter customisations have been lost.';
342-
sProxyPwd = 'Your proxy server password needs to be re-entered.';
343342
sSourceFormat = 'Source code formatting preferences may have been lost.';
344343
var
345344
Changes: IStringList;
@@ -351,8 +350,6 @@ procedure TV4ConfigDlg.ListChanges;
351350
Changes := TIStringList.Create;
352351
if frcHiliter in fCfgChanges then
353352
Changes.Add(sHiliter);
354-
if frcProxyPwd in fCfgChanges then
355-
Changes.Add(sProxyPwd);
356353
if frcSourceFormat in fCfgChanges then
357354
Changes.Add(sSourceFormat);
358355
CreateBulletPage(

Src/FirstRun.UConfigFile.pas

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,15 @@ TUserConfigFileUpdater = class(TConfigFileUpdater)
8585
procedure UpdateFromOriginal;
8686
/// <summary>Deletes any highlighter preferences.</summary>
8787
procedure DeleteHighligherPrefs;
88-
/// <summary>Checks a proxy password is present in file.</summary>
89-
function HasProxyPassword: Boolean;
90-
/// <summary>Deletes proxy password entry.</summary>
91-
procedure DeleteProxyPassword;
9288
/// <summary>Updates Prefs:CodeGen section from format prior to version 9
9389
/// to version 9 and later format.</summary>
9490
procedure UpdateCodeGenEntries;
9591
/// <summary>Deletes unused key that determines detail pane index.
9692
/// </summary>
9793
procedure DeleteDetailsPaneIndex;
9894
{$ENDIF}
95+
/// <summary>Deletes proxy server section.</summary>
96+
procedure DeleteProxyServerSection;
9997
/// <summary>Deletes unused Prefs:News section.</summary>
10098
procedure DeleteNewsPrefs;
10199
/// <summary>Effectively renames MainWindow section used prior to version
@@ -294,27 +292,18 @@ procedure TUserConfigFileUpdater.DeleteNewsPrefs;
294292
DeleteIniSection('Prefs:News', CfgFileName);
295293
end;
296294

297-
{$IFNDEF PORTABLE}
298-
procedure TUserConfigFileUpdater.DeleteProxyPassword;
295+
procedure TUserConfigFileUpdater.DeleteProxyServerSection;
299296
begin
300297
if not TFile.Exists(CfgFileName, False) then
301298
CreateNewFile;
302-
SetIniString('ProxyServer', 'Password', '', CfgFileName);
299+
DeleteIniSection('ProxyServer', CfgFileName);
303300
end;
304-
{$ENDIF}
305301

306302
class function TUserConfigFileUpdater.GetFileVersion: Integer;
307303
begin
308304
Result := FileVersion;
309305
end;
310306

311-
{$IFNDEF PORTABLE}
312-
function TUserConfigFileUpdater.HasProxyPassword: Boolean;
313-
begin
314-
Result := GetIniString('ProxyServer', 'Password', '', CfgFileName) <> '';
315-
end;
316-
{$ENDIF}
317-
318307
procedure TUserConfigFileUpdater.RenameMainWindowSection;
319308
begin
320309
if not TFile.Exists(CfgFileName, False) then

Src/FirstRun.UMain.pas

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ interface
2727
/// config files that result in data loss.</summary>
2828
TFirstRunCfgChanges = (
2929
frcHiliter, // syntax highlighter customisation lost
30-
frcProxyPwd, // internet proxy password lost
3130
frcSourceFormat // source code output formatting lost
3231
);
3332

@@ -56,11 +55,6 @@ TFirstRun = class(TObject)
5655
/// <summary>Object used to copy forward older versions of user database.
5756
/// </summary>
5857
fDatabase: TUserDatabaseUpdater;
59-
{$IFNDEF PORTABLE}
60-
/// <summary>Checks if config file uses earlier format for storing proxy
61-
/// server passwords.</summary>
62-
function HasOldStyleProxyPwd: Boolean;
63-
{}{$ENDIF}
6458
public
6559
/// <summary>Constructs object and owned object.</summary>
6660
constructor Create;
@@ -183,13 +177,6 @@ destructor TFirstRun.Destroy;
183177
inherited;
184178
end;
185179

186-
{$IFNDEF PORTABLE}
187-
function TFirstRun.HasOldStyleProxyPwd: Boolean;
188-
begin
189-
Result := (fUserConfigFile.FileVer <= 6) and fUserConfigFile.HasProxyPassword;
190-
end;
191-
{$ENDIF}
192-
193180
function TFirstRun.HaveOldUserCfgFile: Boolean;
194181
begin
195182
Result := TFile.Exists(fInstallInfo.PreviousUserConfigFileName, False);
@@ -222,14 +209,7 @@ procedure TFirstRun.UpdateUserCfgFile(out Changes: TFirstRunCfgChangeSet);
222209
fUserConfigFile.DeleteHighligherPrefs;
223210
Include(Changes, frcHiliter);
224211
end;
225-
piV3:
226-
begin
227-
if HasOldStyleProxyPwd then
228-
begin
229-
fUserConfigFile.DeleteProxyPassword;
230-
Include(Changes, frcProxyPwd);
231-
end;
232-
end;
212+
piV3: ; // do nothing
233213
end;
234214
{$ENDIF}
235215

@@ -259,7 +239,10 @@ procedure TFirstRun.UpdateUserCfgFile(out Changes: TFirstRunCfgChangeSet);
259239

260240

261241
if fUserConfigFile.FileVer < 16 then
242+
begin
262243
fUserConfigFile.DeleteNewsPrefs;
244+
fUserConfigFile.DeleteProxyServerSection;
245+
end;
263246

264247
if fCommonConfigFile.FileVer < 7 then
265248
fCommonConfigFile.DeleteRegistrationInfo;

0 commit comments

Comments
 (0)