X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=GikoSystem.pas;h=3118e3c70a6bd7639cb422c73fa8d70eb2c8a585;hb=85bbca5dca1672660acbabe8efc953a9ec959fec;hp=5cbcdbef3b56827447fee23f57732d2e45a0b836;hpb=185ca25724c1b85483b992e4d2084a460963e403;p=gikonavigoeson%2Fgikonavi.git diff --git a/GikoSystem.pas b/GikoSystem.pas index 5cbcdbe..3118e3c 100644 --- a/GikoSystem.pas +++ b/GikoSystem.pas @@ -188,6 +188,7 @@ type 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; @@ -277,7 +278,7 @@ const ZERO_DATE: Integer = 25569; BETA_VERSION_NAME_E = 'beta'; BETA_VERSION_NAME_J = 'ÊÞÀ'; - BETA_VERSION = 68; + BETA_VERSION = 70; BETA_VERSION_BUILD = ''; //!< debug”Å‚È‚Ç APP_NAME = 'gikoNavi'; BE_PHP_URL = 'http://be.2ch.net/test/p.php?i='; @@ -1446,7 +1447,7 @@ var S : string; i : integer; begin - s := Trim(LongName); + s := TrimThreadTitle(Trim(LongName)); if (Length(s) <= ALength) then begin Result := s; end else begin @@ -1479,6 +1480,33 @@ begin end; end; +function TGikoSys.TrimThreadTitle(const SrcTitle: string): string; +const + TRIM_STRING: array [1..4] of String = + ('[“]Ú‹ÖŽ~]', '©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 ‚ð Integer ‚É•ÏŠ· \return False..0, True..1