• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

ギコナビ


Commit MetaInfo

Revision8f2cbc3e3ea9cdfad98d9e29828901fb7633c20d (tree)
Time2007-03-10 10:37:49
Authorh677 <h677>
Commiterh677

Log Message

重複処理をメソッド化

Change Summary

Incremental Difference

--- a/Giko.pas
+++ b/Giko.pas
@@ -678,6 +678,8 @@ type
678678 procedure UnStoredTaskTray;
679679 //! ƒŒƒXƒGƒfƒBƒ^‚Ì•\Ž¦”ñ•\Ž¦
680680 procedure ShowEditors(nCmdShow: Integer);
681+ //! ‚à‚Á‚Æ‚àŒÃ‚¢Browser‚ÌŠJ•ú
682+ procedure ReleaseOldestBrowser;
681683 protected
682684 procedure CreateParams(var Params: TCreateParams); override;
683685 procedure WndProc(var Message: TMessage); override;
@@ -2521,6 +2523,19 @@ begin
25212523 end;
25222524 end;
25232525
2526+//! ‚à‚Á‚Æ‚àŒÃ‚¢Browser‚ÌŠJ•ú
2527+procedure TGikoForm.ReleaseOldestBrowser;
2528+var
2529+ i: Integer;
2530+begin
2531+ for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2532+ if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2533+ TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2534+ ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
2535+ break;
2536+ end;
2537+ end;
2538+end;
25242539
25252540 function TGikoForm.InsertBrowserTab(
25262541 ThreadItem : TThreadItem;
@@ -2553,12 +2568,8 @@ begin
25532568 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
25542569 Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
25552570 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin
2556- for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
2557- if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2558- ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j]));
2559- break;
2560- end;
2561- end;
2571+ //ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é
2572+ ReleaseOldestBrowser;
25622573 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
25632574 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
25642575 FBrowsers.Move(BROWSER_COUNT - 1, 0);
@@ -2575,12 +2586,8 @@ begin
25752586 idx := BrowserTab.TabIndex;
25762587 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
25772588 newBrowser := TBrowserRecord.Create;
2578- for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
2579- if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2580- ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j]));
2581- break;
2582- end;
2583- end;
2589+ // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é
2590+ ReleaseOldestBrowser;
25842591 newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
25852592 FBrowsers.Move(BROWSER_COUNT - 1, 0);
25862593 //newBrowser.Browser.Navigate(BLANK_HTML);
@@ -2600,12 +2607,8 @@ begin
26002607
26012608 end else begin
26022609 newBrowser := TBrowserRecord.Create;
2603- for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
2604- if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2605- ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j]));
2606- break;
2607- end;
2608- end;
2610+ // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é
2611+ ReleaseOldestBrowser;
26092612 newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
26102613 FBrowsers.Move(BROWSER_COUNT - 1, 0);
26112614 //newBrowser.Browser.Navigate(BLANK_HTML);
@@ -2656,7 +2659,6 @@ var
26562659 sTitle: string;
26572660 doc: Variant;
26582661 s: string;
2659- i: Integer;
26602662 idx: Integer;
26612663 ThreadItem: TThreadItem;
26622664 Thread: TBrowserRecord;
@@ -2693,12 +2695,8 @@ begin
26932695 end else if Thread.Browser = nil then begin
26942696 if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then
26952697 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2696- for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2697- if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2698- ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
2699- break;
2700- end;
2701- end;
2698+ // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é
2699+ ReleaseOldestBrowser;
27022700 Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
27032701 FBrowsers.Move(BROWSER_COUNT - 1, 0);
27042702 end;
@@ -3525,14 +3523,9 @@ begin
35253523 end;
35263524 if(BrowserTab.TabIndex <> -1) and
35273525 ( TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser = nil) then begin
3528- for j := BrowserTab.Tabs.Count - 1 downto 0 do begin
3529- if(TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser
3530- = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) )then
3531- begin
3532- ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j]));
3533- break;
3534- end;
3535- end;
3526+ // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é
3527+ ReleaseOldestBrowser;
3528+
35363529 TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser
35373530 := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
35383531 TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Repaint := true;
@@ -3557,7 +3550,7 @@ end;
35573550
35583551 procedure TGikoForm.ListPopupMenuPopup(Sender: TObject);
35593552 var
3560- bBoard, bCategory, bBBS : Boolean;
3553+ bBoard, bCategory : Boolean;
35613554 begin
35623555 bBoard := (GetActiveList is TBoard);
35633556 bCategory := (GetActiveList is TCategory);
@@ -3804,7 +3797,7 @@ end;
38043797
38053798 procedure TGikoForm.BrowserTabChange(Sender: TObject);
38063799 var
3807- i, j: Integer;
3800+ j: Integer;
38083801 idx: Integer;
38093802 begin
38103803 BrowserTab.Tabs.BeginUpdate;
@@ -3827,12 +3820,9 @@ begin
38273820 (FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1])) then
38283821 FBrowsers.Move(BROWSER_COUNT - 1, 0);
38293822
3830- for i := 0 to BrowserTab.Tabs.Count - 1 do begin
3831- if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
3832- ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
3833- break;
3834- end;
3835- end;
3823+ // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é
3824+ ReleaseOldestBrowser;
3825+
38363826 TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
38373827 TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Repaint := true;
38383828 FBrowsers.Move(BROWSER_COUNT - 1, 0);