mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
visualizer-view: shrink time range when necessary
If we don't have a minute worth of input, we should shrink the visible area to exactly what we came across. We still have the issue of the UI creating the capture file before auth has completed, but we can fix that later so we have a "semantically" correct start time.
This commit is contained in:
@ -218,8 +218,18 @@ sp_visualizer_view_set_reader (SpVisualizerView *self,
|
||||
|
||||
if (reader != NULL)
|
||||
{
|
||||
gint64 real_end_time;
|
||||
|
||||
begin_time = sp_capture_reader_get_start_time (reader);
|
||||
real_end_time = sp_capture_reader_get_end_time (reader);
|
||||
|
||||
end_time = begin_time + (G_GINT64_CONSTANT (1000000000) * 60);
|
||||
|
||||
/* If we were able to extract a proper end time and its less
|
||||
* than 60 seconds, we will use the whole width to show that.
|
||||
*/
|
||||
if (real_end_time > 0 && real_end_time < end_time)
|
||||
end_time = real_end_time;
|
||||
}
|
||||
|
||||
sp_visualizer_list_set_reader (priv->list, reader);
|
||||
|
||||
Reference in New Issue
Block a user