[dolphin] [Bug 495878] Customizing the default view settings doesn't work anymore

Méven <[email protected]>
Newsgroups gmane.comp.kde.devel.kfm
Message-ID <[email protected]/>
https://bugs.kde.org/show_bug.cgi?id=495878

--- Comment #70 from Méven <[email protected]> ---
(In reply to Iyán M. V. from comment #68)
> Some thought after reading a bit the source code. I think the issue might
> come from a bug in the logic of when to store settings, and when not. It
> should check if settings in that folder differ from the global ones, not the
> default ones from Dolphin.
> 
> These are my global settings, saved by configuring Dolphin to "use common
> display style for all folders", modifying the settings to my like (i.e.,
> details view, no previews) and then changing back to "remember display style
> for each folder"
> 
> $ getfattr -d ~/.local/share/dolphin/view_properties/global
> # file: home/iyan/.local/share/dolphin/view_properties/global
> user.kde.fm.
> viewproperties#1="[Dolphin]\012PreviewsShown=false\012Timestamp=2025,2,6,22,
> 18,9.49\012Version=4\012ViewMode=1\012"
> 
> Since PreviewsShown=false there, I would expect that any directory with
> PreviewsShown=true should store this in the filesystem attributes or in the
> .directory file. Same goes for ViewMode. It should only be stored if it
> differs from ViewMode=1.
> 
> What I noticed is that these global settings are ignored, and (I guess?)
> default's Dolphin ones are used instead. For example, if I changed
> ~/Pictures/Wallpapers to details view mode.
> 
> $ getfattr -d Pictures/Wallpapers
> user.kde.fm.
> viewproperties#1="[Dolphin]\012PreviewsShown=false\012Timestamp=2025,2,6,22,
> 48,53.577\012Version=4\012ViewMode=1\012"
> 
> Notice that there are two things wrong here: PreviewsShown=false should not
> be saved, and ViewMode=1 should not be saved.
> 
> If I enable previews, then
> 
> $ getfattr -d Pictures/Wallpapers
> user.kde.fm.viewproperties#1="[Dolphin]\012Timestamp=2025,2,6,22,50,8.
> 382\012Version=4\012ViewMode=1\012"
> 
> Again, wrong, because PreviewsShown=true should be saved!
> 
> And what happens when I changed both to Icons view and show previews? Bingo!
> 
> $ getfattr -d Pictures/Wallpapers
> (Nothing!)
> 
> When it should, instead, have saved both PreviewsShown=true and the view
> mode...
> 
> In the source code, the attributes are deleted because boolean allDefault
> (line 534 in current master) gets set to true.
> 
> Hope this helps someone more familiar with Dolphin source code. If I'm not
> wrong above (which maybe I am...), I don't understand why is so hard to
> reproduce the issue...

Well spotted indeed, that's an issue.
https://invent.kde.org/system/dolphin/-/blob/master/src/views/viewproperties.cpp#L535
It uses item->isDefault() but this compares to the hardcoded default view
settings, not the use defined ones as expected.
Something I had overlooked.

That would mean dolphin with debug logs would exhibit `clearing extended
attributes for` sometimes.
But I didn't see it previously.
Do you see it when using ?
QT_LOGGING_RULES="org.kde.dolphin.debug=true" dolphin
I don't want to waste your time though, with the getfattr logs you shared, I
can already confirm the issue.
Thank you verify much for this research work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.