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/7339

Thank You,
vesuri

[This message was auto-generated]

---

Request # 7339:

Messages from BOSS:

State: review at 2012-11-07T17:29: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 @@
+* Wed Nov 07 2012 Vesa Halttunen <[email protected]> - 0.4.9
+- Notification system improvements (from Vesa)
+

old:
----
  lipstick-0.4.8.tar.bz2

new:
----
  lipstick-0.4.9.tar.bz2

spec files:
-----------
--- lipstick.spec
+++ lipstick.spec
@@ -9,7 +9,7 @@
 # << macros
 
 Summary:    QML toolkit for homescreen creation
-Version:    0.4.8
+Version:    0.4.9
 Release:    1
 Group:      System/Libraries
 License:    LGPLv2.1

other changes:
--------------

++++++ lipstick-0.4.8.tar.bz2 -> lipstick-0.4.9.tar.bz2
--- .gitignore
+++ .gitignore
@@ -1,18 +0,0 @@
-Makefile
-*.o
-*gen_*.h
-*gen_*.cpp
-*gen_*.o
-*moc_*.h
-*moc_*.cpp
-*moc_*.o
-*~
-*.log
-*.log.xml
-*.gcno
-*.gcda
-*.pro.user
-configure-stamp
-build-stamp
-.project
-.cproject
--- plugin/.gitignore
+++ plugin/.gitignore
@@ -1 +0,0 @@
-liblipstickplugin.so
--- src/.gitignore
+++ src/.gitignore
@@ -1,2 +0,0 @@
-liblipstick.*
-pkgconfig
--- src/notifications/.gitignore
+++ src/notifications/.gitignore
@@ -1 +0,0 @@
-notificationmanageradaptor.*
--- src/notifications/notificationlistmodel.cpp
+++ src/notifications/notificationlistmodel.cpp
@@ -48,5 +48,5 @@
 
 bool NotificationListModel::notificationShouldBeShown(Notification 
*notification)
 {
-    return !notification->body().isEmpty() && 
!notification->summary().isEmpty();
+    return !(notification->body().isEmpty() && 
notification->summary().isEmpty()) && 
notification->hints().value(NotificationManager::HINT_URGENCY).toInt() < 3;
 }
--- src/notifications/notificationmanager.cpp
+++ src/notifications/notificationmanager.cpp
@@ -34,7 +34,7 @@
 #endif
 
 //! The category definitions directory
-static const char *CATEGORY_DEFINITION_FILE_DIRECTORY = 
"/usr/share/nemo/notifications/categories";
+static const char *CATEGORY_DEFINITION_FILE_DIRECTORY = 
"/usr/share/lipstick/notificationcategories";
 
 //! The number configuration files to load into the event type store.
 static const uint MAX_CATEGORY_DEFINITION_FILES = 100;
--- src/notifications/notificationmanager.h
+++ src/notifications/notificationmanager.h
@@ -40,7 +40,7 @@
  *     to contain body text.
  *   - The "category" hint is used to load a definition for notifications in
  *     that category from
- *     /usr/share/nemo/notifications/categories/categoryname.conf. This allows
+ *     /usr/share/lipstick/notificationcategories/categoryname.conf. This 
allows
  *     defining common properties for all notifications in each category.
  *        - Each category definition file contains a list of hint=value pairs,
  *          one per line.
--- src/notifications/notificationpreviewpresenter.cpp
+++ src/notifications/notificationpreviewpresenter.cpp
@@ -113,7 +113,7 @@
 
 bool NotificationPreviewPresenter::notificationShouldBeShown(Notification 
*notification)
 {
-    return !notification->previewBody().isEmpty() && 
!notification->previewSummary().isEmpty();
+    return !(notification->previewBody().isEmpty() && 
notification->previewSummary().isEmpty());
 }
 
 void NotificationPreviewPresenter::setNotificationPreviewRect(qreal x1, qreal 
y1, qreal x2, qreal y2)
--- src/src.pro
+++ src/src.pro
@@ -2,7 +2,7 @@
 
 TEMPLATE = lib
 TARGET = lipstick
-VERSION = 0.4.7
+VERSION = 0.4.9
 
 DEFINES += LIPSTICK_BUILD_LIBRARY DEBUG_NOTIFICATIONS VERSION=\\\"$$VERSION\\\"
 
--- tests/stubs/notificationmanager_stub.h
+++ tests/stubs/notificationmanager_stub.h
@@ -130,6 +130,7 @@
 
 
 // 4. CREATE A PROXY WHICH CALLS THE STUB
+const char *NotificationManager::HINT_URGENCY = "urgency";
 const char *NotificationManager::HINT_ICON = "x-nemo-icon";
 const char *NotificationManager::HINT_TIMESTAMP = "x-nemo-timestamp";
 const char *NotificationManager::HINT_PREVIEW_ICON = "x-nemo-preview-icon";
--- tests/ut_categorydefinitionstore/.gitignore
+++ tests/ut_categorydefinitionstore/.gitignore
@@ -1 +0,0 @@
-ut_categorydefinitionstore
--- tests/ut_lipstickdbusinterface/.gitignore
+++ tests/ut_lipstickdbusinterface/.gitignore
@@ -1 +0,0 @@
-ut_lipstickdbusinterface
--- tests/ut_lipsticksettings/.gitignore
+++ tests/ut_lipsticksettings/.gitignore
@@ -1 +0,0 @@
-ut_lipsticksettings
--- tests/ut_notification/.gitignore
+++ tests/ut_notification/.gitignore
@@ -1 +0,0 @@
-ut_notification
--- tests/ut_notificationlistmodel/.gitignore
+++ tests/ut_notificationlistmodel/.gitignore
@@ -1 +0,0 @@
-ut_notificationlistmodel
--- tests/ut_notificationlistmodel/ut_notificationlistmodel.cpp
+++ tests/ut_notificationlistmodel/ut_notificationlistmodel.cpp
@@ -51,40 +51,46 @@
     QCOMPARE(gQObjectListModelStub->stubCallCount("addItem"), 0);
 }
 
-void Ut_NotificationListModel::testNotificationIsNotAddedIfSummaryIsEmpty()
+void 
Ut_NotificationListModel::testNotificationIsNotAddedIfNoSummaryOrBody_data()
 {
-    Notification notification("appName", 1, "appIcon", "", "body", 
QStringList() << "action", QVariantHash(), 1);
-    gNotificationManagerStub->stubSetReturnValue("notificationIds", 
QList<uint>() << 1);
-    gNotificationManagerStub->stubSetReturnValue("notification", 
&notification);
-    gQObjectListModelStub->stubSetReturnValue("indexOf", -1);
-    NotificationListModel model;
-    QCOMPARE(gQObjectListModelStub->stubCallCount("addItem"), 0);
+    QTest::addColumn<QString>("summary");
+    QTest::addColumn<QString>("body");
+    QTest::addColumn<int>("addItemCount");
+    QTest::newRow("No summary, no body") << "" << "" << 0;
+    QTest::newRow("Summary, no body") << "summary" << "" << 1;
+    QTest::newRow("No summary, body") << "" << "body" << 1;
+    QTest::newRow("Summary, body") << "summary" << "body" << 1;
 }
 
-void Ut_NotificationListModel::testNotificationIsNotAddedIfBodyIsEmpty()
+void Ut_NotificationListModel::testNotificationIsNotAddedIfNoSummaryOrBody()
 {
-    Notification notification("appName", 1, "appIcon", "summary", "", 
QStringList() << "action", QVariantHash(), 1);
+    QFETCH(QString, summary);
+    QFETCH(QString, body);
+    QFETCH(int, addItemCount);
+
+    Notification notification("appName", 1, "appIcon", summary, body, 
QStringList() << "action", QVariantHash(), 1);
     gNotificationManagerStub->stubSetReturnValue("notificationIds", 
QList<uint>() << 1);
     gNotificationManagerStub->stubSetReturnValue("notification", 
&notification);
     gQObjectListModelStub->stubSetReturnValue("indexOf", -1);
     NotificationListModel model;
-    QCOMPARE(gQObjectListModelStub->stubCallCount("addItem"), 0);
+    QCOMPARE(gQObjectListModelStub->stubCallCount("addItem"), addItemCount);
 }
 
-void 
Ut_NotificationListModel::testAlreadyAddedNotificationIsRemovedIfSummaryChangesToEmpty()
+void Ut_NotificationListModel::testNotificationIsNotAddedIfUrgencyIsSystem()
 {
-    Notification notification("appName", 1, "appIcon", "", "body", 
QStringList() << "action", QVariantHash(), 1);
+    QVariantHash hints;
+    hints.insert(NotificationManager::HINT_URGENCY, 3);
+    Notification notification("appName", 1, "appIcon", "summary", "body", 
QStringList() << "action", hints, 1);
     gNotificationManagerStub->stubSetReturnValue("notificationIds", 
QList<uint>() << 1);
     gNotificationManagerStub->stubSetReturnValue("notification", 
&notification);
-    gQObjectListModelStub->stubSetReturnValue("indexOf", 0);
+    gQObjectListModelStub->stubSetReturnValue("indexOf", -1);
     NotificationListModel model;
-    QCOMPARE(gQObjectListModelStub->stubCallCount("removeItem"), 1);
-    
QCOMPARE(gQObjectListModelStub->stubCallsTo("removeItem").at(0)->parameter<QObject
 *>(0), &notification);
+    QCOMPARE(gQObjectListModelStub->stubCallCount("addItem"), 0);
 }
 
-void 
Ut_NotificationListModel::testAlreadyAddedNotificationIsRemovedIfBodyChangesToEmpty()
+void 
Ut_NotificationListModel::testAlreadyAddedNotificationIsRemovedIfNoLongerAddable()
 {
-    Notification notification("appName", 1, "appIcon", "summary", "", 
QStringList() << "action", QVariantHash(), 1);
+    Notification notification("appName", 1, "appIcon", "", "", QStringList() 
<< "action", QVariantHash(), 1);
     gNotificationManagerStub->stubSetReturnValue("notificationIds", 
QList<uint>() << 1);
     gNotificationManagerStub->stubSetReturnValue("notification", 
&notification);
     gQObjectListModelStub->stubSetReturnValue("indexOf", 0);
--- tests/ut_notificationlistmodel/ut_notificationlistmodel.h
+++ tests/ut_notificationlistmodel/ut_notificationlistmodel.h
@@ -26,10 +26,10 @@
     void cleanup();
     void testModelPopulatesOnConstruction();
     void testNotificationIsOnlyAddedIfNotAlreadyAdded();
-    void testNotificationIsNotAddedIfSummaryIsEmpty();
-    void testNotificationIsNotAddedIfBodyIsEmpty();
-    void testAlreadyAddedNotificationIsRemovedIfSummaryChangesToEmpty();
-    void testAlreadyAddedNotificationIsRemovedIfBodyChangesToEmpty();
+    void testNotificationIsNotAddedIfNoSummaryOrBody_data();
+    void testNotificationIsNotAddedIfNoSummaryOrBody();
+    void testNotificationIsNotAddedIfUrgencyIsSystem();
+    void testAlreadyAddedNotificationIsRemovedIfNoLongerAddable();
     void testNotificationRemoval();
 };
 
--- tests/ut_notificationmanager/.gitignore
+++ tests/ut_notificationmanager/.gitignore
@@ -1 +0,0 @@
-ut_notificationmanager
--- tests/ut_notificationpreviewpresenter/.gitignore
+++ tests/ut_notificationpreviewpresenter/.gitignore
@@ -1 +0,0 @@
-ut_notificationpreviewpresenter
--- tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.cpp
+++ tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.cpp
@@ -323,8 +323,8 @@
     QTest::addColumn<int>("signalCount");
     QTest::addColumn<bool>("windowVisible");
     QTest::newRow("No summary, no body") << "" << "" << 0 << false;
-    QTest::newRow("Summary, no body") << "summary" << "" << 0 << false;
-    QTest::newRow("No summary, body") << "" << "body" << 0 << false;
+    QTest::newRow("Summary, no body") << "summary" << "" << 1 << true;
+    QTest::newRow("No summary, body") << "" << "body" << 1 << true;
     QTest::newRow("Summary, body") << "summary" << "body" << 1 << true;
 }
 
--- tools/notificationtool/.gitignore
+++ tools/notificationtool/.gitignore
@@ -1,2 +0,0 @@
-notificationmanagerproxy.*
-notificationtool

++++++ lipstick.yaml
--- lipstick.yaml
+++ lipstick.yaml
@@ -1,6 +1,6 @@
 Name: lipstick
 Summary: QML toolkit for homescreen creation
-Version: 0.4.8
+Version: 0.4.9
 Release: 1
 Group: System/Libraries
 License: LGPLv2.1



Reply via email to