Commit bf505de6 authored by Albert Astals Cid's avatar Albert Astals Cid

Fix Plasma applet printer job count

Summary: We were always showing the jobs for all printers, not for the currently open printer item

Test Plan:
* Have two printers setup (ideally one that is not connected)
* Print to the non connected printer
* See how without this patch the applet says "there's 1 job" for both printers
* See that with this patch it only says "there's 1 job" for the correct printer

Reviewers: dantti

Reviewed By: dantti

Subscribers: kde-utils-devel

Differential Revision: https://phabricator.kde.org/D10351
parent 89322276
......@@ -30,7 +30,7 @@ Item {
id: printerItem
property bool isPaused: false
property bool expanded: ListView.view.currentExpanded == index
readonly property bool expanded: ListView.view.currentExpanded == index
height: container.childrenRect.height + Math.round(units.gridUnit / 2)
width: parent.width - Math.round(units.gridUnit / 2)
......@@ -61,8 +61,11 @@ Item {
}
}
onClicked: {
printerItem.ListView.view.currentExpanded = expanded ? -1 : index;
// the order is important, don't change since the last
// line resets the value of expanded and makes the code hard to read
// if it's not the last one
jobsFilterModel.filteredPrinters = expanded ? "" : printerName
printerItem.ListView.view.currentExpanded = expanded ? -1 : index;
}
KQuickControlsAddons.QIconItem {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment