I have made the following changes intended for :
  CE:UX:MTF / meegotouch-systemui

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

Thank You,
Marko Saukko

[This message was auto-generated]

---

Request # 4915:

Messages from BOSS:

State: review at 2012-05-29T16:21:57 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: Project:MTF:UX / meegotouch-systemui -> CE:UX:MTF / 
meegotouch-systemui
  
changes files:
--------------
--- meegotouch-systemui.changes
+++ meegotouch-systemui.changes
@@ -0,0 +1,7 @@
+* Tue May 29 2012 Marko Saukko <[email protected]> - 1.3.2-1
+- Updated to version 1.3.2-1
+- Added assert to pulseaudio client code.
+- Dependency to meegotouch-systemui-volume-fullscreen and 
+  meegotouch-systemui-volume-fullscreen removed and moved
+  to package groups.
+

old:
----
  meegotouch-meegotouch-systemui-1.2.24-2.tar.gz

new:
----
  meegotouch-meegotouch-systemui-1.3.2-1.tar.gz

spec files:
-----------
--- meegotouch-systemui.spec
+++ meegotouch-systemui.spec
@@ -1,18 +1,20 @@
 # 
 # Do NOT Edit the Auto-generated Part!
-# Generated by: spectacle version 0.23
+# Generated by: spectacle version 0.24
 # 
+
+Name:       meegotouch-systemui
+
 # >> macros
 # << macros
 
-Name:       meegotouch-systemui
 Summary:    System UI daemon
-Version:    1.2.24
+Version:    1.3.2
 Release:    1
 Group:      System/Desktop
 License:    LGPLv2.1
 URL:        http://meego.gitorious.org/meegotouch/meegotouch-systemui
-Source0:    meegotouch-%{name}-%{version}-2.tar.gz
+Source0:    meegotouch-%{name}-%{version}-1.tar.gz
 Source1:    boss.conf
 Source2:    meegotouch-systemui.desktop
 Source3:    lock.desktop
@@ -32,8 +34,6 @@
 Patch12:     NEMO_11_remove_profile_from_statusmenu.patch
 Patch13:     NEMO_12_fix_statusmenu_top.patch
 Patch14:     meegotouch-systemui-1.2.20-1-add-missing-libs-for-linking.patch
-Requires:   %{name}-screenlock-padlock
-Requires:   %{name}-volume-fullscreen
 Requires:   contextkit-meego
 BuildRequires:  pkgconfig(libpulse)
 BuildRequires:  pkgconfig(QtGui)
@@ -54,18 +54,11 @@
 BuildRequires:  expat-devel
 BuildRequires:  desktop-file-utils
 BuildRequires:  fdupes
-Provides:   duistatusindicatormenu > 0.18.1
-Provides:   systemui > 0.1
-Obsoletes:   duistatusindicatormenu <= 0.18.1
-Obsoletes:   systemui <= 0.1
-Obsoletes:   meegotouch-systemui <= 0.20.38
-
 
 %description
 This package contains the system UI daemon.
 
 
-
 %package devel
 Summary:    Development files for system UI daemon
 Group:      Development/System
@@ -183,6 +176,7 @@
 
 # >> build post
 # << build post
+
 %install
 rm -rf %{buildroot}
 # >> install pre
@@ -195,40 +189,17 @@
 
 
 # >> install post
-# << install post
 desktop-file-install --delete-original       \
-  --dir %{buildroot}%{_datadir}/applications             \
-   %{buildroot}%{_datadir}/applications/*.desktop
-%fdupes  %{buildroot}/%{_datadir}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+--dir %{buildroot}%{_datadir}/applications             \
+%{buildroot}%{_datadir}/applications/*.desktop
+# << install post
 
+%fdupes  %{buildroot}/%{_datadir}
 
 %post -n libnotificationsystem0 -p /sbin/ldconfig
 
 %postun -n libnotificationsystem0 -p /sbin/ldconfig
 
-
-
-
-
-
-
 %files
 %defattr(-,root,root,-)
 %config %{_sysconfdir}/dbus-1/system.d/systemui.conf
@@ -243,7 +214,6 @@
 # >> files
 # << files
 
-
 %files devel
 %defattr(-,root,root,-)
 %{_includedir}/system-ui/*
@@ -297,4 +267,3 @@
 %{_datadir}/system-ui-tests/tests.xml
 # >> files tests
 # << files tests
-

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

++++++ BMC_9319_pulseaudio-client.patch
--- BMC_9319_pulseaudio-client.patch
+++ BMC_9319_pulseaudio-client.patch
@@ -1,4 +1,4 @@
-From 21959c00d3c8a6773fc67117fbf50b311c71041e Mon Sep 17 00:00:00 2001
+From 7a9294ab2ae6704ba1a226dffadb573e3f63d536 Mon Sep 17 00:00:00 2001
 From: Marko Saukko <[email protected]>
 Date: Thu, 26 Jan 2012 14:22:21 +0200
 Subject: [PATCH] Pulseaudio client for volume control.
@@ -6,6 +6,26 @@
 Original author Jouni Peltonen <[email protected]>
 Rebased by Miroslav Safr <[email protected]>
 Mutex handling improved by Marko Saukko <[email protected]>
+Assertion added to default sink name callback by Marko Saukko 
<[email protected]>
+---
+ src/extensions/volume/keysniffer.cpp          |   79 +++++++
+ src/extensions/volume/keysniffer.h            |   37 +++
+ src/extensions/volume/pulseaudio_thread.cpp   |  132 +++++++++++
+ src/extensions/volume/pulseaudio_thread.h     |   44 ++++
+ src/extensions/volume/volume.pro              |    8 +-
+ src/extensions/volume/volumebar.cpp           |    4 +-
+ src/extensions/volume/volumebarlogic.cpp      |  309 ++++---------------------
+ src/extensions/volume/volumebarlogic.h        |   70 +++---
+ src/extensions/volume/volumebarwindow.cpp     |    4 +-
+ tests/stubs/volumebarlogic_stub.h             |   76 ++-----
+ tests/ut_volumebarlogic/ut_volumebarlogic.cpp |  212 +----------------
+ tests/ut_volumebarlogic/ut_volumebarlogic.h   |   10 -
+ tests/ut_volumebarlogic/ut_volumebarlogic.pro |    6 +-
+ 13 files changed, 403 insertions(+), 588 deletions(-)
+ create mode 100644 src/extensions/volume/keysniffer.cpp
+ create mode 100644 src/extensions/volume/keysniffer.h
+ create mode 100644 src/extensions/volume/pulseaudio_thread.cpp
+ create mode 100644 src/extensions/volume/pulseaudio_thread.h
 
 diff --git a/src/extensions/volume/keysniffer.cpp 
b/src/extensions/volume/keysniffer.cpp
 new file mode 100644
@@ -137,10 +157,10 @@
 +
 diff --git a/src/extensions/volume/pulseaudio_thread.cpp 
b/src/extensions/volume/pulseaudio_thread.cpp
 new file mode 100644
-index 0000000..cf31490
+index 0000000..b063b81
 --- /dev/null
 +++ b/src/extensions/volume/pulseaudio_thread.cpp
-@@ -0,0 +1,131 @@
+@@ -0,0 +1,132 @@
 +#include "pulseaudio_thread.h"
 +
 +pulseaudio_thread::pulseaudio_thread(QObject *parent)
@@ -191,6 +211,7 @@
 +void pulseaudio_thread::getDefaultSinkName_callback(pa_context *c, const 
pa_server_info *i, void *userdata)
 +{
 +  assert(c);
++  assert(i);
 +  const size_t len = strlen(i->default_sink_name);
 +  char * tmpSinkName = new char[len + 1];
 +  strncpy(tmpSinkName, i->default_sink_name, len);
@@ -1386,5 +1407,5 @@
      $$STUBSDIR/stubbase.cpp
  
 -- 
-1.7.6.5
+1.7.7.6
 

++++++ meegotouch-meegotouch-systemui-1.2.24-2.tar.gz -> 
meegotouch-meegotouch-systemui-1.3.2-1.tar.gz
--- debian/changelog
+++ debian/changelog
@@ -1,8 +1,22 @@
-system-ui (1.2.24-2) unstable; urgency=low
+system-ui (1.3.2-1) unstable; urgency=low
 
-  * Fixes: NB#295751 - Device shows OS update message after SSU from PR1 40-4 
to PR2 50-5
+  * Fixes: NB#296376 - Feature Request: Icon for "Beep"-profile in lock screen
 
- -- Vesa Halttunen <[email protected]>  Wed, 18 Jan 2012 11:38:05 +0200
+ -- Vesa Halttunen <[email protected]>  Mon, 06 Feb 2012 12:17:00 +0200
+
+system-ui (1.3.1-1) unstable; urgency=low
+
+  * Fixes: NB#297410 - Notification group timestamp prefix is incorrect after 
removing a notification from the group and adding a new one
+
+ -- Vesa Halttunen <[email protected]>  Fri, 27 Jan 2012 13:37:25 +0200
+
+system-ui (1.3.0-2) unstable; urgency=low
+
+  * Fixes: NB#296811 - Updating a notification group clears the user set time 
stamp
+  * Fixes: NB#297482 - Device shows OS update message after SSU from PR1 40-4 
to PR2 50-5
+  * Fixes: NB#297027 - Notification group does not show the real latest 
timestamp
+
+ -- Vesa Halttunen <[email protected]>  Wed, 25 Jan 2012 16:12:18 +0200
 
 system-ui (1.2.23-1) unstable; urgency=low
 
--- debian/control
+++ debian/control
@@ -16,7 +16,7 @@
 Replaces: duistatusindicatormenu, cellular-ui
 Architecture: any
 Recommends: pulseaudio-module-meego-mainvolume
-Depends: ${shlibs:Depends}, ${misc:Depends}, libmeegotouchcore0 (>= 0.24.7), 
systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, ui-fonts 
(>=5.6),
+Depends: ${shlibs:Depends}, ${misc:Depends}, 
systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, ui-fonts 
(>=5.6),
          usb-moded [armel]
 Description: Various system user interfaces.
   System user interface package contains various user interfaces, e.g:
--- src/systemui/notifications/notificationareasink.cpp
+++ src/systemui/notifications/notificationareasink.cpp
@@ -16,6 +16,7 @@
 ** of this file.
 **
 ****************************************************************************/
+
 #include "notificationareasink.h"
 #include "notificationwidgetparameterfactory.h"
 #include "notificationmanagerinterface.h"
@@ -79,8 +80,6 @@
     infoBanner->setProperty(USER_REMOVABLE_PROPERTY, 
determineUserRemovability(parameters));
     
infoBanner->setBannerTimeStamp(QDateTime::fromTime_t(parameters.value("timestamp").toUInt()));
 
-    updatePrefixForNotificationGroupBannerTimestamp(infoBanner, 
parameters.value("count").toUInt());
-
     // Update the info banner's image, titles and actions
     updateImage(infoBanner, parameters);
     updateTitles(infoBanner);
@@ -180,7 +179,6 @@
             // Seems like the infoBanner is NULL. So it means that the group 
banner was removed, but group is alive. Recreate the banner.
             infoBanner = createGroupBanner(groupId, 
notificationGroupParameters.value(groupId));
         }
-        
infoBanner->setBannerTimeStamp(QDateTime::fromTime_t(notification.parameters().value("timestamp").toUInt()));
 
         if (infoBanner != NULL && infoBanner->parentItem() == NULL) {
             // Add the group to the notification area if this is the first 
notification to the group
@@ -245,13 +243,17 @@
         if(decreaseNotificationCountOfGroup(groupid) == 0) {
             removeGroupBanner(groupid);
         }
+        notificationIdToGroupId.remove(notificationId);
     }
 }
 
 uint NotificationAreaSink::decreaseNotificationCountOfGroup(uint groupId)
 {
     uint notificationIdsCount = notificationCountOfGroup.value(groupId);
-    notificationCountOfGroup.insert(groupId, --notificationIdsCount);
+    if (notificationIdsCount > 0) {
+        notificationIdsCount--;
+    }
+    notificationCountOfGroup.insert(groupId, notificationIdsCount);
     
updatePrefixForNotificationGroupBannerTimestamp(groupIdToMBanner.value(groupId),
         notificationCountOfGroup.value(groupId));
     return  notificationIdsCount;
--- src/systemui/notifications/notificationareasink.h
+++ src/systemui/notifications/notificationareasink.h
@@ -134,6 +134,10 @@
     uint decreaseNotificationCountOfGroup(uint groupId);
     //! Updates the latest prefix for notification group timestamp.
     void updatePrefixForNotificationGroupBannerTimestamp(MBanner *infoBanner, 
uint count);
+
+#ifdef UNIT_TEST
+    friend class Ut_NotificationAreaSink;
+#endif
 };
 
 #endif /* NOTIFICATIONAREASINK_H_ */
--- src/systemui/notifications/notificationmanager.cpp
+++ src/systemui/notifications/notificationmanager.cpp
@@ -285,6 +285,8 @@
 
         submitNotification(notification);
 
+        updateGroupTimestampFromNotifications(groupId);
+
         return notificationId;
     }
     return 0;
@@ -312,6 +314,8 @@
             emit 
notificationUpdated(notificationContainer.value(notificationId));
         }
 
+        updateGroupTimestampFromNotifications((*ni).groupId());
+
         return true;
     } else {
         return false;
@@ -333,7 +337,7 @@
 {
     if (notificationContainer.contains(notificationId)) {
         // Mark the notification unused
-        notificationContainer.take(notificationId);
+        const Notification removedNotification = 
notificationContainer.take(notificationId);
 
         saveNotifications();
 
@@ -353,6 +357,8 @@
             }
         }
 
+        updateGroupTimestampFromNotifications(removedNotification.groupId());
+
         return true;
     } else {
         return false;
@@ -373,13 +379,13 @@
     foreach(uint notificationId, notificationIds) {
         result &= removeNotification(notificationId);
     }
+
     return result;
 }
 
 uint NotificationManager::addGroup(uint notificationUserId, const 
NotificationParameters &parameters)
 {
     NotificationParameters 
fullParameters(appendEventTypeParameters(parameters));
-    fullParameters.add(GenericNotificationParameterFactory::timestampKey(), 
timestamp(parameters));
 
     uint groupID = nextAvailableGroupID();
     NotificationGroup group(groupID, notificationUserId, fullParameters);
@@ -399,9 +405,7 @@
     QHash<uint, NotificationGroup>::iterator gi = groupContainer.find(groupId);
 
     if (gi != groupContainer.end()) {
-        NotificationParameters fullParameters(parameters);
-        
fullParameters.add(GenericNotificationParameterFactory::timestampKey(), 
timestamp(parameters));
-        gi->updateParameters(fullParameters);
+        gi->updateParameters(parameters);
 
         saveStateData();
 
@@ -673,3 +677,30 @@
     return timestamp == 0 ? QDateTime::currentDateTimeUtc().toTime_t() : 
timestamp;
 }
 
+void NotificationManager::updateGroupTimestampFromNotifications(uint groupId)
+{
+    if (groupId != 0 && groupContainer.contains(groupId)) {
+        NotificationGroup group = groupContainer.value(groupId);
+        NotificationParameters groupParameters = group.parameters();
+        uint oldGroupTimestamp = 
groupParameters.value(GenericNotificationParameterFactory::timestampKey()).toUInt();
+
+        // Check the latest notification timestamp of the group's notifications
+        uint newGroupTimestamp = 0;
+        QHash<uint, Notification>::const_iterator notificationIterator;
+        for (notificationIterator = notificationContainer.begin(); 
notificationIterator != notificationContainer.end(); notificationIterator++) {
+            if ((*notificationIterator).groupId() == groupId) {
+                uint notificationTimestamp = 
(*notificationIterator).parameters().value(GenericNotificationParameterFactory::timestampKey()).toUInt();
+                if (newGroupTimestamp < notificationTimestamp) {
+                    newGroupTimestamp = notificationTimestamp;
+                }
+            }
+        }
+
+        if (oldGroupTimestamp != newGroupTimestamp) {
+            // Update the group timestamp
+            
groupParameters.add(GenericNotificationParameterFactory::timestampKey(), 
newGroupTimestamp);
+            group.updateParameters(groupParameters);
+            updateGroup(group.userId(), group.groupId(), group.parameters());
+        }
+    }
+}
--- src/systemui/notifications/notificationmanager.h
+++ src/systemui/notifications/notificationmanager.h
@@ -305,6 +305,12 @@
      */
     uint timestamp(const NotificationParameters &parameters);
 
+    /*! Updates the given group's timestamp according to the latest timestamp 
of group's notifications.
+     *
+     * \param groupId The id of the group of which timestamp should be updated
+     */
+    void updateGroupTimestampFromNotifications(uint groupId);
+
     //! Hash of all notifications keyed by notification IDs
     QHash<uint, Notification> notificationContainer;
 
--- src/systemui/statusarea/statusindicator.cpp
+++ src/systemui/statusarea/statusindicator.cpp
@@ -680,6 +680,8 @@
 {
     if (profile->value().toString() == "silent") {
         setStyleNameAndUpdate(QString(metaObject()->className()) + "Silent");
+    } else if (profile->value().toString() == "meeting") {
+        setStyleNameAndUpdate(QString(metaObject()->className()) + "Beep");
     } else {
         setStyleNameAndUpdate(metaObject()->className());
     }
--- tests/ut_notificationareasink/ut_notificationareasink.cpp
+++ tests/ut_notificationareasink/ut_notificationareasink.cpp
@@ -329,6 +329,7 @@
     // Last notification in group removed, so banner will be removed
     emit(removeNotification(1));
     QCOMPARE(remSpy.count(), 1);
+    QCOMPARE(sink->notificationIdToGroupId.isEmpty(), true);
 }
 
 void Ut_NotificationAreaSink::testAddNotificationToGroup()
@@ -340,9 +341,10 @@
     TestNotificationParameters parameters1("title1", "subtitle1", "icon1", 
"content1", 12345);
     emit addNotification(Notification(0, 1, 2, parameters1, 
Notification::ApplicationEvent, 1000));
 
-    QCOMPARE(timestamps[1].toTime_t(), (uint)12345);
     QCOMPARE(addSpy.count(), 1);
     QCOMPARE(notifications.count(), 1);
+    // Group timestamp shouldn't change in sink when notification added (that 
is handled in notification manager)
+    QCOMPARE(timestamps.count(), 1);
 }
 
 void 
Ut_NotificationAreaSink::testAddNewNotificationToGroupUpdatesNotificationArea()
@@ -370,7 +372,7 @@
     const QString NOTIFICATION_ICON("notificationIcon");
     const QString NOTIFICATION_ACTION("notificationAction");
 
-    TestNotificationParameters groupParameters(GROUP_SUMMARY, GROUP_BODY, 
GROUP_ICON, GROUP_ACTION);
+    TestNotificationParameters groupParameters(GROUP_SUMMARY, GROUP_BODY, 
GROUP_ICON, GROUP_ACTION, 123);
     emit addGroup(GROUP_ID, groupParameters);
     TestNotificationParameters notificationParameters(NOTIFICATION_SUMMARY, 
NOTIFICATION_BODY, NOTIFICATION_ICON, NOTIFICATION_ACTION, 12345);
     emit addNotification(Notification(NOTIFICATION_ID, GROUP_ID, 2, 
notificationParameters, Notification::ApplicationEvent, 1000));
@@ -386,8 +388,8 @@
     MBanner *banner = bannerCatcher.banners.at(0);
     // The banner should have the notification group's data
     QCOMPARE(banner->title(), GROUP_BODY);
-    // The banner should have the timestamp of the previous notification
-    QCOMPARE(timestamps[0].toTime_t(), (uint)12345);
+    // The banner should have the timestamp of the group
+    QCOMPARE(timestamps[0].toTime_t(), (uint)123);
 }
 
 void Ut_NotificationAreaSink::testUpdateGroup()
@@ -410,7 +412,7 @@
 
     emit addGroup(1, parameters1);
 
-    // The stub is now aware of the banner so updates go to the first 
occurrence of the banner
+    // The stub is now aware of the banner so updates go to the first 
occurrence of the banner. Timestamp should get updated.
     QCOMPARE(titles.length(), 2);
     QCOMPARE(titles[0], QString("subtitle1"));
     QCOMPARE(subtitles.length(), 2);
@@ -511,4 +513,17 @@
     QCOMPARE(prefixTimeStamps.value(notifications.at(0)).isEmpty(), true);
 }
 
+void 
Ut_NotificationAreaSink::testNotUpdatingGroupBannerTimestampPrefixWhenBannerUpdated()
+{
+    emit addGroup(1, TestNotificationParameters());
+    emit addNotification(Notification(0, 1, 2, TestNotificationParameters(), 
Notification::ApplicationEvent, 1000));
+
+    QCOMPARE(prefixTimeStamps.count(), 1);
+
+    TestNotificationParameters groupParameters;
+    groupParameters.add(NotificationParameter("count", 2));
+    sink->updateNotification(notifications.at(0), groupParameters);
+    QCOMPARE(prefixTimeStamps.count(), 1);
+}
+
 QTEST_APPLESS_MAIN(Ut_NotificationAreaSink)
--- tests/ut_notificationareasink/ut_notificationareasink.h
+++ tests/ut_notificationareasink/ut_notificationareasink.h
@@ -93,6 +93,7 @@
     void testApplyPrivacySetting();
     void testNotificationsFetchedFromNotificationManager();
     void 
testSetPrefixForNotificationGroupBannerWhenThereIsMoreThanOneNotificationInAGroup();
+    void testNotUpdatingGroupBannerTimestampPrefixWhenBannerUpdated();
 
 signals:
     void addGroup(uint groupId, const NotificationParameters &parameters);
--- tests/ut_notificationmanager/ut_notificationmanager.cpp
+++ tests/ut_notificationmanager/ut_notificationmanager.cpp
@@ -1467,7 +1467,7 @@
     QCOMPARE(parameters.value(ICON).toString(), QString("buttonicon2"));
 }
 
-void Ut_NotificationManager::tesNotificationStorage()
+void Ut_NotificationManager::testNotificationStorage()
 {
     gEventTypeSettings["persistent"][PERSISTENT] = "true";
 
@@ -1851,7 +1851,7 @@
     QCOMPARE(notification.notificationId(), notificationId);
 }
 
-void Ut_NotificationManager::testAddGroupWithAndWithoutTimestamp()
+void Ut_NotificationManager::testAddGroupWithoutAndWithTimestamp()
 {
     QSignalSpy spy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters&)));
 
@@ -1860,44 +1860,224 @@
     qDateTimeToTime_t = 123;
     NotificationParameters params;
     params.add(TIMESTAMP, timestamp);
-    manager->addGroup(userId, params);
     manager->addGroup(userId, NotificationParameters());
+    manager->addGroup(userId, params);
 
     QCOMPARE(spy.count(), 2);
 
-    // First notification has timestamp in NotificationParameters
+    // First notification has no timestamp in NotificationParameters,
+    // so no timestamp is set for the group
     QList<QVariant> arguments = spy.takeFirst();
     NotificationParameters notificationParams = 
qvariant_cast<NotificationParameters>(arguments.at(1));
-    QCOMPARE(notificationParams.value(TIMESTAMP).toUInt(), timestamp);
+    QCOMPARE(notificationParams.value(TIMESTAMP).toUInt(), (uint)0);
 
-    // Second notification has a zero timestamp in NotificationParameters,
-    // so current time is used as a timestamp
+    // Second notification has a timestamp in NotificationParameters
     arguments = spy.takeFirst();
     notificationParams = 
qvariant_cast<NotificationParameters>(arguments.at(1));
-    QCOMPARE(notificationParams.value(TIMESTAMP).toUInt(), qDateTimeToTime_t);
+    QCOMPARE(notificationParams.value(TIMESTAMP).toUInt(), timestamp);
 }
 
 void 
Ut_NotificationManager::testThatTimestampOfGroupIsUpdatedWhenGroupIsUpdated()
 {
-    QSignalSpy spy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters&)));
-
     uint timestamp = 12345678;
     qDateTimeToTime_t = 123;
 
     uint groupId = manager->addGroup(0, NotificationParameters());
 
+    QSignalSpy spy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters&)));
+
+    manager->updateGroup(0, groupId, NotificationParameters());
+
     NotificationParameters params;
     params.add(TIMESTAMP, timestamp);
     manager->updateGroup(0, groupId, params);
 
     QCOMPARE(spy.count(), 2);
 
+    // First update has no timestamp in NotificationParameters,
+    // so no timestamp is updated for the group
     QList<QVariant> arguments = spy.takeFirst();
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 (uint)0);
     QCOMPARE(arguments.at(0).toUInt(), groupId);
 
+    // Second update has a timestamp in NotificationParameters
     arguments = spy.takeFirst();
     
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 timestamp);
     QCOMPARE(arguments.at(0).toUInt(), groupId);
 }
 
+void Ut_NotificationManager::testAddNotificationToGroupWithTimestamp()
+{
+    uint timestamp = 12345678;
+
+    uint groupId = manager->addGroup(0, NotificationParameters());
+
+    QSignalSpy groupSpy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters &)));
+
+    NotificationParameters parameters0;
+    parameters0.add(TIMESTAMP, timestamp);
+    manager->addNotification(0, parameters0, groupId);
+
+    QCOMPARE(groupSpy.count(), 1);
+    QList<QVariant> arguments = groupSpy.takeFirst();
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 timestamp);
+    QCOMPARE(arguments.at(0).toUInt(), groupId);
+}
+
+void 
Ut_NotificationManager::testUpdateGroupTimestampWhenNewerNotificationAddedToGroup()
+{
+    uint groupId = manager->addGroup(0, NotificationParameters());
+
+    NotificationParameters parameters0;
+    uint olderTimestamp = 123;
+    parameters0.add(TIMESTAMP, olderTimestamp);
+    manager->addNotification(0, parameters0, groupId);
+
+    QSignalSpy groupSpy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters &)));
+
+    NotificationParameters parameters1;
+    uint newerTimestamp = 123456;
+    parameters1.add(TIMESTAMP, newerTimestamp);
+    manager->addNotification(0, parameters1, groupId);
+
+    QCOMPARE(groupSpy.count(), 1);
+    QList<QVariant> arguments = groupSpy.takeFirst();
+    QCOMPARE(arguments.at(0).toUInt(), groupId);
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 newerTimestamp);
+}
+
+void 
Ut_NotificationManager::testNotUpdatingGroupTimestampWhenAddingNotificationsWithOlderTimestamp()
+{
+    uint groupId = manager->addGroup(0, NotificationParameters());
+
+    QSignalSpy groupSpy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters &)));
+
+    NotificationParameters parameters0;
+    const uint mostLatestNotificationTimestamp = 123456;
+    parameters0.add(TIMESTAMP, mostLatestNotificationTimestamp);
+    manager->addNotification(0, parameters0, groupId);
+
+    // Add a notification with an older timestamp
+    NotificationParameters parameters1;
+    const uint olderTimestamp = 123;
+    parameters1.add(TIMESTAMP, olderTimestamp);
+    manager->addNotification(0, parameters1, groupId);
+
+    QCOMPARE(groupSpy.count(), 1);
+    QList<QVariant> arguments = groupSpy.takeFirst();
+    QCOMPARE(arguments.at(0).toUInt(), groupId);
+    // Verify that the latest timestamp is still the only one updated to the 
group
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 mostLatestNotificationTimestamp);
+}
+
+void 
Ut_NotificationManager::testNotUpdatingGroupTimestampWhenUpdatingNotificationsWithOlderTimestamp()
+{
+    uint groupId = manager->addGroup(0, NotificationParameters());
+
+    QSignalSpy groupSpy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters &)));
+
+    NotificationParameters parameters0;
+    const uint mostLatestNotificationTimestamp = 123456;
+    parameters0.add(TIMESTAMP, mostLatestNotificationTimestamp);
+    manager->addNotification(0, parameters0, groupId);
+
+    uint updatedNotificationId = manager->addNotification(0, 
NotificationParameters(), groupId);
+
+    // Update notification with an older timestamp
+    NotificationParameters parameters1;
+    const uint olderTimestamp = 123;
+    parameters1.add(TIMESTAMP, olderTimestamp);
+    manager->updateNotification(0, updatedNotificationId, parameters1);
+
+    QCOMPARE(groupSpy.count(), 1);
+    QList<QVariant> arguments = groupSpy.takeFirst();
+    QCOMPARE(arguments.at(0).toUInt(), groupId);
+    // Verify that the latest timestamp is still the only one updated to the 
group
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 mostLatestNotificationTimestamp);
+}
+
+void Ut_NotificationManager::testUpdateNotificationInGroupWithTimestamp_data()
+{
+    QTest::addColumn<uint>("oldTimestamp");
+    QTest::addColumn<uint>("updatedTimestamp");
+    QTest::addColumn<uint>("expectedTimestamp");
+
+    const uint olderTimestamp = 123;
+    const uint laterTimestamp = 123456;
+
+    QTest::newRow("Timestamp updated to newer value") << olderTimestamp << 
laterTimestamp << laterTimestamp;
+    QTest::newRow("Timestamp updated to older value") << laterTimestamp << 
olderTimestamp << olderTimestamp;
+}
+
+void Ut_NotificationManager::testUpdateNotificationInGroupWithTimestamp()
+{
+    QFETCH(uint, oldTimestamp);
+    QFETCH(uint, updatedTimestamp);
+    QFETCH(uint, expectedTimestamp);
+
+    uint groupId = manager->addGroup(0, NotificationParameters());
+
+    NotificationParameters parameters0;
+    parameters0.add(TIMESTAMP, oldTimestamp);
+    uint notificationId = manager->addNotification(0, parameters0, groupId);
+
+    QSignalSpy groupSpy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters &)));
+
+    parameters0.add(TIMESTAMP, updatedTimestamp);
+    manager->updateNotification(0, notificationId, parameters0);
+
+    QCOMPARE(groupSpy.count(), 1);
+    QList<QVariant> arguments = groupSpy.takeFirst();
+    QCOMPARE(arguments.at(0).toUInt(), groupId);
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 expectedTimestamp);
+}
+
+void 
Ut_NotificationManager::testUpdatingGroupTimestampWhenRemovingNotifications()
+{
+    uint groupId = manager->addGroup(0, NotificationParameters());
+
+    NotificationParameters parameters0;
+    uint timestampNotification0 = 123;
+    parameters0.add(TIMESTAMP, timestampNotification0);
+    manager->addNotification(0, parameters0, groupId);
+
+    NotificationParameters parameters1;
+    uint timestampNotification1 = 123456;
+    parameters1.add(TIMESTAMP, timestampNotification1);
+    uint notificationId1 = manager->addNotification(0, parameters1, groupId);
+
+    QSignalSpy groupSpy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters &)));
+
+    manager->removeNotification(notificationId1);
+
+    QCOMPARE(groupSpy.count(), 1);
+    QList<QVariant> arguments = groupSpy.takeFirst();
+    QCOMPARE(arguments.at(0).toUInt(), groupId);
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 timestampNotification0);
+}
+
+void Ut_NotificationManager:: testUpdatingGroupTimestampWhenGroupIsCleared()
+{
+    uint groupId = manager->addGroup(0, NotificationParameters());
+
+    NotificationParameters parameters0;
+    uint timestampNotification0 = 123;
+    parameters0.add(TIMESTAMP, timestampNotification0);
+    manager->addNotification(0, parameters0, groupId);
+
+    NotificationParameters parameters1;
+    uint timestampNotification1 = 123456;
+    parameters1.add(TIMESTAMP, timestampNotification1);
+    manager->addNotification(0, parameters1, groupId);
+
+    QSignalSpy groupSpy(manager, SIGNAL(groupUpdated(uint, const 
NotificationParameters &)));
+
+    manager->removeNotificationsInGroup(groupId);
+
+    QCOMPARE(groupSpy.count(), 1);
+    QList<QVariant> arguments = groupSpy.takeLast();
+    
QCOMPARE(qvariant_cast<NotificationParameters>(arguments.at(1)).value(TIMESTAMP).toUInt(),
 (uint)0);
+    QCOMPARE(arguments.at(0).toUInt(), groupId);
+}
+
 QTEST_MAIN(Ut_NotificationManager)
--- tests/ut_notificationmanager/ut_notificationmanager.h
+++ tests/ut_notificationmanager/ut_notificationmanager.h
@@ -133,7 +133,7 @@
     // Test that the group info is restored from the persistent storage
     void testGroupInfoRestoration();
     // Test that the persistent notifications are saved to the persistent 
storage
-    void tesNotificationStorage();
+    void testNotificationStorage();
     // Test that the persistent notifications are restored from the persistent 
storage
     void testNotificationRestoration();
     // Test the removal of notifications based on event type
@@ -162,9 +162,17 @@
     // Test that timestamp of notification is updated
     void testThatTimestampOfNotificationIsUpdatedWhenNotificationUpdates();
     // Test adding group with and without user specified timestamp
-    void testAddGroupWithAndWithoutTimestamp();
+    void testAddGroupWithoutAndWithTimestamp();
     // Test that timestamp of group is updated when group is updated
     void testThatTimestampOfGroupIsUpdatedWhenGroupIsUpdated();
+    void testAddNotificationToGroupWithTimestamp();
+    void testUpdateGroupTimestampWhenNewerNotificationAddedToGroup();
+    void 
testNotUpdatingGroupTimestampWhenAddingNotificationsWithOlderTimestamp();
+    void 
testNotUpdatingGroupTimestampWhenUpdatingNotificationsWithOlderTimestamp();
+    void testUpdateNotificationInGroupWithTimestamp_data();
+    void testUpdateNotificationInGroupWithTimestamp();
+    void testUpdatingGroupTimestampWhenRemovingNotifications();
+    void testUpdatingGroupTimestampWhenGroupIsCleared();
 };
 
 #endif // UT_NOTIFICATIONMANAGER_H
--- tests/ut_statusindicator/ut_statusindicator.cpp
+++ tests/ut_statusindicator/ut_statusindicator.cpp
@@ -765,15 +765,25 @@
     QVERIFY(m_subject->styleName().indexOf("Set") >= 0);
 }
 
+void Ut_StatusIndicator::testProfile_data()
+{
+    QTest::addColumn<QString>("profileName");
+    QTest::addColumn<QString>("styleName");
+
+    QTest::newRow("Default") << QString("default") << 
QString("ProfileStatusIndicator");
+    QTest::newRow("Silent") << QString("silent") << 
QString("ProfileStatusIndicatorSilent");
+    QTest::newRow("Meeting (Beep)") << QString("meeting") << 
QString("ProfileStatusIndicatorBeep");
+}
+
 void Ut_StatusIndicator::testProfile()
 {
-    m_subject = new ProfileStatusIndicator(*testContext);
+    QFETCH(QString, profileName);
+    QFETCH(QString, styleName);
 
-    testContextItems["Profile.Name"]->setValue(QVariant("silent"));
-    QVERIFY(m_subject->styleName().indexOf("Silent") >= 0);
+    m_subject = new ProfileStatusIndicator(*testContext);
 
-    testContextItems["Profile.Name"]->setValue(QVariant("default"));
-    QVERIFY(m_subject->styleName().indexOf("Silent") < 0);
+    testContextItems["Profile.Name"]->setValue(profileName);
+    QCOMPARE(m_subject->styleName(), styleName);
 }
 
 void Ut_StatusIndicator::testGPS()
--- tests/ut_statusindicator/ut_statusindicator.h
+++ tests/ut_statusindicator/ut_statusindicator.h
@@ -72,6 +72,7 @@
     void testCall_data();
     void testCall();
     void testTethering();
+    void testProfile_data();
     void testProfile();
     void testGPS();
     void testTransferStatusIndicatorDBusConnectionCreationInConstructor();
--- themes/style/statusarea.css
+++ themes/style/statusarea.css
@@ -611,6 +611,14 @@
     maximum-size: -1 -1;
 }
 
+StatusIndicatorIconStyle#ProfileStatusIndicatorBeep {
+    /* The list of IDs of the images to be shown in the status indicator 
separated by spaces */
+    image-list: "icon-s-status-beep";
+    preferred-size: -1 -1;
+    minimum-size: -1 -1;
+    maximum-size: -1 -1;
+}
+
 /* "Offline" presence, no indicator */
 StatusIndicatorIconStyle#PresenceStatusIndicator {
     /* The list of IDs of the images to be shown in the status indicator 
separated by spaces */

++++++ meegotouch-systemui.yaml
--- meegotouch-systemui.yaml
+++ meegotouch-systemui.yaml
@@ -1,12 +1,12 @@
 Name: meegotouch-systemui
 Summary: System UI daemon
-Version: 1.2.24
+Version: 1.3.2
 Release: 1
 Group: System/Desktop
 License: LGPLv2.1
 URL: http://meego.gitorious.org/meegotouch/meegotouch-systemui
 Sources:
-    - "meegotouch-%{name}-%{version}-2.tar.gz"
+    - "meegotouch-%{name}-%{version}-1.tar.gz"
     - "boss.conf"
 ExtraSources:
     - meegotouch-systemui.desktop;%{_sysconfdir}/xdg/autostart
@@ -31,6 +31,7 @@
     This package contains the system UI daemon.
 PkgBR:
     - expat-devel
+    - desktop-file-utils
 PkgConfigBR:
     - libpulse
     - QtGui
@@ -49,17 +50,11 @@
     - xext
     - xdamage
 Requires:
-    - "%{name}-screenlock-padlock"
-    - "%{name}-volume-fullscreen"
     # Needed for status indicator, e.g., wifi, 3g.
     - contextkit-meego
-Provides:
-    - duistatusindicatormenu > 0.18.1
-    - systemui > 0.1
-Obsoletes:
-    - duistatusindicatormenu <= 0.18.1
-    - systemui <= 0.1
-    - meegotouch-systemui <= 0.20.38
+# HACK PLEASE REMOVE.
+# NoDesktop is here because of bug in spectacle 0.24
+NoDesktop: True
 Configure: none
 Builder: qmake
 RunFdupes:
@@ -107,7 +102,6 @@
           - 
"%{_datadir}/themes/base/meegotouch/libsysuid-volume/libsysuid-volume.conf"
           - 
"%{_datadir}/themes/base/meegotouch/libsysuid-volume/style/libsysuid-volume.css"
 
-
     - Name: meegotouchcp-privatemodeapplet
       AsWholeName: yes
       Summary: Private mode control panel applet



Reply via email to