mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
Data: also yield while loading unparseable files
Otherwise, the UI would be blocked while loading something big that is not a log file at all.
This commit is contained in:
parent
fb032c177f
commit
6061f34506
1 changed files with 5 additions and 4 deletions
|
@ -314,6 +314,11 @@ class LineCache (Producer):
|
||||||
sort_helper = SortHelper (self.__fileobj, offsets)
|
sort_helper = SortHelper (self.__fileobj, offsets)
|
||||||
find_insert_position = sort_helper.find_insert_position
|
find_insert_position = sort_helper.find_insert_position
|
||||||
while True:
|
while True:
|
||||||
|
i += 1
|
||||||
|
if i >= limit:
|
||||||
|
i = 0
|
||||||
|
yield True
|
||||||
|
|
||||||
offset = tell ()
|
offset = tell ()
|
||||||
line = readline ()
|
line = readline ()
|
||||||
if not line:
|
if not line:
|
||||||
|
@ -336,10 +341,6 @@ class LineCache (Producer):
|
||||||
pos = find_insert_position (line)
|
pos = find_insert_position (line)
|
||||||
levels.insert (pos, dict_levels_get (match.group (1), debug_level_none))
|
levels.insert (pos, dict_levels_get (match.group (1), debug_level_none))
|
||||||
offsets.insert (pos, offset)
|
offsets.insert (pos, offset)
|
||||||
i += 1
|
|
||||||
if i >= limit:
|
|
||||||
i = 0
|
|
||||||
yield True
|
|
||||||
|
|
||||||
self.have_load_finished ()
|
self.have_load_finished ()
|
||||||
yield False
|
yield False
|
||||||
|
|
Loading…
Reference in a new issue