From 8eb947a2239d431146de9295e281ee0163fa20e2 Mon Sep 17 00:00:00 2001 From: Niall Cooling Date: Mon, 22 Mar 2021 17:56:26 +0000 Subject: replaced all unique_ptr.reset calls with std::make_unique --- src/displayapp/screens/Notifications.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/displayapp/screens/Notifications.cpp') diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 4219bac7..c903ed0f 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -17,22 +17,22 @@ Notifications::Notifications(DisplayApp *app, auto notification = notificationManager.GetLastNotification(); if(notification.valid) { currentId = notification.id; - currentItem.reset(new NotificationItem("\nNotification", + currentItem = std::make_unique("\nNotification", notification.message.data(), notification.index, notification.category, notificationManager.NbNotifications(), mode, - alertNotificationService)); + alertNotificationService); validDisplay = true; } else { - currentItem.reset(new NotificationItem("\nNotification", + currentItem = std::make_unique("\nNotification", "No notification to display", 0, notification.category, notificationManager.NbNotifications(), Modes::Preview, - alertNotificationService)); + alertNotificationService); } if(mode == Modes::Preview) { @@ -87,13 +87,13 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { currentId = previousNotification.id; currentItem.reset(nullptr); app->SetFullRefresh(DisplayApp::FullRefreshDirections::Up); - currentItem.reset(new NotificationItem("\nNotification", + currentItem = std::make_unique("\nNotification", previousNotification.message.data(), previousNotification.index, previousNotification.category, notificationManager.NbNotifications(), mode, - alertNotificationService)); + alertNotificationService); } return true; case Pinetime::Applications::TouchEvents::SwipeDown: { @@ -109,13 +109,13 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { currentId = nextNotification.id; currentItem.reset(nullptr); app->SetFullRefresh(DisplayApp::FullRefreshDirections::Down); - currentItem.reset(new NotificationItem("\nNotification", + currentItem = std::make_unique("\nNotification", nextNotification.message.data(), nextNotification.index, nextNotification.category, notificationManager.NbNotifications(), mode, - alertNotificationService)); + alertNotificationService); } return true; case Pinetime::Applications::TouchEvents::LongTap: { -- cgit v1.2.3-70-g09d2