Bug 392255

Summary: icons moved on start is resolved ? 47177 still occur in 5.36.0 version
Product: [Plasma] plasmashell Reporter: Robert Laney <bobylaney>
Component: FolderAssignee: Eike Hein <hein>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nate, plasma-bugs
Priority: NOR    
Version: 5.8.0   
Target Milestone: 1.0   
Platform: OpenMandriva   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Robert Laney 2018-03-24 07:50:46 UTC
problem (horripilating ! ;-)):
on logging, icons position on desktop changed since last logoff.
Mainly some (but not all) icons moved from their position somewhere in the screen to the first top line, aligned in sequence.
plasma desktop appearance is on "display directory"

Of course, no manual icons moves where done before logon/logoff and icons where "locked" and desktop graphic components also

analysis :

- modification of "~/.config/plasma-org.kde.plasma.desktop-appletsrc" in the [Containments][1][General] section has occured
- further analysis in the KDE 5.36.0 sources locates usage of this file by :
	/KDE5/src/kactivities-5.36.0/src/imports/activitymodel.cpp
class BackgroundCache {
    public:
        BackgroundCache             ()
            : initialized(false), plasmaConfig("plasma-org.kde.plasma.desktop-appletsrc")
        {
        
I suspect a copy/paste typo in emitActivityUpdated () the preceding function in the cpp listing ;
but maybe its correct because I haven't done in-deep code review.

    template <typename _Model, typename _Container>
    static inline
    void emitActivityUpdated(_Model *model,
                             const _Container &container,
                             const QString &activity, int role)
    {
        auto position = Private::activityPosition(container, activity);

        if (position) {
            emit model->dataChanged(
                model->index(position->first),model->index(position->first),
                role == Qt::DecorationRole ? QVector<int> {role, ActivityModel::ActivityIcon} : QVector<int> {role}
            );
        }
    }
maybe should be modified as follows :
            emit model->dataChanged(
                model->index(position->first),model->index(position->last),

I don't want to recompile KDE to check if this can solve the problem because I don't have a development platform.
But please let me know if this is the answer ...
Comment 1 Ivan Čukić 2018-03-24 18:40:35 UTC
Hi Robert,

Icon positions have absolutely nothing to do with the activities library. appletsrc file is mainly used by plasmashell where the layout is handled. I'm assigning this to folderview which is the component which does the icon handing on the desktop.

As for the suggested typo, it is not - it is just a peculiarity of Qt's API - you can not say that one thing has changed, you need to tell it that things from this one to this one changed - position->first is repeated because of that.
Comment 2 Nate Graham 2020-01-23 18:40:07 UTC

*** This bug has been marked as a duplicate of bug 354802 ***