Bug 310525 - different behavior between Resource(ri) and Resource(nie:url)
Summary: different behavior between Resource(ri) and Resource(nie:url)
Status: RESOLVED FIXED
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: libnepomukcore (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Nepomuk Bugs Coordination
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-22 20:02 UTC by Marco Martin
Modified: 2012-11-29 10:22 UTC (History)
1 user (show)

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 Marco Martin 2012-11-22 20:02:32 UTC
I encountered a pretty strange behavior, that seems to happen only in nepomuk2:
if i create a Nepomuk2 resource using the nepomuk uri in the ctor, or its url (in the case of a file resource) seem that the two resources have a slightly different behavior (even tough they have the same uri())

so the line
activityResource.addIsRelated(Nepomuk2::Resource(nepomukUri));
works correctly (where nepomukUri is the usual nepomuk:/res/blahblah)

while
activityResource.addIsRelated(Nepomuk2::Resource(fileUrl));
doesn't work

even,
Nepomuk2::Resource r(fileUrl);
activityResource.addIsRelated(Nepomuk2::Resource(r.uri()));
works fine

this by the way breaks the context menu "link to current activity" in dolphin, so is kinda a blocker for 4.10

Reproducible: Always

Steps to Reproduce:
try addIsRelated() on two instances of the same resource created in the two different ways
Actual Results:  
only the resource created with the newpomuk uri gets correctly linked
Comment 1 Vishesh Handa 2012-11-23 10:04:09 UTC
Confirmed. Completely reproducible.

Test code -

    Resource testRes(QUrl("nepomuk:/res/49c25a0b-17fe-43f2-be67-9d6f6d268cac"));

    // Both of these are should tranlate to the same
    QUrl fileUrl("file:///home/vishesh/Music/iPod_Control/Music/F03/QGQO.mp3");
    QUrl resUri("nepomuk:/res/3fe88f05-0c80-4825-8671-e8d2e2f16f2a");

    testRes.addIsRelated( Resource(fileUrl) );
    kDebug() << testRes.properties();

A new Resource seems to have been created. This seems like a problem in the storage service. I'll take a look.
Comment 2 Marco Martin 2012-11-23 10:05:46 UTC
seems a very similar problem with duplicate tags there was a while ago? maybe related?
Comment 3 Vishesh Handa 2012-11-29 10:22:31 UTC
Had forgotten to merge KDE/4.9 into master. The fix was there in 4.9