Ensure to store resource uri without a trailing slash
ClosedPublic

Authored by meven on Jan 4 2020, 11:30 AM.

Details

Summary

Some apps may send resource such as

/home/me/Documents/

When others, can send the uri without the trailing slash

/home/me/Documents

This prevents matching of URI in requests.
And the trailing slash prevents KFileItem build from resources to have a proper filename

Diff Detail

Repository
R6 KActivities
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20607
Build 20625: arc lint + arc unit
meven created this revision.Jan 4 2020, 11:30 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 4 2020, 11:30 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
meven requested review of this revision.Jan 4 2020, 11:30 AM
meven updated this revision to Diff 72734.Jan 4 2020, 11:32 AM

Add ResourceInstance::setUri case

meven edited the summary of this revision. (Show Details)Jan 5 2020, 12:49 PM
ivan accepted this revision.Jan 6 2020, 10:06 AM

TBH, I'd like more to have dirs always end with a slash, but I guess this is fine as well.

This revision is now accepted and ready to land.Jan 6 2020, 10:06 AM
meven added a comment.Jan 6 2020, 10:18 AM
In D26415#588501, @ivan wrote:

TBH, I'd like more to have dirs always end with a slash, but I guess this is fine as well.

The sqlite database is not used direcly by users so we don't need to have a denominator when the path is a directory like an ending /.
The most important thing is data consolidation : some apps may send url with / while others don't, but anyway for the sake of our users we need to have only one format saved so they don't have to play the guess game or not handle it like most Kicker does currently.
The first thing all user of KActivityStat does is stating the file resource anyway and they should.
I will land this soonish.

And btw I am adding a KRunner runner for KActivityStats D26111
Another steps towards better kactivity data integration.
Regarding this, I will probably implement some sort of fuzzy search for filename in KActivitiesStats' Terms for this use case.

This revision was automatically updated to reflect the committed changes.