Bug 68127 - Restoring session opens a deleted note on the desktop
Summary: Restoring session opens a deleted note on the desktop
Status: RESOLVED FIXED
Alias: None
Product: knotes
Classification: Applications
Component: general (show other bugs)
Version: 3.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Brade
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-13 16:08 UTC by Pat Double
Modified: 2004-12-13 14:23 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pat Double 2003-11-13 16:08:37 UTC
Version:           3.0 (using KDE KDE 3.1.93)
Installed from:    Gentoo Packages
Compiler:          gcc 3.3.2 
OS:          Linux

I have KNotes started with a tray icon. When I first started it an initial note was created. I didn't need it so I deleted it. Each time I login I see the same note I deleted and I delete it again. It comes back when I login again. The date on the note is the same as the first initial note when I started KNotes days ago.

Expected behavior:
1. If I delete a note it should be deleted. 
2. If I have no notes on my desktop when I logout, I don't want any when I login again.

This all may be related to the fact that I have no notes in KNotes.
Comment 1 Andy Neitzke 2004-01-08 16:00:53 UTC
I am getting similar behavior, with Mandrake packages from KDE 3.1.94.  I didn't have an "initial note" as the reporter describes, but one day I decided to create two notes on which I typed some text.  A few days later I didn't want them anymore, so I deleted them.  They disappeared from my desktop, as  expected, but they reappeared the next time I logged in, and now I have to delete them every time I log in.
Comment 2 Pat Double 2004-01-08 16:11:35 UTC
This appears to have been fixed with 3.2 beta 2.
Comment 3 Andy Neitzke 2004-01-08 19:14:31 UTC
Confirmed, an upgrade to the latest CVS cured it.
Comment 4 Pat Double 2004-01-23 15:27:47 UTC
This bug appears to be back with 3.2 rc 1.
Comment 5 Michael Brade 2004-03-09 17:07:18 UTC
CVS commit by brade: 

Laurent, your commit did not only introduce a memory leak but also caused
#68127 -- notes were not really deleted if deleting was the last
action before quitting KNotes since the destructors were not called. I
will add some more safety checks though.

CCMAIL: 68127-done@bugs.kde.org


  M +12 -3     ChangeLog   1.59
  M +9 -4      main.cpp   1.23
  M +1 -0      main.h   1.3


--- kdepim/knotes/main.h  #1.2:1.3
@@ -32,4 +32,5 @@ class Application : public KUniqueApplic
   public:
     Application();
+    ~Application();
 
     virtual int newInstance();

--- kdepim/knotes/main.cpp  #1.22:1.23
@@ -32,8 +32,14 @@
 using namespace std;
 
-Application::Application() : KUniqueApplication(), mMainWindow( 0 )
+Application::Application()
+    : KUniqueApplication(), mMainWindow( 0 )
 {
 }
 
+Application::~Application()
+{
+    delete mMainWindow;
+}
+
 int Application::newInstance()
 {
@@ -44,7 +50,6 @@ int Application::newInstance()
     }
     else
-    {
-        mMainWindow->newNote( );
-    }
+        mMainWindow->newNote();
+
     return KUniqueApplication::newInstance();
 }

--- kdepim/knotes/ChangeLog  #1.58:1.59
@@ -2,9 +2,18 @@
 ====================
 
+2004/03/09  Michael Brade <brade@kde.org>
+
+    * fixed #68127: notes are not really deleted if deleting is the last
+      action before quitting KNotes
+
+2004/03/08  Michael Brade <brade@kde.org>
+
+    * new version: 3.1
+
 2004/03/06  Michael Brade <brade@kde.org>
 
-    * fixed 72818: add a tooltip
-    * fixed 74469: RMB menu locks whole desktop if opened on a modified note
-    * fixed 75507, 76126: handle (load) tabs correctly, fix in libical
+    * fixed #72818: add a tooltip
+    * fixed #74469: RMB menu locks whole desktop if opened on a modified note
+    * fixed #75507, #76126: handle (load) tabs correctly, fix in libical
     * removed hack for the fix for #57367
 


Comment 6 Earl Azarov 2004-12-13 14:23:14 UTC
I have this problem in KNotes 3.3, using KDE 3.3.1-4.1.2.kde, 
gcc-3.3.3-7 on FC2.
My config is:
/.kde/share/apps/knotes/notes.ics and 
/.kde/share/apps/knotes/notes directory
Few records from notes.ics pop up on the screen every time I start Knotes.
The records I deleted before using Knotes rather then using Kontact Notes.

Vladimir