Re: Select visible dives

2020-04-25 Thread Berthold Stoeger via subsurface
Hi Robert,

On Samstag, 25. April 2020 14:48:00 CEST Robert Helling via subsurface wrote:

> It seems the culprit is in divelistview.cpp in the ruction
> 
> void DiveListView::selectDive(QModelIndex idx, bool scrollto)
> 
> which is called once per selected dive. In the end, this calls
> 
> selectionChangeDone();
> 
> which is supposed to update the UI (which is of course wrong in this case at
> this point as this should be done only once in the end). Removing this line
> seems to solve the original problem. But I don’t understand this part of
> the code well enough to see if removing it is save or if it is indeed
> required when the function is invoked in a different way.

The call should indeed be removed - thanks for finding that. I suggest
https://github.com/Subsurface-divelog/subsurface/pull/2783, which includes 
more disentangling. For me that has still horrible performance as explained in 

https://github.com/Subsurface-divelog/subsurface/issues/
2776#issuecomment-619381850

I have a plan how to fix that as well - though it will have to wait until 
tomorrow.

Berthold


___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Select visible dives

2020-04-25 Thread Robert Helling via subsurface
Hi,

Jan Mulder reported a problem where doing „select visible dives“ in the map 
widget for a log with a larger number of dives freezes the program for several 
minutes.

I tracked this down to the fact, that the main window information is updated 
some 10.000 times during this operation on Jan’s example file.

It seems the culprit is in divelistview.cpp in the ruction

void DiveListView::selectDive(QModelIndex idx, bool scrollto)

which is called once per selected dive. In the end, this calls

selectionChangeDone();

which is supposed to update the UI (which is of course wrong in this case at 
this point as this should be done only once in the end). Removing this line 
seems to solve the original problem. But I don’t understand this part of the 
code well enough to see if removing it is save or if it is indeed required when 
the function is invoked in a different way.

Best
Robert






signature.asc
Description: Message signed with OpenPGP
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface