Commit fb620e07 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Allow copying job source/dest and cleanup a bit

parent 35c575be
......@@ -57,17 +57,41 @@ GridLayout {
model: [1, 2]
PlasmaExtras.DescriptiveLabel {
id: descriptionValueLabel
Layout.column: 1
Layout.row: index
Layout.fillWidth: true
text: jobDetails["descriptionLabel" + modelData] && jobDetails["descriptionValue" + modelData]
? jobDetails["descriptionValue" + modelData] : ""
font: theme.smallestFont
elide: Text.ElideMiddle
textFormat: Text.PlainText
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
maximumLineCount: 5
visible: text !== ""
Component.onCompleted: bindText()
function bindText() {
text = Qt.binding(function() {
return jobDetails["descriptionLabel" + modelData] && jobDetails["descriptionValue" + modelData]
? jobDetails["descriptionValue" + modelData] : "";
});
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onPressed: {
// break binding so it doesn't update while the menu is opened
descriptionValueLabel.text = descriptionValueLabel.text;
descriptionValueMenu.open(mouse.x, mouse.y)
}
}
EditContextMenu {
id: descriptionValueMenu
target: descriptionValueLabel
// defer re-binding until after the "Copy" action in the menu has triggered
onClosed: Qt.callLater(descriptionValueLabel.bindText)
}
}
}
......
......@@ -245,7 +245,7 @@ QString Notification::body() const
void Notification::setBody(const QString &body)
{
m_body = sanitize(body);
m_body = sanitize(body.trimmed());
}
QString Notification::iconName() const
......@@ -429,7 +429,11 @@ void Notification::processHints(const QVariantMap &hints)
QStringLiteral("knotifications5/") + m_notifyRcName + QStringLiteral(".notifyrc")));
KConfigGroup globalGroup(&config, "Global");
const QString applicationName = globalGroup.readEntry("Name");
QString applicationName = globalGroup.readEntry("Name");
if (applicationName.isEmpty()) {
applicationName = globalGroup.readEntry("Comment");
}
m_applicationName = applicationName;
const QString iconName = globalGroup.readEntry("IconName");
......
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