チェンジセット 2137

差分発生行の前後
無視リスト:
コミット日時:
2009/01/14 02:08:19 (3 年前)
コミッタ:
uwi
ログメッセージ:

--

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • air/TLife/src/uwi/db/DB.as

    r2135 r2137  
    1212         */ 
    1313        public class DB { 
    14                 private var conn : SQLConnection; 
     14                private var _conn : SQLConnection; 
    1515                 
    1616                public function DB(path : File) 
    1717                { 
    18                         conn = new SQLConnection(); 
    19                         conn.open(path); 
     18                        _conn = new SQLConnection(); 
     19                        _conn.open(path); 
    2020                } 
    2121                 
     
    2323                { 
    2424                        try { 
    25                                 if (conn.connected) conn.close(); 
     25                                if (_conn.connected) _conn.close(); 
    2626                        }catch (e : Error) { 
    2727                        } 
     
    5656                { 
    5757                        var stmt : SQLStatement = new SQLStatement(); 
    58                         stmt.sqlConnection = conn; 
     58                        stmt.sqlConnection = _conn; 
    5959                        stmt.text = text; 
    6060                        try { 
     
    6666                } 
    6767                 
    68                 public function get Conn() : SQLConnection { return conn; } 
     68                public function get conn() : SQLConnection { return _conn; } 
    6969        } 
    7070         
  • air/TLife/src/uwi/db/SimpleTransactionThread.as

    r2136 r2137  
    33        import flash.data.SQLConnection; 
    44        import flash.data.SQLStatement; 
     5        import flash.errors.SQLError; 
    56        import org.libspark.thread.Thread; 
    67         
  • air/TLife/src/uwi/thread/ContextMenuItemEventThread.as

    r2135 r2137  
    1414        import org.libspark.thread.utils.SerialExecutor; 
    1515        import uwi.bean.TabRule; 
     16        import uwi.db.SimpleTransactionThread; 
    1617        import uwi.twitter.TwitterPostThread; 
    1718        import uwi.twitter.TwitterReloadThread; 
     
    120121                { 
    121122                        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(); 
    126135                        } 
    127136                        next(run); 
     
    131140                { 
    132141                        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(); 
    137154                        } 
    138155                        next(run); 
     
    142159                { 
    143160                        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(); 
    148170                        } 
    149171                        next(run); 
     
    153175                { 
    154176                        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(); 
    159186                        } 
    160187                        next(run); 
  • air/TLife/src/uwi/thread/DataGridEventThread.as

    r2134 r2137  
    7070                { 
    7171                        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); 
    7473                        next(run); 
    7574                } 
  • air/TLife/src/uwi/thread/TimelineThread.as

    r2135 r2137  
    5858                        if (sql == null) return; 
    5959                         
    60                         dbst = new DBSelectThread(CommonData.db.Conn, sql, prefetch); 
     60                        dbst = new DBSelectThread(CommonData.db.conn, sql, prefetch); 
    6161                        dbst.start(); 
    6262                        dbst.join(); 
     
    9494                                for (var posterid : String in posterdata) { 
    9595                                        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); 
    9797                                        posterdata[posterid] = ddbst; 
    9898                                        se.addThread(ddbst); 
  • air/TLife/src/uwi/twitter/TwitterReloadThread.as

    r2134 r2137  
    122122                        } 
    123123                         
    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); 
    125125                        sit.start(); 
    126126                        sit.join();