[Tween-svn] [1158] 発言振り分け確定時に、ID順ソートの場合は全件ソートしないように変更

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 12月 3日 (金) 19:18:01 JST


Revision: 1158
          http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1158
Author:   kiri_feather
Date:     2010-12-03 19:18:01 +0900 (Fri, 03 Dec 2010)

Log Message:
-----------
発言振り分け確定時に、ID順ソートの場合は全件ソートしないように変更

Modified Paths:
--------------
    trunk/Tween/StatusDictionary.vb


-------------- next part --------------
Modified: trunk/Tween/StatusDictionary.vb
===================================================================
--- trunk/Tween/StatusDictionary.vb	2010-12-03 05:45:31 UTC (rev 1157)
+++ trunk/Tween/StatusDictionary.vb	2010-12-03 10:18:01 UTC (rev 1158)
@@ -804,7 +804,7 @@
                 End If
                 tb.AddSubmit(isMentionIncluded)  '振分確定(各タブに反映)
             Next
-            Me.SortPosts()
+            If Me.SortMode <> IdComparerClass.ComparerMode.Id Then Me.SortPosts()
 
             soundFile = _soundFile
             _soundFile = ""
@@ -1519,7 +1519,7 @@
         Return _tmpIds.Count
     End Function
 
-    Private Structure TemporaryId
+    Private Class TemporaryId
         Public Id As Long
         Public Read As Boolean
 
@@ -1527,7 +1527,7 @@
             Id = argId
             Read = argRead
         End Sub
-    End Structure
+    End Class
 
     Public Sub New()
         _filters = New List(Of FiltersClass)
@@ -1571,7 +1571,15 @@
     Private Sub Add(ByVal ID As Long, ByVal Read As Boolean)
         If Me._ids.Contains(ID) Then Exit Sub
 
-        Me._ids.Add(ID)
+        If Me.Sorter.Mode = IdComparerClass.ComparerMode.Id Then
+            If Me.Sorter.Order = SortOrder.Ascending Then
+                Me._ids.Add(ID)
+            Else
+                Me._ids.Insert(0, ID)
+            End If
+        Else
+            Me._ids.Add(ID)
+        End If
 
         If Not Read AndAlso Me._unreadManage Then
             Me._unreadCount += 1
@@ -1630,6 +1638,7 @@
 
     Public Sub AddSubmit(ByRef isMentionIncluded As Boolean)
         If _tmpIds.Count = 0 Then Exit Sub
+        _tmpIds.Sort(Function(x As TemporaryId, y As TemporaryId) x.Id.CompareTo(y.Id))
         For Each tId As TemporaryId In _tmpIds
             If Me.TabType = TabUsageType.Mentions AndAlso TabInformations.GetInstance.Item(tId.Id).IsReply Then isMentionIncluded = True
             Me.Add(tId.Id, tId.Read)



Tween-svn メーリングリストの案内
Back to archive index