@@ -169,6 +169,9 @@ package body GPS.Location_View.Listener is
169169 Values : Glib.Values.GValue_Array);
170170 -- ??? Must be moved to GtkAda
171171
172+ Stop_Sorting_On_Count : constant Glib.Gint := 1000 ;
173+ -- The count of messages when we stop sorting "on the fly".
174+
172175 -- ------------------
173176 -- Category_Added --
174177 -- ------------------
@@ -983,6 +986,7 @@ package body GPS.Location_View.Listener is
983986 File_Last : Glib.Gint := 0 ;
984987 Message_Last : Glib.Gint := 16 ;
985988 Color : Gdk.RGBA.Gdk_RGBA;
989+
986990 begin
987991 Self.Model.Disable_Sorting;
988992
@@ -1135,11 +1139,14 @@ package body GPS.Location_View.Listener is
11351139 -- primary.
11361140
11371141 if Message.Level = Primary then
1142+
1143+ Self.Model.Category_Messages_Count := Self.Model.Get_Int
1144+ (Category_Iter, -Number_Of_Children_Column) + 1 ;
1145+
11381146 Self.Model.Set
11391147 (Category_Iter,
11401148 -Number_Of_Children_Column,
1141- Self.Model.Get_Int
1142- (Category_Iter, -Number_Of_Children_Column) + 1 );
1149+ Self.Model.Category_Messages_Count);
11431150
11441151 File_Last := File_Last + 1 ;
11451152 File_Columns (File_Last) := -Number_Of_Children_Column;
@@ -1244,11 +1251,14 @@ package body GPS.Location_View.Listener is
12441251 if Message.Level = Primary then
12451252 -- Update message counters
12461253
1254+ Self.Model.Category_Messages_Count := Self.Model.Get_Int
1255+ (Category_Iter, -Number_Of_Children_Column) - 1 ;
1256+
12471257 Self.Model.Set
12481258 (Category_Iter,
12491259 -Number_Of_Children_Column,
1250- Self.Model.Get_Int
1251- (Category_Iter, -Number_Of_Children_Column) - 1 );
1260+ Self.Model.Category_Messages_Count);
1261+
12521262 Self.Model.Set
12531263 (File_Iter,
12541264 -Number_Of_Children_Column,
@@ -1264,8 +1274,14 @@ package body GPS.Location_View.Listener is
12641274 Iter : Gtk_Tree_Iter;
12651275 Need_Refresh : constant Boolean := not Self.Removed_Rows.Is_Empty;
12661276 begin
1267- if Self.Kernel.Get_Messages_Container.Get_Filter_Launched then
1268- -- Do nothing if we still filtering messages
1277+ if Self.Previouse_Messages_Count /= Self.Category_Messages_Count
1278+ and then
1279+ (Self.Category_Messages_Count >= Stop_Sorting_On_Count -- many
1280+ or else Self.Previouse_Messages_Count >
1281+ Self.Category_Messages_Count) -- when deleting
1282+ then
1283+ Self.Previouse_Messages_Count := Self.Category_Messages_Count;
1284+
12691285 return True;
12701286 end if ;
12711287
@@ -1294,6 +1310,8 @@ package body GPS.Location_View.Listener is
12941310
12951311 Self.Thaw_Sort (Self.Sort_Column);
12961312
1313+ Self.Previouse_Messages_Count := Self.Category_Messages_Count;
1314+
12971315 return False;
12981316 end On_Idle ;
12991317
0 commit comments