I have made the following changes intended for : CE:UX:MTF / lipstick Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below.
https://build.pub.meego.com//request/show/8209 Thank You, vesuri [This message was auto-generated] --- Request # 8209: Messages from BOSS: State: review at 2013-02-28T15:10:28 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:vesuri:branches:CE:UX:MTF / lipstick -> CE:UX:MTF / lipstick changes files: -------------- --- lipstick.changes +++ lipstick.changes @@ -0,0 +1,3 @@ +* Thu Feb 28 2013 Vesa Halttunen <[email protected]> - 0.10.1 +- Expose notification category in the Notification class (from Vesa) + old: ---- lipstick-0.10.0.tar.bz2 new: ---- lipstick-0.10.1.tar.bz2 spec files: ----------- --- lipstick.spec +++ lipstick.spec @@ -9,7 +9,7 @@ # << macros Summary: QML toolkit for homescreen creation -Version: 0.10.0 +Version: 0.10.1 Release: 1 Group: System/Libraries License: LGPLv2.1 other changes: -------------- ++++++ lipstick-0.10.0.tar.bz2 -> lipstick-0.10.1.tar.bz2 --- src/notifications/notification.cpp +++ src/notifications/notification.cpp @@ -126,6 +126,7 @@ int oldUrgency = urgency(); int oldItemCount = itemCount(); int oldPriority = priority(); + QString oldCategory = category(); hints_ = hints; @@ -160,6 +161,10 @@ if (oldPriority != priority()) { emit priorityChanged(); } + + if (oldCategory != category()) { + emit categoryChanged(); + } } int Notification::expireTimeout() const @@ -212,6 +217,11 @@ return hints_.value(NotificationManager::HINT_PRIORITY).toInt(); } +QString Notification::category() const +{ + return hints_.value(NotificationManager::HINT_CATEGORY).toString(); +} + QDBusArgument &operator<<(QDBusArgument &argument, const Notification ¬ification) { argument.beginStructure(); --- src/notifications/notification.h +++ src/notifications/notification.h @@ -44,6 +44,7 @@ Q_PROPERTY(int urgency READ urgency NOTIFY urgencyChanged) Q_PROPERTY(int itemCount READ itemCount NOTIFY itemCountChanged) Q_PROPERTY(int priority READ priority NOTIFY priorityChanged) + Q_PROPERTY(QString category READ category NOTIFY categoryChanged) public: /*! @@ -137,6 +138,9 @@ //! Returns the priority of the notification int priority() const; + //! Returns the category of the notification + QString category() const; + //! \internal /*! * Creates a copy of an existing representation of a notification. @@ -189,6 +193,9 @@ //! Sent when the priority has been modified void priorityChanged(); + //! Sent when the category has been modified + void categoryChanged(); + private: //! Name of the application sending the notification QString appName_; --- src/src.pro +++ src/src.pro @@ -3,7 +3,7 @@ TEMPLATE = lib TARGET = lipstick -VERSION = 0.10.0 +VERSION = 0.10.1 DEFINES += LIPSTICK_BUILD_LIBRARY VERSION=\\\"$$VERSION\\\" --- tests/ut_notification/ut_notification.cpp +++ tests/ut_notification/ut_notification.cpp @@ -32,6 +32,7 @@ int urgency = 1; int itemCount = 1; int priority = 1; + QString category = "category1"; QStringList actions = QStringList() << "action1a" << "action1b"; QDateTime timestamp = QDateTime::currentDateTime(); QVariantHash hints; @@ -42,6 +43,7 @@ hints.insert(NotificationManager::HINT_PREVIEW_SUMMARY, previewSummary); hints.insert(NotificationManager::HINT_PREVIEW_BODY, previewBody); hints.insert(NotificationManager::HINT_URGENCY, urgency); + hints.insert(NotificationManager::HINT_CATEGORY, category); int expireTimeout = 1; // Ensure that the constructor puts things in place @@ -60,6 +62,7 @@ QCOMPARE(notification.urgency(), urgency); QCOMPARE(notification.itemCount(), itemCount); QCOMPARE(notification.priority(), priority); + QCOMPARE(notification.category(), category); appName = "appName2"; appIcon = "appIcon2"; @@ -71,6 +74,7 @@ urgency = 2; itemCount = 2; priority = 2; + category = "category2"; actions = QStringList() << "action2a" << "action2b" << "action2c"; timestamp = QDateTime::currentDateTime(); hints.insert(NotificationManager::HINT_TIMESTAMP, timestamp); @@ -80,6 +84,7 @@ hints.insert(NotificationManager::HINT_PREVIEW_SUMMARY, previewSummary); hints.insert(NotificationManager::HINT_PREVIEW_BODY, previewBody); hints.insert(NotificationManager::HINT_URGENCY, urgency); + hints.insert(NotificationManager::HINT_CATEGORY, category); expireTimeout = 2; notification.setAppName(appName); notification.setAppIcon(appIcon); @@ -101,6 +106,7 @@ QCOMPARE(notification.urgency(), urgency); QCOMPARE(notification.itemCount(), itemCount); QCOMPARE(notification.priority(), priority); + QCOMPARE(notification.category(), category); } void Ut_Notification::testIcon_data() --- tests/ut_notificationfeedbackplayer/ut_notificationfeedbackplayer.cpp +++ tests/ut_notificationfeedbackplayer/ut_notificationfeedbackplayer.cpp @@ -19,6 +19,7 @@ #include "ngfclient_stub.h" #include "ut_notificationfeedbackplayer.h" +const char *NotificationManager::HINT_CATEGORY = "category"; const char *NotificationManager::HINT_URGENCY = "urgency"; const char *NotificationManager::HINT_ICON = "x-nemo-icon"; const char *NotificationManager::HINT_ITEM_COUNT = "x-nemo-item-count"; --- tests/ut_notificationlistmodel/ut_notificationlistmodel.cpp +++ tests/ut_notificationlistmodel/ut_notificationlistmodel.cpp @@ -18,6 +18,16 @@ #include "notificationlistmodel.h" #include "notificationmanager_stub.h" +void QTimer::singleShot(int, QObject *receiver, const char *member) +{ + // The "member" string is of form "1member()", so remove the trailing 1 and the () + int memberLength = strlen(member) - 3; + char modifiedMember[memberLength + 1]; + strncpy(modifiedMember, member + 1, memberLength); + modifiedMember[memberLength] = 0; + QMetaObject::invokeMethod(receiver, modifiedMember, Qt::DirectConnection); +} + void Ut_NotificationListModel::init() { } --- tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.cpp +++ tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.cpp @@ -76,6 +76,7 @@ qWidgetVisible[this] = visible; } +const char *NotificationManager::HINT_CATEGORY = "category"; const char *NotificationManager::HINT_URGENCY = "urgency"; const char *NotificationManager::HINT_ICON = "x-nemo-icon"; const char *NotificationManager::HINT_ITEM_COUNT = "x-nemo-item-count"; ++++++ lipstick.yaml --- lipstick.yaml +++ lipstick.yaml @@ -1,6 +1,6 @@ Name: lipstick Summary: QML toolkit for homescreen creation -Version: 0.10.0 +Version: 0.10.1 Release: 1 Group: System/Libraries License: LGPLv2.1
