Bug 368121 - Change in sorting mode only has effect after Dolphin to be restarted
Summary: Change in sorting mode only has effect after Dolphin to be restarted
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 23.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 407078 420555 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-01 20:11 UTC by Patrick Silva
Modified: 2023-05-10 17:21 UTC (History)
5 users (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 Patrick Silva 2016-09-01 20:11:01 UTC
Sort setting change does effect only after restart Dolphin


Reproducible: Always

Steps to Reproduce:
1. Open Dolphin and open its settings dialog
2. On left site select "General", change "Sorter mode" and apply the change


Actual Results:  
Previous setting is still working until Dolphin is restarted

Expected Results:  
New setting works immediately
Comment 1 Nate Graham 2017-09-04 04:00:59 UTC
Confirmed.
Comment 2 Jaime Torres 2018-09-11 12:00:17 UTC
There is no need to restart. It is enough to close and open again the settings dialog. But the bug is still valid.

For developers:
According to GammaRay, dolphin has two objects GeneralSettings (but it should be  a singleton!), one created in:
    return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile); in dolphin/src/global.cpp (47)
and the other created in:
        mainWindow->openDirectories(urls, splitView); in dolphin/src/main.cpp (151)
...
    loadSortingSettings(); in src/kitemviews/kfileitemmodel.cpp (60)
Comment 3 Patrick Silva 2019-04-30 10:42:22 UTC
*** Bug 407078 has been marked as a duplicate of this bug. ***
Comment 4 Patrick Silva 2019-08-06 18:43:13 UTC
it's still reproducible with Dolphin 19.08 RC on Arch Linux.

1. open Dolphin
2. press ctrl+shift+, to open Dolphin preferences
3.. change "Sorting mode" in "General" section
4. click 'OK" button

Actual Results:  
Previous sorting mode is still working until Dolphin is restarted

Expected Results:  
New sorting mode works immediately

Operating System: Arch Linux 
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60.0
Qt Version: 5.13.0
Comment 5 Jason Walker 2020-10-05 19:40:06 UTC
Looking into this, and it seems like the issue is that the GeneralSettings object is not emitting the sortingChoiceChanged signal when the sorting choice is actually changed. It does emit the sortingChoiceChanged signal when the dialog is opened, which is why reopening the settings dialog applies the sorting. This is connected to the KFileItemModel slot slotSortingChoiceChanged. 

The GeneralSettings class is generated by the dolphin_generalsettings.kcfg file, so it seems weird that it isn't emitting signals correctly. That should be automatic? Jamie Torres's comment above suggests that there are two instances of the GeneralSettings singleton, so perhaps they're both emitting the signal at different times, and the one that is emitting it when the dialog is opened but not when the setting is changed is the one that is being connected to the KFileItemModel?
Comment 6 Patrick Silva 2021-04-14 12:46:43 UTC
*** Bug 420555 has been marked as a duplicate of this bug. ***