Bug 233518 - knotes loads every note twice on startup
Summary: knotes loads every note twice on startup
Status: RESOLVED WORKSFORME
Alias: None
Product: knotes
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Unspecified
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-06 18:13 UTC by Matthias Heinz
Modified: 2010-05-02 00:18 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 Matthias Heinz 2010-04-06 18:13:32 UTC
Version:            (using KDE 4.4.2)
Installed from:    Debian testing/unstable Packages

Hi,

since kde 4.3 (I'm note sure it wasn't also in 4.2, too) knotes loads every note twice at startup.

I did some debugging and think that this must have something to do with kressources, but this is where I couldn't get any further.

In resourcemanager.cpp line 44  there's:
   m_manager = new KRES::Manager<ResourceNotes>( "notes" );

well, this lets knotes print a warning:
<unknown program name>(14804)/ main: Unknown resource type:  "notes" 

if i change "notes" to "note" I get:
<unknown program name>(14635)/ main: Unknown resource type:  "note"
so it should be related to this. (When changing to "note" all notes are only loaded one time... but this is more like fixing a bug with a bug...)


Anyway, line 65, in the for-loop, there seems to be two ressource with the name "Notes":

knotes(14802) KNotesResourceManager::load: "Opening resource Notes"
knotes(14802) KNotesResourceManager::load: "Opening resource Notes"


Well, looks like a ResourceManager bug. Somehow it opens the notes.ics twice (well, at least it returns it twice...)


Hopefully this is enough info to fix this.


Best regards,
Matthias
Comment 1 Matthias Heinz 2010-04-07 17:48:27 UTC
I played a bit further. It looks like this behaviour only appears when there is more than one note. With just one note just this one gets one time loaded. Having two or more results in loading every note twice.
Comment 2 Matthias Heinz 2010-04-09 11:06:53 UTC
Ok, this is definitely a bug in kresources.

I talked about the problem that kresources seems to load "note" and "notes". So i took a look at ~/.kde/share/config/kresources/ and found there two directories. One name "note" and one named "notes". Deleting both results in a correct behaviour of knotes.

BUT why does kresource try to load something from "note"? This doesn't make any sense, because - as i mentioned before - the source code tells it to load just "notes" and nothing else.

It looks to me that there is something wrong in kresources. Maybe a string match, which returns true, even if it's just a partial match.
Comment 3 Matthias Heinz 2010-05-02 00:18:22 UTC
I still can't figure out why this was happening.

But I can't reproduce it here anymore, too... therefore I'm closing this bug.