File templates tool: with no open document, use base dir of project or home
ClosedPublic

Authored by kossebau on Jan 18 2017, 6:16 PM.

Details

Summary

Currently without any document open, the base dir used for the newly
created files is an invalid empty url and in debug builds also triggers
an assert in TemplateClassGenerator constructor.

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau updated this revision to Diff 10334.Jan 18 2017, 6:16 PM
kossebau retitled this revision from to File templates tool: with no open document, use base dir of project or home.
kossebau updated this object.
kossebau added a reviewer: KDevelop.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 18 2017, 6:16 PM

Same comment as for D4216 - with this patch too, there'd be three copies of "find if there's a single selected or active project, do something", and there are still several other features that should have consistent behaviour.

Please do factor this out before adding another copy.

Any proposal how to factor this out? I have no idea where exactly and how this could be added, so need some pointing.

Any proposal how to factor this out? I have no idea where exactly and how this could be added, so need some pointing.

mwolff accepted this revision.Jan 22 2017, 8:05 PM
mwolff added a reviewer: mwolff.
mwolff added a subscriber: mwolff.

I agree that this could share some code probably in one way or another, but I'm not too obsessed about it.

This revision is now accepted and ready to land.Jan 22 2017, 8:05 PM

oh and: 5.0 branch, so adding new API is probably out of the question anyways, so go for it

This revision was automatically updated to reflect the committed changes.