Bug 299094 - Store source formats in kdevelop, not in the session
Summary: Store source formats in kdevelop, not in the session
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Astyle (show other bugs)
Version: 4.2.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2012-04-30 09:48 UTC by Phil Evans
Modified: 2022-11-30 11:27 UTC (History)
5 users (show)

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 Phil Evans 2012-04-30 09:48:32 UTC
When a custom source formatting style is defined, it seems to only exist in the specific session it was created for, and is ignored by default when that session is reloaded.

To reproduce
Create a new session & project
Settings -> Configure Kdevelop -> Source formatter
Click "new", and add a new style, called, e.g. "TESTME" Give it some settings.
Either close kdevelop and re-open, or click "Session -> New"
Go the source formatter settings: "TESTME" will not be present as an option.

Also:

close kdevelop. Reopen it and load the session in which the "TESTME" style was created. Open one of your code files covered by the "TESTME" style, and then click on "Edit -> Reformat Source". The source will be reformatted according to the default style, not the TESTME style. I have to go back into the "Configure kdevelop" menu and deselect/reselect the TESTME style each time I reload kdevelop, to ensure that reformatting uses that style, not the default.
Comment 1 Robert Grasböck 2013-07-08 21:38:54 UTC
It would be also very very useful to make an import/export interface. 

Example:
If a team of developers introduce a coding style for their projects, it is now impossible to share that style to new team members. It is more worse because every single session has now a different formatting style.
 
Auto format is a very good function in KDevelop, I use it every day at work. With sharing a formatting style that would be nearly perfect.
Comment 2 Benedikt Geißler 2015-06-03 15:15:26 UTC
My "workaround" is to just select the "KDElibs" preset because it's quite similar to my preferred coding style, but others' mileage may vary.
Comment 3 Amish Naidu 2018-08-05 05:59:01 UTC
Can not reproduce with the latest development version, commit 17547955a8.
The formatting style appears after reloads and in different sessions.
Comment 4 Justin Zobel 2022-11-29 05:06:01 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 5 Igor Kushnir 2022-11-30 11:27:43 UTC
> When a custom source formatting style is defined, it seems to only exist in the specific session it was created for, and is ignored by default when that session is reloaded.
This part of the issue has been fixed years ago by storing the styles globally in kdeveloprc.

> I have to go back into the "Configure kdevelop" menu and deselect/reselect the TESTME style each time I reload kdevelop, to ensure that reformatting uses that style, not the default.
I don't recall ever encountering this bug. Most likely it has been fixed years ago.