Use String to store UDS_USER and UDS_GROUP of String type.
ClosedPublic

Authored by jtamate on Sep 21 2018, 7:43 AM.

Details

Summary

First crash I get after enabling Dr. Konqi for slaves.
UDS_USER and UDS_GROUP are strings, not numbers, therefore I've got an assert (simplified):
"udsField & KIO::UDSEntry::UDS_NUMBER", "udsentry.cpp", line=line@entry=113)

Use the same methods to get those data as in file.

BUG:398867

Test Plan

Search an obvious file in $HOME, it is shown.

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jtamate created this revision.Sep 21 2018, 7:43 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptSep 21 2018, 7:43 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
jtamate requested review of this revision.Sep 21 2018, 7:43 AM

Fine in general, file KIO caches the username and groupname to avoud KUser having to query it every time. It also uses the uid as string if loginName is empty (if that can ever happen..?)

jtamate updated this revision to Diff 42033.Sep 21 2018, 8:12 AM
jtamate retitled this revision from Use String to store UDS_USER and UDS_GROUP de tipo String to Use String to store UDS_USER and UDS_GROUP of String type, use fastInsert..
jtamate edited the summary of this revision. (Show Details)

White at it, use fastInsert.
And this also fixes the search in the home directory :-).
The title in English :-).

The question of the caching of the KUser usage remains, though.

I also would prefer to do the fastInsert change separately as to not clutter the diff

jtamate updated this revision to Diff 42044.Sep 21 2018, 10:18 AM
jtamate retitled this revision from Use String to store UDS_USER and UDS_GROUP of String type, use fastInsert. to Use String to store UDS_USER and UDS_GROUP of String type..
jtamate edited the summary of this revision. (Show Details)
jtamate edited the test plan for this revision. (Show Details)

Copy the methods getUserName and getGroupName from kfile, those are cached, should be faster.
Keep the fastInsert for another revision.

ngraham accepted this revision.Sep 24 2018, 10:39 PM
ngraham added a subscriber: ngraham.

Code looks better and I can verify that it fixes the bug. Feels a bit faster, too. Maybe wait for a final review from @broulik or someone in Frameworks though before landing.

This revision is now accepted and ready to land.Sep 24 2018, 10:39 PM
dfaure accepted this revision.Sep 25 2018, 6:49 AM
This revision was automatically updated to reflect the committed changes.