- Prevent activeViewChanged from updating the window if the view is the same view (happens at least once when starting up)
- Stop updateWindowTitle from updating the title if its not changed.
Details
- Reviewers
elvisangelaccio broulik - Group Reviewers
Dolphin - Commits
- R318:784734ca1680: Abort updateWindowTitle and activeViewChanged if not changed.
Diff Detail
- Repository
- R318 Dolphin
- Branch
- reduceRefreshCalls
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 7047 Build 7065: arc lint + arc unit
src/dolphinmainwindow.cpp | ||
---|---|---|
1007–1010 | const |
src/dolphinmainwindow.cpp | ||
---|---|---|
968–970 | This is a symptom that something else is wrong, but ok. |
src/dolphinmainwindow.cpp | ||
---|---|---|
968–970 | This seams to be called twice when dolphin is just starting up and twice when you change tabs. To Test I Used this code here. if (m_activeViewContainer == viewContainer) { static int calls = 1; qDebug() <<"ViewContainer Matches(" + QString::number(calls) + ") " << sender(); calls ++; return; } I also added this code to DolphinTabWidget::currentTabChanged() at line 330) if(viewContainer->isActive()) { static int calls = 1; qDebug() <<"View Active(" + QString::number(calls) + ") " << sender(); calls ++; return; } Example output
Create a new Tab:
Create a new Tab:
Switch to tab 1 (middle tab):
Switch to tab 2 (right most):
Switch to tab 0 (left most):
Every time you switch to the left most tab it has three of them . Without the code in the TabWidget it got one ViewContainer Match for every tab crated and every tab i switched to. |
What should I be using as a base for this code? Its currently based upon the Applications/18.12 branch
Searchbar propagates events even it's not visible, you can add check for visibility in focusin event.
Well that got me looking again and I think this time I solved it correctly.
The DolphinTabPage::viewChanged code was emiting the change even if it was the same item, I changed the logic to return first also for this function. Testing with my test code in DolphinMainWindow::viewChanged I no longer got any duplicate refreshes on start or otherwise. I tested with several tabs, search, filter and splits and by updating the directory in another program to see the dir updated in real time still.
I Found one case where it was still generating the duplicate view and that is when you close a tab between two other tabs . I don't think its a problem since it seams to be the correct behavior for this case
I'm Sorry to redo this yet again but this will be an overall better commit that solves the issue fully. Now . I will await your review.