--- a/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Tue Oct 05 14:14:48 2010 +0530
+++ b/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Fri Oct 15 12:10:36 2010 +0530
@@ -39,6 +39,7 @@
#include <xqsettingskey.h>
#include <QLocale>
#include <HbParameterLengthLimiter>
+#include <HbApplication>
// User includes
#include "clockprivatecrkeys.h"
@@ -84,6 +85,7 @@
mStartOfWeek(0),
mAlarmDayItemInserted(false),
mIsQuickAlarm(true),
+ mForcedExit(false),
mAlarmEditorForm(0),
mAlarmEditorModel(0),
mAlarmTimeItem(0),
@@ -208,6 +210,10 @@
HbMainWindow *window = hbInstance->allMainWindows().first();
window->addView(mAlarmEditorView);
window->setCurrentView(mAlarmEditorView);
+ //if editor is open in background, and user close the app from task switcher
+ //entry should get saved
+ connect(qobject_cast<HbApplication*>(qApp), SIGNAL(aboutToQuit()),
+ this, SLOT(forcedExit()));
OstTraceFunctionExit0( CLOCKALARMEDITOR_SHOWALARMEDITOR_EXIT );
}
@@ -239,8 +245,9 @@
mAlarmDayItemInserted = false;
emit alarmSet();
-
- closeAlarmEditor();
+ if(!mForcedExit){
+ closeAlarmEditor();
+ }
OstTraceFunctionExit0( CLOCKALARMEDITOR_HANDLEDONEACTION_EXIT );
}
@@ -758,15 +765,17 @@
// Check if DST rule gets applied in 24hrs.
displayDSTRolloverNote = mTimezoneClient->checkForDstChange(alarmInfo);
- if (displayDSTRolloverNote) {
- // display DST rollover note
- displayDSTRollOverNote(alarmInfo);
+ //don't display any note if forced exit
+ if(!mForcedExit){
+ if (displayDSTRolloverNote) {
+ // display DST rollover note
+ displayDSTRollOverNote(alarmInfo);
+ }
+ else {
+ // display remaining time note
+ displayRemainingTimeNote(alarmInfo);
+ }
}
- else {
- // display remaining time note
- displayRemainingTimeNote(alarmInfo);
- }
-
// Save previous alarm time.
setPreviosAlarmTime(alarmTime);
OstTraceFunctionExit0( CLOCKALARMEDITOR_SETALARM_EXIT );
@@ -1073,4 +1082,17 @@
}
OstTraceFunctionExit0( CLOCKALARMEDITOR_SORTALARMDAYSLIST_EXIT );
}
+
+
+/*!
+ * slot calls if app closed from task switcher or red key.
+ * saved the created entry
+ */
+void ClockAlarmEditor::forcedExit()
+{
+ OstTraceFunctionEntry0( CLOCKALARMEDITOR_FORCEDEXIT_ENTRY );
+ mForcedExit = true;
+ handleDoneAction();
+ OstTraceFunctionExit0( CLOCKALARMEDITOR_FORCEDEXIT_EXIT );
+}
// End of file --Don't remove this.