Removed reading description from .desktop files AND .directory files
AcceptedPublic

Authored by count on Dec 31 2019, 2:37 PM.

Details

Reviewers
broulik
dfaure
ngraham
Group Reviewers
Frameworks
Dolphin
Summary

For https://bugs.kde.org/show_bug.cgi?id=382325 i've removed reading comments inside desktop files.

BUG: 382325

So, my change was made because the file type column in Dolphin shows the comment field inside .desktop file instead of the real file type "Desktop configuration file" (and that's for .directory files too).

Test Plan

Create a new .desktop file with the following content:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/path/to/executable
Name=Name of Application
Icon=/path/to/icon
Comment=Enter lala land

In the type column the file type is shown as "Enter lala land" but should be something like "Desktop configuration file"

Diff Detail

Repository
R241 KIO
Lint
Lint Skipped
Unit
Unit Tests Skipped
count created this revision.Dec 31 2019, 2:37 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 31 2019, 2:37 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
count requested review of this revision.Dec 31 2019, 2:37 PM
count added a reviewer: broulik.
ngraham edited the summary of this revision. (Show Details)Dec 31 2019, 3:45 PM
ngraham added reviewers: Frameworks, Dolphin.
ngraham added a subscriber: ngraham.

It would be helpful if you could update the description to mention why this change is being made and when benefit comes from not reading desktop files' comment fields.

Also, updating the Test Plan section with details of your testing would be nice. :)

count edited the summary of this revision. (Show Details)Jan 1 2020, 9:27 AM
count edited the test plan for this revision. (Show Details)
dfaure accepted this revision.Jan 2 2020, 8:41 AM

I looked into the git/svn history and this actually is from before my time (lol), and a remnant of the fact that in the initial design by Torben, desktop files were a kmimetype-subclass which reimplemented a virtual method to read the description from the desktop file. I don't think there was any real thought being that, more of an object-orientation accident. I'm fine with this going away.

This revision is now accepted and ready to land.Jan 2 2020, 8:41 AM
ngraham accepted this revision.Jan 2 2020, 6:07 PM

Can you please provide your name and email address so we can land this patch with the correct authorship information?

What about the directory Comment "feature" a few lines below? It is equally as questionable and causes significant slowdowns when browsing folders on nfs mounts, cf. D13757

count added a comment.Jan 3 2020, 7:47 AM

What about the directory Comment "feature" a few lines below? It is equally as questionable and causes significant slowdowns when browsing folders on nfs mounts, cf. D13757

I thought, the !d->isSlow() would skip that part for (fsType == KFileSystemType::Nfs || fsType == KFileSystemType::Smb) as seen in kfileitem.cpp:763. So I would leave that here.

dfaure added a comment.Jan 3 2020, 8:39 AM

Also, I see a lot more use cases for showing the comment from .directory files.
I could imagine setting up a computer for an inexperienced user, and adding .directory files to document what some directories are about.

I thought, the !d->isSlow() would skip that part for (fsType == KFileSystemType::Nfs || fsType == KFileSystemType::Smb) as seen in kfileitem.cpp:763. So I would leave that here.

The is slow check itself blocks...

I could imagine setting up a computer for an inexperienced user

Do you know anyone doing this? Oh if only we had some telemetry :)
I doubt naming a folder "Technobabble" and then adding a helpful comment "This is where your cat pictures go" is very useful to the inexperienced user

I doubt naming a folder "Technobabble" and then adding a helpful comment "This is where your cat pictures go" is very useful to the inexperienced user

100% agree

dfaure added a comment.Jan 3 2020, 9:59 PM

I don't understand this line of argumentation. Are you saying that all documentation in the world is useless?

You're setting up a computer for a new employee, with a whole lot of folders. Having some room to document "inline" the purpose of some folders sounds useful, doesn't it? (even more so with the translation support, but even without). You do that in .directory files which are part of the checkout and it's even directly useful for the next employee :)

What's missing however is that there's no GUI for setting those, one has to know about the hidden .directory feature (right?).

On the other hand I see that the dolphin GUI has an editable "Comment" on the right side, unfortunately it doesn't show in the treeview even after enabling the "Comments" column (bug?). And that's local, so not reusable for another user.

Having been a sysadmin setting up computers for new users, let me tell you that there is a 0% chance that I would use this feature. I would (and did, and have) *by far* prefer to document anything slightly confusing using an internal company-wide knowledge-base or wiki. That way I could actually point users to the explanation accessible in a web browser in a page I could send people the link to, and I could refine the documentation myself over time effortlessly.

Besides, this feature has no UI to discover it, so I would wager that approximately 0 people are actually using it. Of course, yes, if there was any telemetry, this wouldn't have to be a guess. :)

dfaure added a comment.Jan 4 2020, 9:10 AM

OK, remove it. The other feature (kfilemetadata?) should be fixed though....

bruns added a subscriber: bruns.Jan 4 2020, 7:30 PM

On the other hand I see that the dolphin GUI has an editable "Comment" on the right side, unfortunately it doesn't show in the treeview even after enabling the "Comments" column (bug?). And that's local, so not reusable for another user.

The comment uses extended attributes, so at least for nfs it should work over network, not sure about cifs.

For me, the comment is shown in the sidebar and in the column.

unfortunately it doesn't show in the treeview even after enabling the "Comments" column (bug?)

Works here.


I think it doesn't update the view live when the comment changes

count added a comment.Jan 5 2020, 9:13 AM

Ok, I've played a little around, and imho we should remove the support for .directory file comments too:

Here you see, the type column is read from the comment field inside the .directory file

[Desktop Entry]
Name=Neue Menükategorie
Comment=Blabla from .directory file
Icon=passendes_Symbol
Type=Directory

And here is the independent comment metadata

Makes sense to me, following the same logic.

count updated this revision to Diff 72803.Jan 5 2020, 4:12 PM
count retitled this revision from Removed reading description from desktop files to Removed reading description from .desktop files AND .directory files.

I think you lost the original diff with the latest update to this patch.

count set the repository for this revision to R241 KIO.Jan 5 2020, 4:26 PM
count updated this revision to Diff 72807.Jan 5 2020, 4:35 PM

added removing of .directory files reading

ngraham accepted this revision.Jan 5 2020, 5:07 PM

Everybody good with this?

dfaure accepted this revision.Jan 5 2020, 5:27 PM

Thanks! @count, can you provide us with your full name and email address so we can land this patch with accurate authorship information?

count added a comment.Jan 5 2020, 6:36 PM

Thanks! @count, can you provide us with your full name and email address so we can land this patch with accurate authorship information?

It's count negative
count(dot)negative(at)gmx(dot)de

Thanks! @count, can you provide us with your full name and email address so we can land this patch with accurate authorship information?

It's count negative
count(dot)negative(at)gmx(dot)de

If "Count Negative" is a pseudonym, please first submit a patch to https://cgit.kde.org/kde-dev-scripts.git/ that grants permission to relicense your commits should it ever become necessary and we can't contact you because opf the pseudonym. See the other commits in that repo for examples of what to submit. Once you've submitted the patch, link to it here.

Thanks!