procedure LoadIcon();
//! \83|\83b\83v\83A\83b\83v\83\81\83j\83\85\81[\93Ç\82Ý\8d\9e\82Ý
procedure LoadPopupMenu();
- //! \83X\83\8c\83^\83C\8eæ\93¾
- function GetThreadTitle(OrgTitle: String): String;
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure WndProc(var Message: TMessage); override;
if (Thread <> nil) and (ThreadItem <>nil) then begin
BrowserBoardNameLabel.Caption := ThreadPTitle;
ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap);
- BrowserNameLabel.Caption := GetThreadTitle(ThreadTitle);
+ BrowserNameLabel.Caption := GikoSys.TrimThreadTitle(ThreadTitle);
ItemImage.Picture := nil;
if ThreadIsLog then
if ThreadNewArraical then
end;
end else begin
- Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GetThreadTitle(ThreadTitle) + ']';
+ Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GikoSys.TrimThreadTitle(ThreadTitle) + ']';
//\83X\83e\81[\83^\83X\83o\81[\82É\95\\8e¦\82µ\82Ä\82¢\82é\83X\83\8c\82Ì\97e\97Ê\82ð\95\\8e¦
StatusBar.Panels[THREADSIZE_PANEL].Text := Format('%6.2f kB', [ThreadItem.Size / 1024]);
StatusBar.Panels[THREADSIZE_PANEL].Width :=
if (FActiveContent <> nil) and (FActiveContent.Thread <> nil)
and (FActiveContent.Thread.IsLogFile) then begin
try
- Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GetThreadTitle(FActiveContent.Thread.Title) + ']'
+ Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GikoSys.TrimThreadTitle(FActiveContent.Thread.Title) + ']'
except
on E: Exception do begin
//\83X\83\8c\88ê\97\97DL\8cã\82È\82Ç\82ÉFActiveContent\82Ì\8e\9d\82ÂThread\82ª
wordCount : TWordCount;
{$ENDIF}
id, dateStr: String;
+ ThreadTitle: String;
+ Idx: Integer;
begin
No := KokoPopupMenu.Tag;
if No = 0 then Exit;
id := GikoSys.GetResID(No, ThreadItem);
if (id <> '') and (not IsNoValidID(id)) then begin
+ ThreadTitle := ThreadItem.Title;
+ while (True) do begin
+ Idx := Pos(#9, ThreadTitle);
+ if (Idx < 1) then
+ Break;
+ Delete(ThreadTitle, Idx, 1);
+ end;
// \83R\83\81\83\93\83g\82Æ\82µ\82Ä\81A\83X\83\8c\83b\83h\96¼\82Æ\8d¡\93ú\82Ì\93ú\95t\82ð\92Ç\89Á
DateTimeToString(dateStr, 'yyyymmdd', Now);
- id := id + #9'>>add ' + dateStr + ',' + ThreadItem.Title;
+ id := id + #9'>>add ' + dateStr + ',' + ThreadTitle;
if (GikoSys.FAbon.AddToken(id, invisible)) then begin
GikoSys.FAbon.ReLoadFromNGwordFile;
FActiveContent.Repaint := True;
BrowserTab.Tabs.EndUpdate;
if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) then begin
- DspTitle := GetThreadTitle(FActiveContent.Thread.Title);
+ DspTitle := GikoSys.TrimThreadTitle(FActiveContent.Thread.Title);
BrowserNameLabel.Caption := DspTitle;
Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + DspTitle + ']';
end;
end;
-//! \83X\83\8c\83^\83C\8eæ\93¾
-function TGikoForm.GetThreadTitle(OrgTitle: String): String;
-var
- Idx: Integer;
- ResTitle: String;
-begin
- if (GikoSys.Setting.ThreadTitleTrim = False) then begin
- Result := OrgTitle;
- end else begin
- ResTitle := OrgTitle;
- while (True) do begin
- Idx := Pos('[\93]\8dÚ\8bÖ\8e~]', ResTitle);
- if (Idx < 1) then
- Break;
- Delete(ResTitle, Idx, 10);
- end;
- while (True) do begin
- Idx := Pos('©2ch.net', ResTitle);
- if (Idx < 1) then
- Break;
- Delete(ResTitle, Idx, 13);
- end;
- Result := Trim(ResTitle);
- end;
-end;
-
//! \83|\83b\83v\83A\83b\83v\83\81\83j\83\85\81[\93Ç\82Ý\8d\9e\82Ý
procedure TGikoForm.LoadPopupMenu();
begin
function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
function GetShortName(const LongName: string; ALength: integer): string;
+ function TrimThreadTitle(const SrcTitle: string): string;
function BoolToInt(b: Boolean): Integer;
function IntToBool(i: Integer): Boolean;
function GzipDecompress(ResStream: TStream; ContentEncoding: string): string;
Chr : array [0..255] of char;
S : string;
i : integer;
- Idx: Integer;
begin
- s := Trim(LongName);
- if (Setting.ThreadTitleTrim = True) then begin
- while (True) do begin
- Idx := Pos('[\93]\8dÚ\8bÖ\8e~]', s);
- if (Idx < 1) then
- Break;
- Delete(s, Idx, 10);
- end;
- while (True) do begin
- Idx := Pos('©2ch.net', s);
- if (Idx < 1) then
- Break;
- Delete(s, Idx, 13);
- end;
- s := Trim(s);
- end;
+ s := TrimThreadTitle(Trim(LongName));
if (Length(s) <= ALength) then begin
Result := s;
end else begin
end;
end;
+function TGikoSys.TrimThreadTitle(const SrcTitle: string): string;
+const
+ TRIM_STRING: array [1..4] of String =
+ ('[\93]\8dÚ\8bÖ\8e~]', '©2ch.net', '©bbspink.com', #9);
+var
+ i: Integer;
+ Idx: Integer;
+ Len: Integer;
+ DstTitle: String;
+begin
+ if (Setting.ThreadTitleTrim = True) then begin
+ DstTitle := SrcTitle;
+ for i := Low(TRIM_STRING) to High(TRIM_STRING) do begin
+ Len := Length(TRIM_STRING[i]);
+ while (True) do begin
+ Idx := Pos(TRIM_STRING[i], DstTitle);
+ if (Idx < 1) then
+ Break;
+ Delete(DstTitle, Idx, Len);
+ end;
+ end;
+ Result := Trim(DstTitle);
+ end else begin
+ Result := SrcTitle;
+ end;
+end;
+
{!
\brief Boolean \82ð Integer \82É\95Ï\8a·
\return False..0, True..1
BoardCnt: Integer;
RepStr: String;
i: Integer;
- Idx: Integer;
begin
//===== \83X\83\8c\83\8a\83X\83g =====
if GikoSys.Setting.ListIconVisible then
RepStr := CustomStringReplace(RepStr, '&', '&' );
//RepStr := StringReplace(RepStr, '\81\97\81M', ',', [rfReplaceAll]);
- if (ThreadNgList.IsNG(RepStr) = True) then begin
+ if (ThreadNgList.IsNG(RepStr) = True) then
RepStr := '\81\83\82 \82Ú\81`\82ñ\81\84'
- end else if (GikoSys.Setting.ThreadTitleTrim = True) then begin
- while (True) do begin
- Idx := Pos('[\93]\8dÚ\8bÖ\8e~]', RepStr);
- if (Idx < 1) then
- Break;
- Delete(RepStr, Idx, 10);
- end;
- while (True) do begin
- Idx := Pos('©2ch.net', RepStr);
- if (Idx < 1) then
- Break;
- Delete(RepStr, Idx, 13);
- end;
- RepStr := Trim(RepStr);
- end;
+ else if (GikoSys.Setting.ThreadTitleTrim = True) then
+ RepStr := GikoSys.TrimThreadTitle(RepStr);
if Item.SubItems.Count <> ListView.Columns.Count then begin
Item.SubItems.Clear;