Bug 295500 - SessionPrettyContents in sessionrc of new session written as "(no projects)" after project is opened
Summary: SessionPrettyContents in sessionrc of new session written as "(no projects)" ...
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: session (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR normal
Target Milestone: 1.2.3
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-07 23:58 UTC by Eike Hein
Modified: 2012-03-08 00:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Hein 2012-03-07 23:58:20 UTC
When creating a new, empty session in KDevelop and then opening the first project in it, SessionPrettyContents in sessionrc is set to "(no projects)". This writeout only occurs when the first project is opened, and is obviously not actually true at this point: We did just add a project, after all.

Writing this key is done by Session::updateDescription(), which loops over the project files listed in '[General Options]Open Projects' in the same file. My guess is that there's a race condition causing updateDescription() to be called before 'Open Projects' has been written.

When closing the session/app, the method runs again and the correct SessionPrettyContents is written.

The reason we need this to done correctly the first time is for the data engine that's monitoring the session dirs and feeding data to the KDevelop Sessions plasmoid: With the current behavior, the new session pops up as "(no projects)" in the session list. That said, the same is probably true for kdevelop --ps in this situation.
Comment 1 Eike Hein 2012-03-08 00:03:44 UTC
It's odd though, ProjectController::projectImportingFinished() calls saveListOfOpenedProjects() before emitting the projectOpened() signal that causes SessionController::updateSessionDescriptions() to run, and saveListOfOpenedProjects() does take care to sync() the KConfig group. In theory the sequence is correct, yet for some reason Session::updateDescription() winds up with an empty project list.
Comment 2 Eike Hein 2012-03-08 00:21:35 UTC
Git commit 13275264b9d9bf18bb6b2e641f3b8a033b9c5654 by Eike Hein.
Committed on 08/03/2012 at 01:20.
Pushed by hein into branch 'master'.

Write proper SessionsPrettyContents value to disk immediately.

M  +1    -0    shell/session.cpp

http://commits.kde.org/kdevplatform/13275264b9d9bf18bb6b2e641f3b8a033b9c5654