Skip to content

Why are affinities changed, if outdated layout is restored? #724

Description

@bbc131

I stumbled over the fact, that during layout restoration, the affinities of DockWidgets and MainWindows are changed if they doesn't match the affinities from the layout to be restored.

In my case this happened during development when changing the affinities. The application saves/restores the current layout when closed/started automatically.
The next time I run my application, an outdated layout was restored, which ended up changing the affinities of the current dockwidgets. I had to ensure that no outdated layout is restored.
This doesn't make sense to me, therefore I'm asking if this might be an error. Maybe the assignments should be the other way round?

No question that not matching affinities are an error and it was my fault not to take the logged errors during startup seriously.

// src/core/DockWidget.cpp line 949..

        if (dw->affinities() != saved->affinities) {
            KDDW_ERROR("Affinity name changed from {} to {} for dw {}", dw->affinities(), saved->affinities, dw->uniqueName());
            dw->d->affinities = saved->affinities;
        }
//src/core/MainWindow.cpp line 752...

    if (d->affinities != mw.affinities) {
        KDDW_ERROR("Affinity name changed from {} to {}", d->affinities, mw.affinities);

        d->affinities = mw.affinities;
    }

(From current main branch, commit 0d88012)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions