チェンジセット 2137
- コミット日時:
- 2009/01/14 02:08:19 (3 年前)
- ファイル:
-
- air/TLife/bin/TLife.swf (更新) (変更前)
- air/TLife/src/uwi/db/DB.as (更新) (4 diffs)
- air/TLife/src/uwi/db/SimpleTransactionThread.as (更新) (1 diff)
- air/TLife/src/uwi/thread/ContextMenuItemEventThread.as (更新) (5 diffs)
- air/TLife/src/uwi/thread/DataGridEventThread.as (更新) (1 diff)
- air/TLife/src/uwi/thread/TimelineThread.as (更新) (2 diffs)
- air/TLife/src/uwi/twitter/TwitterReloadThread.as (更新) (1 diff)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/src/uwi/db/DB.as
r2135 r2137 12 12 */ 13 13 public class DB { 14 private var conn : SQLConnection;14 private var _conn : SQLConnection; 15 15 16 16 public function DB(path : File) 17 17 { 18 conn = new SQLConnection();19 conn.open(path);18 _conn = new SQLConnection(); 19 _conn.open(path); 20 20 } 21 21 … … 23 23 { 24 24 try { 25 if ( conn.connected)conn.close();25 if (_conn.connected) _conn.close(); 26 26 }catch (e : Error) { 27 27 } … … 56 56 { 57 57 var stmt : SQLStatement = new SQLStatement(); 58 stmt.sqlConnection = conn;58 stmt.sqlConnection = _conn; 59 59 stmt.text = text; 60 60 try { … … 66 66 } 67 67 68 public function get Conn() : SQLConnection { returnconn; }68 public function get conn() : SQLConnection { return _conn; } 69 69 } 70 70 air/TLife/src/uwi/db/SimpleTransactionThread.as
r2136 r2137 3 3 import flash.data.SQLConnection; 4 4 import flash.data.SQLStatement; 5 import flash.errors.SQLError; 5 6 import org.libspark.thread.Thread; 6 7 air/TLife/src/uwi/thread/ContextMenuItemEventThread.as
r2135 r2137 14 14 import org.libspark.thread.utils.SerialExecutor; 15 15 import uwi.bean.TabRule; 16 import uwi.db.SimpleTransactionThread; 16 17 import uwi.twitter.TwitterPostThread; 17 18 import uwi.twitter.TwitterReloadThread; … … 120 121 { 121 122 if (dg.selectedIndex != -1) { 122 for each(var ind : int in dg.selectedIndices) { 123 TwitterUtility.fav(CommonData.timeline.getItemAt(ind).postid); 124 // favのチェックと更新 125 } 123 var args : Array = []; 124 for each(var ind : int in dg.selectedIndices) { 125 var item : Object = CommonData.timeline.getItemAt(ind); 126 TwitterUtility.fav(item.postid); 127 args.push( { ":postid" : item.postid } ); 128 129 item.fav = true; 130 CommonData.timeline.setItemAt(item, ind); 131 } 132 new SimpleTransactionThread(CommonData.db.conn, 133 "update " + CommonData.TABLE_STATUS + " set fav = true where postid = :postid", 134 args).start(); 126 135 } 127 136 next(run); … … 131 140 { 132 141 if (dg.selectedIndex != -1) { 133 for each(var ind : int in dg.selectedIndices) { 134 TwitterUtility.favdel(CommonData.timeline.getItemAt(ind).postid); 135 // favのチェックと更新 136 } 142 var args : Array = []; 143 for each(var ind : int in dg.selectedIndices) { 144 var item : Object = CommonData.timeline.getItemAt(ind); 145 TwitterUtility.favdel(item.postid); 146 args.push( { ":postid" : item.postid } ); 147 148 item.fav = false; 149 CommonData.timeline.setItemAt(item, ind); 150 } 151 new SimpleTransactionThread(CommonData.db.conn, 152 "update " + CommonData.TABLE_STATUS + " set fav = false where postid = :postid", 153 args).start(); 137 154 } 138 155 next(run); … … 142 159 { 143 160 if (dg.selectedIndex != -1) { 144 for each(var ind : int in dg.selectedIndices) { 145 TwitterUtility.follow(CommonData.timeline.getItemAt(ind).posterid); 146 // followのチェックと更新 147 } 161 var args : Array = []; 162 for each(var ind : int in dg.selectedIndices) { 163 var posterid : String = CommonData.timeline.getItemAt(ind).posterid; 164 TwitterUtility.follow(posterid); 165 args.push( { ":posterid" : posterid } ); 166 } 167 new SimpleTransactionThread(CommonData.db.conn, 168 "update " + CommonData.TABLE_POSTER + " set following = true where posterid = :posterid", 169 args).start(); 148 170 } 149 171 next(run); … … 153 175 { 154 176 if (dg.selectedIndex != -1) { 155 for each(var ind : int in dg.selectedIndices) { 156 TwitterUtility.remove(CommonData.timeline.getItemAt(ind).posterid); 157 // followのチェックと更新 158 } 177 var args : Array = []; 178 for each(var ind : int in dg.selectedIndices) { 179 var posterid : String = CommonData.timeline.getItemAt(ind).posterid; 180 TwitterUtility.remove(posterid); 181 args.push( { ":posterid" : posterid } ); 182 } 183 new SimpleTransactionThread(CommonData.db.conn, 184 "update " + CommonData.TABLE_POSTER + " set following = false where posterid = :posterid", 185 args).start(); 159 186 } 160 187 next(run); air/TLife/src/uwi/thread/DataGridEventThread.as
r2134 r2137 70 70 { 71 71 var ir : IListItemRenderer = e.target as IListItemRenderer; 72 // TODO 選択状態にする 73 if(ir != null)trace(dg.itemRendererToIndex(ir)); 72 if(ir != null)dg.selectedIndex = dg.itemRendererToIndex(ir); 74 73 next(run); 75 74 } air/TLife/src/uwi/thread/TimelineThread.as
r2135 r2137 58 58 if (sql == null) return; 59 59 60 dbst = new DBSelectThread(CommonData.db. Conn, sql, prefetch);60 dbst = new DBSelectThread(CommonData.db.conn, sql, prefetch); 61 61 dbst.start(); 62 62 dbst.join(); … … 94 94 for (var posterid : String in posterdata) { 95 95 var sql : String = "select screenname, following, icon from poster where userid = '" + CommonData.username + "' and posterid = '" + posterid + "'"; 96 var ddbst : DBSelectThread = new DBSelectThread(CommonData.db. Conn, sql, prefetch);96 var ddbst : DBSelectThread = new DBSelectThread(CommonData.db.conn, sql, prefetch); 97 97 posterdata[posterid] = ddbst; 98 98 se.addThread(ddbst); air/TLife/src/uwi/twitter/TwitterReloadThread.as
r2134 r2137 122 122 } 123 123 124 var sit : StatusInsertThread = new StatusInsertThread(CommonData.db. Conn, statuses, posterid == CommonData.HOME);124 var sit : StatusInsertThread = new StatusInsertThread(CommonData.db.conn, statuses, posterid == CommonData.HOME); 125 125 sit.start(); 126 126 sit.join();

