notes/notesui/noteseditor/src/noteseditor_p.cpp
changeset 83 5aadd1120515
parent 57 bb2d3e476f29
--- a/notes/notesui/noteseditor/src/noteseditor_p.cpp	Tue Oct 05 14:14:48 2010 +0530
+++ b/notes/notesui/noteseditor/src/noteseditor_p.cpp	Fri Oct 15 12:10:36 2010 +0530
@@ -502,11 +502,11 @@
 		if (mNewEntry) {
 			if (AgendaEntry::TypeNote == mModifiedNote.type()) {
 				mModifiedNote.setDescription(description);
-				mModifiedNote.setLastModifiedDateTime(
-						QDateTime(QDate::currentDate(), QTime::currentTime()));
 				// Set the creation time as DTStamp time
-				mModifiedNote.setDTStamp(
-						QDateTime(QDate::currentDate(), QTime::currentTime()));
+				QDateTime currDateTime = QDateTime::currentDateTime();
+				mModifiedNote.setDTStamp(currDateTime);
+				// Set the same for last modified date as well
+				mModifiedNote.setLastModifiedDateTime(currDateTime);
 			} else if (AgendaEntry::TypeTodo == mModifiedNote.type()) {
 				mModifiedNote.setSummary(description);
 				mModifiedNote.setDescription(description);
@@ -516,9 +516,11 @@
 			}
 			// Now save the entry.
 			mNoteId = mAgendaUtil->store(mModifiedNote);
-			if (mNoteId) {
+	         //if application exit from task switcher or red key
+	            //don't show any notfication
+			if (mNoteId && !mNoteEditor->mForcedExit) {
 				showNotification(
-						hbTrId("txt_notes_dpopinfo_new_note_saved"));
+						hbTrId("txt_notes_dpopinfo_note_saved"));
 			}
 		} else {
 			if (mOriginalNote.type() != mModifiedNote.type()) {
@@ -537,12 +539,13 @@
 				}
 			} else {
 				mModifiedNote.setDescription(description);
-				mModifiedNote.setLastModifiedDateTime(
-						QDateTime(QDate::currentDate(), QTime::currentTime()));
+				mModifiedNote.setLastModifiedDateTime(QDateTime::currentDateTime());
 
 				if (isNoteEdited()) {
 					ulong updateStatus = mAgendaUtil->store(mModifiedNote);
-					if (updateStatus) {
+		            //if application exit from task switcher or red key
+		            //don't show any notfication
+					if (updateStatus && !mNoteEditor->mForcedExit ) {
 						showNotification(
 								hbTrId("txt_notes_dpopinfo_note_saved"));
 					}
@@ -577,10 +580,12 @@
 		if (isTodoEdited()) {
 			// Add the new to-do.
 			mNoteId = mAgendaUtil->store(mModifiedNote);
-			if (mNoteId) {
+			//if application exit from task switcher or red key
+			//don't show any notfication
+			if (mNoteId && !mTodoEditor->mForcedExit) {
 				status = true;
 				showNotification(
-						hbTrId("txt_notes_dpopinfo_new_todo_note_saved"));
+						hbTrId("txt_notes_dpopinfo_note_saved"));
 			}
 		}
 	} else {
@@ -610,9 +615,11 @@
 				}
 			}
 		}
-		if (status) {
+        //if application exit from task switcher or red key
+        //don't show any notfication
+		if (status && !mTodoEditor->mForcedExit) {
 			showNotification(
-					hbTrId("txt_notes_dpopinfo_todo_note_saved"));
+					hbTrId("txt_notes_dpopinfo_note_saved"));
 		}
 	}