svnno****@sourc*****
svnno****@sourc*****
2008年 2月 8日 (金) 22:37:55 JST
Revision: 358 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=358 Author: flyson Date: 2008-02-08 22:37:54 +0900 (Fri, 08 Feb 2008) Log Message: ----------- b2rIGlobalIO.getLogFileAtBoardID() を追加 Modified Paths: -------------- trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalIO.js trunk/bbs2chreader/components/b2rIGlobalService.xpt trunk/bbs2chreader/components/idl/b2rIGlobalService.idl -------------- next part -------------- Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalIO.js =================================================================== --- trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalIO.js 2008-02-06 15:30:12 UTC (rev 357) +++ trunk/bbs2chreader/chrome/content/bbs2chreader/components/b2rGlobalIO.js 2008-02-08 13:37:54 UTC (rev 358) @@ -79,8 +79,6 @@ getLogFileAtURL: function(aURLSpec){ - const LOGS_DIR_NAME = "logs-050pre1"; - var ioService = XPC.getService("@mozilla.org/network/io-service;1", "nsIIOService"); try{ var fromURL = ioService.newURI(aURLSpec, null, null).QueryInterface(Ci.nsIURL); @@ -88,10 +86,18 @@ throw Components.results.NS_ERROR_INVALID_ARG; } + var boardID = gGlobalService.threadUtils.getBoardID(fromURL) + return this.getLogFileAtBoardID(boardID); + }, + + + getLogFileAtBoardID: function(aBoardID){ + const LOGS_DIR_NAME = "logs-050pre1"; + var logFile = this.getDataDir(); logFile.appendRelativePath(LOGS_DIR_NAME); - var pathArray = gGlobalService.threadUtils.getBoardID(fromURL).split("/"); + var pathArray = aBoardID.split("/"); for(let i=0; i<pathArray.length; i++){ if(pathArray[i]) logFile.appendRelativePath(pathArray[i]); } Modified: trunk/bbs2chreader/components/b2rIGlobalService.xpt =================================================================== (Binary files differ) Modified: trunk/bbs2chreader/components/idl/b2rIGlobalService.idl =================================================================== --- trunk/bbs2chreader/components/idl/b2rIGlobalService.idl 2008-02-06 15:30:12 UTC (rev 357) +++ trunk/bbs2chreader/components/idl/b2rIGlobalService.idl 2008-02-08 13:37:54 UTC (rev 358) @@ -26,6 +26,7 @@ * @return ログファイル */ nsILocalFile getLogFileAtURL(in AUTF8String aURLSpec); + nsILocalFile getLogFileAtBoardID(in string aBoardID); /** * テキストファイルのすべてを読み込んで内容を返す