Solid-device-automounter/kcm: Enable/Disable columns automount onLogin/onAttached depending on corresponding checkbox
ClosedPublic

Authored by meven on Jan 31 2020, 10:31 AM.

Details

Summary

To make clear to the user what automount options imply.

Test Plan

Before:

After:

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.Jan 31 2020, 10:31 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 31 2020, 10:31 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
meven requested review of this revision.Jan 31 2020, 10:31 AM
meven edited the test plan for this revision. (Show Details)Jan 31 2020, 10:33 AM
ervin requested changes to this revision.Jan 31 2020, 1:22 PM
ervin added inline comments.
solid-device-automounter/kcm/DeviceModel.cpp
189–190

This logic is becoming harder to read than necessary. I think I would go for something structured along those lines:

if (!index.parent().isValid()) {
    return Qt::ItemIsEnabled;
}

switch (index.column()) {
case 0:
    ...
case 1:
    ...
case 2:
    ...
default:
    Q_UNREACHABLE
}
366

{ Should be on its own line

375

Ditto + needs an empty line before that one.

This revision now requires changes to proceed.Jan 31 2020, 1:22 PM
meven updated this revision to Diff 74773.Jan 31 2020, 1:33 PM
meven marked 3 inline comments as done.

Simplify DeviceModel::flags, carriage returns

meven updated this revision to Diff 74782.Jan 31 2020, 1:55 PM

Use a switch case

meven updated this revision to Diff 74920.Feb 3 2020, 12:49 PM

Improved flag function

Conceptually +1.

It's not related to this patch, but looking at the table, it would be nice to move from a tree view into a list view with section headers, like how the GLobal Shortcuts KCM does.

meven added a comment.Feb 4 2020, 3:14 PM

It's not related to this patch, but looking at the table, it would be nice to move from a tree view into a list view with section headers, like how the GLobal Shortcuts KCM does.

The header might look quite ugly given how wide the view is.

ervin accepted this revision.Feb 12 2020, 1:04 PM
This revision is now accepted and ready to land.Feb 12 2020, 1:04 PM
This revision was automatically updated to reflect the committed changes.