Bug 391465 - number of columns show by default is hardcoded
Summary: number of columns show by default is hardcoded
Status: REPORTED
Alias: None
Product: muon
Classification: Applications
Component: muon (show other bugs)
Version: 5.6
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jonathan Thomas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-06 12:52 UTC by Carlo Vanini
Modified: 2018-03-06 12:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlo Vanini 2018-03-06 12:52:11 UTC
When new columns have been added (Installed-Size, Version, Available-Version), they have been hidden by default in order to keep the UI the same as before. But their order is assumed and their number if hardcoded in `PackageWidget.cpp`.

> For the record: I think the actual way to write this smartly is to have 
> PackageModel::headerData implement a UserRole that returns an enum value. 
> The enum would be the header types. Then you iter all columns and hide the 
> headers based on their enum value. Which means nothing needs hardcoding and 
> should more columns get added later the switch cases handling would light up 
> in compiler warnings so no one can forget to handle the new headers to either 
> hide or show by default.
> 
> -- https://phabricator.kde.org/D10877