Skip to content

Commit 07e8f99

Browse files
author
delphidabbler
committed
Renamed & re-arranged TURL constants
Updated all affected code.
1 parent 60688e4 commit 07e8f99

File tree

8 files changed

+39
-35
lines changed

8 files changed

+39
-35
lines changed

Src/FmBugReportBaseDlg.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ procedure TBugReportBaseDlg.GoToTracker;
100100
// must be able to override this method.
101101
with TBrowseURL.Create(nil) do
102102
try
103-
URL := TURL.BugTrackerURL;
103+
URL := TURL.CodeSnipBugTracker;
104104
Execute;
105105
finally
106106
Free;

Src/FmDBUpdateDlg.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ procedure TDBUpdateDlg.ConfigForm;
272272
begin
273273
Tplt.ResolvePlaceholderText(
274274
'CSDBReleaseURL',
275-
TURL.CSDBReleaseURL
275+
TURL.CodeSnippetsDBReleases
276276
);
277277
end
278278
);

Src/FmMain.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,9 +1337,9 @@ procedure TMainForm.InitForm;
13371337

13381338
// Initialise actions
13391339
// Browse actions have to have URLs set dynamically
1340-
actGitHubHome.URL := TURL.GitHubURL;
1341-
actFAQs.URL := TURL.FAQsURL;
1342-
actBlog.URL := TURL.BlogURL;
1340+
actGitHubHome.URL := TURL.CodeSnip;
1341+
actFAQs.URL := TURL.CodeSnipFAQReadMe;
1342+
actBlog.URL := TURL.CodeSnipBlog;
13431343
// Tree control actions need shortcuts adding dynamically, and state stored
13441344
// in Tag property
13451345
actExpandNode.ShortCut := ShortCut(VK_ADD, [ssCtrl]);

Src/FmSWAGImportDlg.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ procedure TSWAGImportDlg.ConfigForm;
482482
begin
483483
Tplt.ResolvePlaceholderText(
484484
'SWAGReleaseURL',
485-
TURL.SWAGReleaseURL
485+
TURL.SWAGReleases
486486
);
487487
end
488488
);

Src/UPaypalDonateAction.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function TPaypalDonateAction.Execute: Boolean;
6161
// use a TBrowseAction to access URL
6262
BrowseAction := TBrowseURL.Create(nil);
6363
try
64-
BrowseAction.URL := TURL.DonateURL;
64+
BrowseAction.URL := TURL.PaypalDonate;
6565
BrowseAction.Execute;
6666
finally
6767
FreeAndNil(BrowseAction);

Src/USaveUnitMgr.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function TSaveUnitMgr.CreateHeaderComments: IStringList;
150150
// Result used for units that contain at snippet(s) from main database
151151
Result.Add(Format(sLicense, [FormatDateTime('YYYY', Now)]));
152152
Result.Add('');
153-
Result.Add(Format(sMainDescription, [TURL.DatabaseURL]));
153+
Result.Add(Format(sMainDescription, [TURL.CodeSnip]));
154154
Result.Add('');
155155
Result.Add(Format(sGenerated, [RFC1123DateStamp]));
156156
Result.Add(
@@ -160,7 +160,7 @@ function TSaveUnitMgr.CreateHeaderComments: IStringList;
160160
);
161161
Result.Add('');
162162
Result.Add(
163-
Format(sAdvert, [TAppInfo.ProgramName, TURL.GitHubURL])
163+
Format(sAdvert, [TAppInfo.ProgramName, TURL.CodeSnip])
164164
);
165165
end
166166
else

Src/USnippetDoc.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function TSnippetDoc.Generate(const Snippet: TSnippet): TEncodedData;
181181
RenderExtra(Snippet.Extra);
182182
if not Snippet.UserDefined then
183183
// database info written only if snippet is from main database
184-
RenderDBInfo(Format(sMainDatabaseInfo, [TURL.DatabaseURL]));
184+
RenderDBInfo(Format(sMainDatabaseInfo, [TURL.CodeSnip]));
185185
Result := FinaliseDoc;
186186
end;
187187

Src/UUrl.pas

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,46 @@ interface
2222
TURL = record
2323
strict private
2424
const
25-
/// <summary>Name of server that hosts tested and released web services
26-
/// that are used by CodeSnip.</summary>
27-
/// <remarks>There is also a test server that can be used by CodeSnip
28-
/// where new and updated web services are tested - see
29-
/// <c>TestServerHost</c> below.</remarks>
30-
ProductionServerHost = 'delphidabbler.com';
31-
/// <summary>URL of DelphiDabbler website.</summary>
32-
WebsiteURL = 'http://' + ProductionServerHost;
25+
/// <summary>URL of DelphiDabbler's account on GitHub repository.
26+
/// </summary>
27+
DDabGitHub = 'https://github.com/delphidabbler';
28+
/// <summary>URL of the Code Snippet database's GitHub repository.
29+
/// </summary>
30+
CodeSnippetsDB = DDabGitHub + '/code-snippets';
31+
/// <summary>URL of the SWAG database's GitHub repository.</summary>
32+
SWAG = DDabGitHub + '/swag';
33+
/// <summary>URL of the CodeSnip FAQ's GitHub repository.</summary>
34+
CodeSnipFAQ = DDabGitHub + '/codesnip-faq';
3335
public
3436
const
35-
/// <summary>URL of CodeSnip's GitHub page.</summary>
36-
GitHubURL = 'https://github.com/delphidabbler/codesnip';
37+
/// <summary>URL of CodeSnip's GitHub repository.</summary>
38+
CodeSnip = DDabGitHub + '/codesnip';
39+
40+
/// <summary>URL used to view and report CodeSnip bugs on GitHub.
41+
/// </summary>
42+
CodeSnipBugTracker = CodeSnip + '/issues';
43+
44+
/// <summary>URL of CodeSnip's FAQ web page.</summary>
45+
/// <remarks>This is the CodeSnip FAQ project on GitHub.</remarks>
46+
CodeSnipFAQReadMe = CodeSnipFAQ + '/blob/master/README.md';
47+
3748
/// <summary>URL of the GitHub page where DelphiDabbler Code Snippets
3849
/// database releases are hosted.</summary>
39-
CSDBReleaseURL = 'https://github.com/'
40-
+ 'delphidabbler/code-snippets/releases';
50+
CodeSnippetsDBReleases = CodeSnippetsDB + '/releases';
51+
4152
/// <summary>URL of the GitHub page where SWAG database releases are
4253
/// hosted.</summary>
43-
SWAGReleaseURL = 'https://github.com/delphidabbler/swag/releases';
44-
/// <summary>URL of the online Code Snippets database.</summary>
45-
DatabaseURL = WebsiteURL + '/url/csdb';
54+
SWAGReleases = SWAG + '/releases';
55+
4656
/// <summary>URL used to make donations towards the CodeSnip project.
4757
/// </summary>
48-
/// <remarks>This URL redirects to the correct page on PayPal.</remarks>
49-
DonateURL = 'https://www.paypal.com/donate/?'
58+
PaypalDonate = 'https://www.paypal.com/donate/?'
5059
+ 'token=LYnh7_DXV-YqTmX3Bilr9rCPN89oANmBTZmRCdNHu_qFSk2jo_'
5160
+ 'WzTYTXCE165U9hXEmwq0&country.x=GB&locale.x=GB';
52-
/// <summary>URL used to view and report CodeSnip bugs on GitHub.
53-
/// </summary>
54-
BugTrackerURL = GitHubURL + '/issues';
55-
/// <summary>URL of CodeSnip's FAQ web page.</summary>
56-
/// <remarks>This is the CodeSnip FAQ project on GitHub.</remarks>
57-
FAQsURL = 'https://github.com/delphidabbler/codesnip-faq/'
58-
+ 'blob/master/README.md';
61+
5962
/// <summary>URL of the the CodeSnip blog.</summary>
60-
BlogURL = 'http://codesnip-app.blogspot.com/';
63+
CodeSnipBlog = 'http://codesnip-app.blogspot.com/';
64+
6165
end;
6266

6367

0 commit comments

Comments
 (0)