Ensure that the model is set when resetResizing is called
ClosedPublic

Authored by fabiank on Apr 6 2018, 9:05 PM.

Details

Summary

Previously, KDirOperatorDetailView::setModel called resetResizing before
QTreeView::setModel was called. Thus, when resetResizing called model()
to obtain the model, it was still nullptr, leading to the following
warning: "QObject::connect: invalid null parameter"

As nothing we do in KDirOperatorDetailView::setModel depends on the
model not being set yet, we simply move the call to
KDirOperatorDetailView::setModel to the beginning of the method, to
ensure that model() returns the new model

Test Plan

Run any application which uses the KDE file dialog. Start opening a file, then
switch the file dialog to the detailed or detailed tree mode. Without the patch,
the warning should appear. Applying the patch removes the warning.

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
fabiank created this revision.Apr 6 2018, 9:05 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 6 2018, 9:05 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
fabiank requested review of this revision.Apr 6 2018, 9:05 PM
ngraham accepted this revision.Apr 6 2018, 10:41 PM
ngraham added a subscriber: ngraham.

Confirmed that this fixes the issue, and it makes sense, code-wise. I did not see any resizing-related regressions.

This revision is now accepted and ready to land.Apr 6 2018, 10:41 PM
apol accepted this revision.Apr 6 2018, 11:59 PM
apol added a subscriber: apol.

I'm not familiar with the issue but the patch makes 100% sense.

dfaure accepted this revision.Apr 7 2018, 7:49 AM
This revision was automatically updated to reflect the committed changes.