[Bbs2ch-cvs 340] [322] idx ファイル関連処理の削除

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 1月 19日 (土) 21:14:35 JST


Revision: 322
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=322
Author:   flyson
Date:     2008-01-19 21:14:35 +0900 (Sat, 19 Jan 2008)

Log Message:
-----------
idx ファイル関連処理の削除

Modified Paths:
--------------
    trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js
    trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js
    trunk/bbs2chreader/chrome/content/bbs2chreader/board/subscribe.js
    trunk/bbs2chreader/chrome/content/bbs2chreader/server/thread.js
    trunk/bbs2chreader/chrome/content/bbs2chreader/statusbar.xml


-------------- next part --------------
Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js
===================================================================
--- trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js	2008-01-19 12:00:50 UTC (rev 321)
+++ trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js	2008-01-19 12:14:35 UTC (rev 322)
@@ -356,7 +356,7 @@
 	},
 
 	/**
-	 * ログディレクトリ内の .idx を読み込んでログアイテムハッシュを作る
+	 * b2rStorageService からログアイテムハッシュを作る
 	 */
 	getLogItemHash: function(aThreadUrlSpec){
 		var b2rStorageService = Cc["@bbs2ch.sourceforge.jp/b2r-storage-service;1"].getService(Ci.b2rIStorageService);

Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js
===================================================================
--- trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js	2008-01-19 12:00:50 UTC (rev 321)
+++ trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js	2008-01-19 12:14:35 UTC (rev 322)
@@ -378,15 +378,12 @@
 
 					// ログディレクトリ内の .dat ファイル
 		var datFile = gBbs2chService.getLogFileAtURL(gBoardItems.url.resolve(datID + ".dat"));
-					// ログディレクトリ内の .idx ファイル
-		var idxFile = gBbs2chService.getLogFileAtURL(gBoardItems.url.resolve(datID + ".idx"));
-
 		try{
 			b2rStorageService.deleteThreadData(gBoardItems.url, datID);
-
 			if(datFile.exists()) datFile.remove(false);
-			if(idxFile.exists()) idxFile.remove(false);
-		}catch(e){}
+		}catch(ex){
+			Components.utils.reportError(ex);
+		}
 	}
 	initTreeSubject();
 }

Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/board/subscribe.js
===================================================================
--- trunk/bbs2chreader/chrome/content/bbs2chreader/board/subscribe.js	2008-01-19 12:00:50 UTC (rev 321)
+++ trunk/bbs2chreader/chrome/content/bbs2chreader/board/subscribe.js	2008-01-19 12:14:35 UTC (rev 322)
@@ -487,14 +487,12 @@
 
 					// ログディレクトリ内の .dat ファイル
 		var datFile = gBbs2chService.getLogFileAtURL(boardItems.url.resolve(datID + ".dat"));
-					// ログディレクトリ内の .idx ファイル
-		var idxFile = gBbs2chService.getLogFileAtURL(boardItems.url.resolve(datID + ".idx"));
-
 		try{
 			b2rStorageService.deleteThreadData(boardItems.url, datID);
 			if(datFile.exists()) datFile.remove(false);
-			if(idxFile.exists()) idxFile.remove(false);
-		}catch(e){}
+		}catch(ex){
+			Components.utils.reportError(ex);
+		}
 
 		setTimeout(removeTreeItem, 0, parentRes, itemRes, index);
 	}

Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/server/thread.js
===================================================================
--- trunk/bbs2chreader/chrome/content/bbs2chreader/server/thread.js	2008-01-19 12:00:50 UTC (rev 321)
+++ trunk/bbs2chreader/chrome/content/bbs2chreader/server/thread.js	2008-01-19 12:14:35 UTC (rev 322)
@@ -156,7 +156,6 @@
 		this.write("DAT URL       : " + this.dat.datURL.spec + "\n");
 		this.write("DAT ID        : " + this.dat.id + "\n");
 		this.write("DAT File      : " + this.dat.datFile.path + "\n");
-		this.write("IDX File      : " + this.dat.idxFile.path + "\n");
 		this.write("----- ----- -----\n");
 		this.write("Title         : " + this.dat.title + "\n");
 		this.write("LineCount     : " + this.dat.lineCount + "\n");
@@ -575,15 +574,14 @@
 		var threadData = b2rStorageService.getThreadData(this.dat.boardURL, this.dat.id);
 		var tmpLineCount = 0;
 		if(threadData){
-			var idxContent = this._bbs2chService.readFile(this.dat.idxFile.path);
 			tmpLineCount = threadData.lineCount;
 		}
 		if(this.dat.lineCount > tmpLineCount){
 				// .dat ‚Ì’Ç‹L‘‚«ž‚Ý
 			this.dat.appendContent(aDatContent);
-				// .idx ‚̏‘‚«ž‚Ý
+
 			if(this._maruMode) this.dat.maruGetted = true;
-			this.dat.flushIdx();
+			this.dat.setThreadData();
 		}
 	}
 
@@ -829,9 +827,6 @@
 			this.dat.lineCount += datLines.length;
 
 			var datData = datLines.join("\n");
-			if(this.dat.idxFile.exists()){
-				datData = "\n" + datData;
-			}
 			this.datSave(datData);
 		}
 
@@ -938,10 +933,6 @@
 		return this._datFile;
 	},
 
-	get idxFile(){
-		return this._idxFile;
-	},
-
 	get id(){
 		if(!this._id){
 			if(this.type == this._b2rService.BOARD_TYPE_MACHI){
@@ -1018,8 +1009,6 @@
 
 		this._datFile = this._b2rService.io.getLogFileAtURL(
 								this.boardURL.resolve(this.id + ".dat"));
-		this._idxFile = this._b2rService.io.getLogFileAtURL(
-								this.boardURL.resolve(this.id + ".idx"));
 
 
 		var b2rStorageService = Cc["@bbs2ch.sourceforge.jp/b2r-storage-service;1"].getService(Ci.b2rIStorageService);
@@ -1047,7 +1036,7 @@
 	},
 
 
-	flushIdx: function(){
+	setThreadData: function(){
 		var b2rStorageService = Cc["@bbs2ch.sourceforge.jp/b2r-storage-service;1"].getService(Ci.b2rIStorageService);
 		b2rStorageService.setThreadData(
 				this.threadPlainURL,
@@ -1057,15 +1046,6 @@
 				this.lineCount,
 				this.lastModified,
 				this._maruGetted);
-		/*
-		var idxContent = new Array();
-		if(this.title) idxContent.push("title=" + this.title);
-		if(!isNaN(this.lineCount)) idxContent.push("lineCount=" + this.lineCount);
-		if(this.lastModified) idxContent.push("lastModified=" + this.lastModified);
-		if(this.maruGetted) idxContent.push("maruGetted=true");
-		idxContent = idxContent.join("\n");
-		this._bbs2chService.writeFile(this.idxFile.path, idxContent, false);
-		*/
 	},
 
 
@@ -1084,7 +1064,6 @@
 	remove: function(){
 		try{
 			if(this.datFile.exists()) this.datFile.remove(false);
-			if(this.idxFile.exists()) this.idxFile.remove(false);
 
 			this._title = "";
 			this._lineCount = 0;

Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/statusbar.xml
===================================================================
--- trunk/bbs2chreader/chrome/content/bbs2chreader/statusbar.xml	2008-01-19 12:00:50 UTC (rev 321)
+++ trunk/bbs2chreader/chrome/content/bbs2chreader/statusbar.xml	2008-01-19 12:14:35 UTC (rev 322)
@@ -170,11 +170,9 @@
 						.getService(Components.interfaces.b2rIStorageService);
 				var boardURL = b2rService.threadUtils.getBoardURL(currentThreadURL);
 				var datFile = b2rService.io.getLogFileAtURL(boardURL.resolve(datID + ".dat"));
-				var idxFile = b2rService.io.getLogFileAtURL(boardURL.resolve(datID + ".idx"));
 				try{
 					b2rStorageService.deleteThreadData(boardURL, datID);
 					if(datFile.exists()) datFile.remove(false);
-					if(idxFile.exists()) idxFile.remove(false);
 				}catch(ex){
 					Components.utils.reportError(ex);
 				}


bbs2ch-cvs メーリングリストの案内
Back to archive index