src/hbwidgets/devicedialogs/hbdevicenotificationdialog.cpp
changeset 30 80e4d18b72f5
parent 28 b7da29130b0e
--- a/src/hbwidgets/devicedialogs/hbdevicenotificationdialog.cpp	Fri Sep 17 08:32:10 2010 +0300
+++ b/src/hbwidgets/devicedialogs/hbdevicenotificationdialog.cpp	Mon Oct 04 00:38:12 2010 +0300
@@ -160,7 +160,7 @@
     \endcode
 
 
-    \sa HbNotificationDialog, HbDeviceDialog
+    \sa HbNotificationDialog, HbDeviceDialog, CHbDeviceNotificationDialogSymbian
 */
 
 /*!
@@ -297,7 +297,7 @@
 }
 
 /*!
-    Constructor.
+    Constructs HbDeviceNotificationDialog with \a parent.
 */
 HbDeviceNotificationDialog::HbDeviceNotificationDialog(QObject *parent)
 : QObject(parent), d_ptr(new HbDeviceNotificationDialogPrivate)
@@ -313,7 +313,9 @@
 }
 
 /*!
-    Destructor.
+    Destructs HbDeviceNotificationDialog. The dialog launched by show() is closed if aboutToClose()
+    or activated() signals are connected to by an application. Otherwise the dialog is left
+    executing and closes itself by a timeout.
 */
 HbDeviceNotificationDialog::~HbDeviceNotificationDialog()
 {
@@ -331,12 +333,10 @@
 void HbDeviceNotificationDialog::notification(const QString &iconName, const QString& title)
 {
     TRACE_STATIC_ENTRY
-    HbDeviceNotificationDialog *self = new HbDeviceNotificationDialog;
-    self->setIconName(iconName);
-    self->setTitle(title);
-    self->show();
-    self->deleteLater();
-    self = 0;
+    HbDeviceNotificationDialog dialog;
+    dialog.setIconName(iconName);
+    dialog.setTitle(title);
+    dialog.show();
     TRACE_EXIT
 }
 
@@ -350,13 +350,11 @@
 void HbDeviceNotificationDialog::notification(const QString &iconName, const QString &text, const QString &title)
 {
     TRACE_STATIC_ENTRY
-    HbDeviceNotificationDialog *self = new HbDeviceNotificationDialog;
-    self->setIconName(iconName);
-    self->setText(text);
-    self->setTitle(title);
-    self->show();
-    self->deleteLater();
-    self = 0;
+    HbDeviceNotificationDialog dialog;
+    dialog.setIconName(iconName);
+    dialog.setText(text);
+    dialog.setTitle(title);
+    dialog.show();
     TRACE_EXIT
 }