Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'cancel_notification' into 'master'
[transfer-engine] Fix canceled download keeping progress notification. Fixes JB#41489

See merge request mer-core/transfer-engine!6
  • Loading branch information
pvuorela committed Mar 28, 2018
2 parents ff6c5eb + e1efa03 commit 2474510
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rpm/transfer-engine-qt5.spec
@@ -1,5 +1,5 @@
Name: nemo-transferengine-qt5
Version: 0.1.6
Version: 0.3.1
Release: 0
Summary: Transfer Engine for uploading media content and tracking transfers.
Group: System Environment/Daemon
Expand Down
7 changes: 6 additions & 1 deletion src/transferengine.cpp
Expand Up @@ -335,7 +335,7 @@ void TransferEnginePrivate::sendNotification(TransferEngineData::TransferType ty
bool useProgress = false;
Notification::Urgency urgency = Notification::Normal;
QString appIcon = QStringLiteral("icon-lock-information");
QString icon = QStringLiteral("x-nemo-icon=icon-lock-transfer");
QString icon = QStringLiteral("icon-lock-transfer");

// TODO: explicit grouping of transfer notifications is now removed, as grouping
// will now be performed by lipstick. We may need to reinstate group summary
Expand Down Expand Up @@ -383,6 +383,7 @@ void TransferEnginePrivate::sendNotification(TransferEngineData::TransferType ty
} else if (status == TransferEngineData::TransferInterrupted) {
urgency = Notification::Critical;
appIcon = QStringLiteral("icon-lock-information");
category = TRANSFER_ERROR_EVENT_CATEGORY;
icon.clear();

switch (type) {
Expand Down Expand Up @@ -466,6 +467,10 @@ void TransferEnginePrivate::sendNotification(TransferEngineData::TransferType ty
notification.setPreviewBody(previewBody);
notification.setUrgency(urgency);

if (!icon.isEmpty()) {
notification.setIcon(icon);
}

if (useProgress) {
notification.setHintValue(TRANSFER_PROGRESS_HINT, static_cast<double>(progress));
}
Expand Down

0 comments on commit 2474510

Please sign in to comment.