Skip to content

Commit

Permalink
[transfer-engine] Use categories to configure notification properties
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewvogt committed Mar 19, 2015
1 parent 89bce4f commit 8f7313d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 7 deletions.
6 changes: 6 additions & 0 deletions data/data.pro
@@ -0,0 +1,6 @@
TEMPLATE = aux

notification_categories.path = /usr/share/lipstick/notificationcategories
notification_categories.files = notificationcategories/*.conf

INSTALLS += notification_categories
2 changes: 2 additions & 0 deletions data/notificationcategories/x-nemo.transfer.complete.conf
@@ -0,0 +1,2 @@
appIcon=icon-lock-transfer
urgency=1
3 changes: 3 additions & 0 deletions data/notificationcategories/x-nemo.transfer.conf
@@ -0,0 +1,3 @@
appIcon=icon-lock-transfer
transient=true
urgency=1
2 changes: 2 additions & 0 deletions data/notificationcategories/x-nemo.transfer.error.conf
@@ -0,0 +1,2 @@
appIcon=icon-lock-transfer
urgency=2
2 changes: 1 addition & 1 deletion rpm/transfer-engine-qt5.spec
Expand Up @@ -35,7 +35,7 @@ Obsoletes: nemo-transferengine <= 0.0.19
%{_bindir}/nemo-transfer-engine
%{_datadir}/dbus-1/services/org.nemo.transferengine.service
%{_datadir}/translations/nemo-transfer-engine_eng_en.qm

%{_datadir}/lipstick/notificationcategories/*

%package -n libnemotransferengine-qt5
Summary: Transfer engine library.
Expand Down
8 changes: 3 additions & 5 deletions src/transferengine.cpp
Expand Up @@ -52,9 +52,9 @@
#define ACTIVITY_MONITOR_TIMEOUT 1*60*1000 // 1 minute in ms
#define TRANSFER_EXPIRATION_THRESHOLD 3*60 // 3 minutes in seconds

#define TRANSFER_EVENT_CATEGORY "transfer"
#define TRANSFER_COMPLETE_EVENT_CATEGORY "transfer.complete"
#define TRANSFER_ERROR_EVENT_CATEGORY "transfer.error"
#define TRANSFER_EVENT_CATEGORY "x-nemo.transfer"
#define TRANSFER_COMPLETE_EVENT_CATEGORY "x-nemo.transfer.complete"
#define TRANSFER_ERROR_EVENT_CATEGORY "x-nemo.transfer.error"

TransferEngineSignalHandler * TransferEngineSignalHandler::instance()
{
Expand Down Expand Up @@ -398,8 +398,6 @@ void TransferEnginePrivate::sendNotification(TransferEngineData::TransferType ty

if (!existing) {
// Create a new notification
notification.setAppIcon("icon-lock-transfer");

if (m_settings.status() != QSettings::NoError) {
qWarning() << Q_FUNC_INFO << "Failed to read settings!" << m_settings.status();
} else {
Expand Down
2 changes: 1 addition & 1 deletion transfer-engine.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
SUBDIRS = lib src declarative tests
SUBDIRS = lib src declarative tests data

src.depends = lib
tests.depends = lib
Expand Down

0 comments on commit 8f7313d

Please sign in to comment.